diff --git a/core/core-frontend/src/custom-component/de-tabs/Component.vue b/core/core-frontend/src/custom-component/de-tabs/Component.vue index 7da1567c0c..9c1ce42381 100644 --- a/core/core-frontend/src/custom-component/de-tabs/Component.vue +++ b/core/core-frontend/src/custom-component/de-tabs/Component.vue @@ -50,7 +50,7 @@ { } 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 - }) + handleLoad() + mobileLoading.value = false } const setMobileStyle = debounce(() => { diff --git a/core/core-frontend/src/views/mobile/panel/index.vue b/core/core-frontend/src/views/mobile/panel/index.vue index d47b72e70a..7e69bd72b5 100644 --- a/core/core-frontend/src/views/mobile/panel/index.vue +++ b/core/core-frontend/src/views/mobile/panel/index.vue @@ -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 - tabComponent.x = tx - tabComponent.y = ty - tabComponent.sizeX = tSizeX - tabComponent.sizeY = tSizeY + if (tSizeX && tSizeY) { + tabComponent.x = tx + tabComponent.y = ty + tabComponent.sizeX = tSizeX + tabComponent.sizeY = tSizeY + } }) }) }