From 2ade1a1eeb6146bc414a1e90bc46b33572435f88 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 6 Mar 2024 11:45:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=A7=BB=E5=8A=A8=E7=AB=AF):=20tab?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=B8=AD=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6=E5=92=8C?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/canvas/DePreview.vue | 2 +- core/core-frontend/src/utils/canvasUtils.ts | 10 ++++++++++ .../src/views/dashboard/MobileConfigPanel.vue | 11 +++++++++++ .../src/views/mobile/panel/index.vue | 19 +++++++++++++++++-- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue index 5b23bee7c3..3ccfd3bbbd 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -276,7 +276,7 @@ defineExpose({ :style="getShapeItemShowStyle(item)" :show-position="showPosition" :search-count="searchCount" - :scale="mobileInPc ? scaleWidth * 3 : scaleWidth" + :scale="mobileInPc ? 100 : scaleWidth" @userViewEnlargeOpen="userViewEnlargeOpen($event, item)" /> diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 13b5c53e39..52ad68196b 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -160,6 +160,16 @@ export function initCanvasDataMobile(dvId, busiFlag, callBack) { ele.y = my ele.sizeX = mSizeX ele.sizeY = mSizeY + if (ele.component === 'DeTabs') { + ele.propValue.forEach(tabItem => { + tabItem.componentData.forEach(tabComponent => { + tabComponent.x = tabComponent.mx + tabComponent.y = tabComponent.my + tabComponent.sizeX = tabComponent.mSizeX + tabComponent.sizeY = tabComponent.mSizeY + }) + }) + } }) dvMainStore.setComponentData(componentData) dvMainStore.setCanvasStyle(canvasStyleResult) diff --git a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue index 60fd44e3ac..b03a223e45 100644 --- a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue +++ b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue @@ -81,6 +81,17 @@ const hanedleMessage = event => { ele.my = y ele.mSizeX = sizeX ele.mSizeY = sizeY + if (ele.component === 'DeTabs') { + ele.propValue.forEach(tabItem => { + tabItem.componentData.forEach(tabComponent => { + const { x: tx, y: ty, sizeX: tSizeX, sizeY: tSizeY } = com.tab[tabComponent.id] + tabComponent.mx = tx + tabComponent.my = ty + tabComponent.mSizeX = tSizeX + tabComponent.mSizeY = tSizeY + }) + }) + } } }) diff --git a/core/core-frontend/src/views/mobile/panel/index.vue b/core/core-frontend/src/views/mobile/panel/index.vue index 1086bf6e7f..6acb1134a0 100644 --- a/core/core-frontend/src/views/mobile/panel/index.vue +++ b/core/core-frontend/src/views/mobile/panel/index.vue @@ -13,6 +13,7 @@ const checkItemPosition = component => { component.y = dvMainStore.componentData.reduce((pre, next) => { return Math.max(pre, next.y + next.sizeY) }, 1) + component.sizeY = 10 } const hanedleMessage = event => { @@ -50,8 +51,22 @@ const hanedleMessage = event => { { type: 'mobileSaveFromMobile', value: dvMainStore.componentData.reduce((pre, next) => { - const { x, y, sizeX, sizeY, id } = next - pre[id] = { x, y, sizeX, sizeY } + const { x, y, sizeX, sizeY, id, component } = next + pre[id] = { x, y, sizeX, sizeY, component } + if (next.component === 'DeTabs') { + pre[id].tab = {} + next.propValue.forEach(tabItem => { + tabItem.componentData.forEach(tabComponent => { + const { x: tx, y: ty, sizeX: tSizeX, sizeY: tSizeY, id: tId } = tabComponent + pre[id].tab[tId] = { + x: tx, + y: ty, + sizeX: tSizeX, + sizeY: tSizeY + } + }) + }) + } return pre }, {}) },