From 991d0d3d0c6780dfcaec382c086644e390b2e01b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 27 Aug 2024 13:15:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F):=20=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E5=A4=A7?= =?UTF-8?q?=E5=B1=8FTab=E5=86=85=E7=BB=84=E4=BB=B6=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E5=B1=82=E8=B0=83=E6=95=B4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/modules/data-visualization/common.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/core-frontend/src/store/modules/data-visualization/common.ts b/core/core-frontend/src/store/modules/data-visualization/common.ts index ff51a9b921..2b7af19d3c 100644 --- a/core/core-frontend/src/store/modules/data-visualization/common.ts +++ b/core/core-frontend/src/store/modules/data-visualization/common.ts @@ -7,6 +7,7 @@ export const getCurInfo = () => { if (curComponent.value) { const curComponentId = curComponent.value.id let curIndex = 0 + let curTabIndex = 0 let curComponentData = componentData.value componentData.value.forEach((component, index) => { if (curComponentId === component.id) { @@ -20,9 +21,21 @@ export const getCurInfo = () => { } }) } + if (component.component === 'DeTabs') { + component.propValue.forEach((tabItem, tabIndex) => { + curTabIndex = tabIndex + tabItem.componentData.forEach((tabComponent, subIndex) => { + if (curComponentId === tabComponent.id) { + curIndex = subIndex + curComponentData = tabItem.componentData + } + }) + }) + } }) return { index: curIndex, + tabIndex: curTabIndex, componentData: curComponentData } } From 602c567894c5b563cd98e13ee063b27f9ffaa4e0 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 27 Aug 2024 14:20:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8Dtab=E5=86=85=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=98=BE=E7=A4=BA=E4=BD=8D=E7=BD=AE=E4=B8=8D=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/data-visualization/canvas/CanvasCore.vue | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue index 582eadac04..95be965a74 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -491,7 +491,6 @@ const getSelectArea = () => { } const handleContextMenu = e => { - console.log('====handleContextMenu===') // 仪表板和预览状态不显示菜单和组创建 if (dashboardActive.value || editMode.value === 'preview') { return @@ -1363,11 +1362,7 @@ const linkageSetOpen = item => { } const contextMenuShow = computed(() => { - if (curComponent.value) { - return curComponent.value.canvasId === canvasId.value - } else { - return isMainCanvas(canvasId.value) - } + return isMainCanvas(canvasId.value) }) const markLineShow = computed(() => isMainCanvas(canvasId.value))