forked from github/dataease
Merge pull request #9057 from dataease/pr@dev-v2_bug_fix
fix(移动端): 修复移动端布局后仪表板无法继续向tab组件添加图表的问题
This commit is contained in:
commit
6f7ac6ee7e
@ -50,7 +50,7 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
<de-canvas
|
<de-canvas
|
||||||
v-if="isEdit"
|
v-if="isEdit && !mobileInPc"
|
||||||
:ref="'tabCanvas_' + index"
|
:ref="'tabCanvas_' + index"
|
||||||
:component-data="tabItem.componentData"
|
:component-data="tabItem.componentData"
|
||||||
:canvas-style-data="canvasStyleData"
|
:canvas-style-data="canvasStyleData"
|
||||||
|
@ -41,9 +41,6 @@ const mobileStatusChange = (type, value) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleLoad = () => {
|
const handleLoad = () => {
|
||||||
componentData.value.forEach(ele => {
|
|
||||||
ele.inMobile = canvasDataPreview.includes(ele.id)
|
|
||||||
})
|
|
||||||
mobileStatusChange(
|
mobileStatusChange(
|
||||||
'panelInit',
|
'panelInit',
|
||||||
JSON.parse(
|
JSON.parse(
|
||||||
@ -111,26 +108,9 @@ const saveCanvasWithCheckFromMobile = () => {
|
|||||||
ElMessage.success('保存成功')
|
ElMessage.success('保存成功')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
let canvasDataPreview = []
|
|
||||||
const loadCanvasData = () => {
|
const loadCanvasData = () => {
|
||||||
if (!dvInfo.value?.id) {
|
|
||||||
handleLoad()
|
handleLoad()
|
||||||
mobileLoading.value = false
|
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(() => {
|
const setMobileStyle = debounce(() => {
|
||||||
|
@ -30,10 +30,12 @@ const hanedleMessage = event => {
|
|||||||
ele.propValue.forEach(tabItem => {
|
ele.propValue.forEach(tabItem => {
|
||||||
tabItem.componentData.forEach(tabComponent => {
|
tabItem.componentData.forEach(tabComponent => {
|
||||||
const { mx: tx, my: ty, mSizeX: tSizeX, mSizeY: tSizeY } = tabComponent
|
const { mx: tx, my: ty, mSizeX: tSizeX, mSizeY: tSizeY } = tabComponent
|
||||||
|
if (tSizeX && tSizeY) {
|
||||||
tabComponent.x = tx
|
tabComponent.x = tx
|
||||||
tabComponent.y = ty
|
tabComponent.y = ty
|
||||||
tabComponent.sizeX = tSizeX
|
tabComponent.sizeX = tSizeX
|
||||||
tabComponent.sizeY = tSizeY
|
tabComponent.sizeY = tSizeY
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user