fix(移动端): 修复移动端布局后仪表板无法继续向tab组件添加图表的问题

This commit is contained in:
dataeaseShu 2024-04-11 14:22:31 +08:00
parent ef7c2d9a5b
commit 5c499d9237
3 changed files with 9 additions and 27 deletions

View File

@ -50,7 +50,7 @@
</el-dropdown>
</template>
<de-canvas
v-if="isEdit"
v-if="isEdit && !mobileInPc"
:ref="'tabCanvas_' + index"
:component-data="tabItem.componentData"
:canvas-style-data="canvasStyleData"

View File

@ -41,9 +41,6 @@ const mobileStatusChange = (type, value) => {
}
const handleLoad = () => {
componentData.value.forEach(ele => {
ele.inMobile = canvasDataPreview.includes(ele.id)
})
mobileStatusChange(
'panelInit',
JSON.parse(
@ -111,26 +108,9 @@ const saveCanvasWithCheckFromMobile = () => {
ElMessage.success('保存成功')
})
}
let canvasDataPreview = []
const loadCanvasData = () => {
if (!dvInfo.value?.id) {
handleLoad()
mobileLoading.value = false
return
}
findById(dvInfo.value.id, 'dashboard')
.then(res => {
const canvasInfo = res.data
const canvasDataResult = JSON.parse(canvasInfo.componentData) as unknown as Array<{
inMobile: boolean
id: string
}>
canvasDataPreview = (canvasDataResult || []).filter(ele => !!ele.inMobile).map(ele => ele.id)
handleLoad()
})
.finally(() => {
mobileLoading.value = false
})
}
const setMobileStyle = debounce(() => {

View File

@ -30,10 +30,12 @@ const hanedleMessage = event => {
ele.propValue.forEach(tabItem => {
tabItem.componentData.forEach(tabComponent => {
const { mx: tx, my: ty, mSizeX: tSizeX, mSizeY: tSizeY } = tabComponent
if (tSizeX && tSizeY) {
tabComponent.x = tx
tabComponent.y = ty
tabComponent.sizeX = tSizeX
tabComponent.sizeY = tSizeY
}
})
})
}