From 6b3f3ee96c151da2a472e8df5ed76a7c7af9e558 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 29 May 2025 15:45:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20=E4=BF=AE=E5=A4=8Dtab?= =?UTF-8?q?=20=E7=BB=84=E4=BB=B6=E6=8B=96=E5=85=A5=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E5=9B=BE=E8=A1=A8=E4=BC=9A=E6=B6=88=E5=A4=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#16145?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/data-visualization/canvas/CanvasCore.vue | 2 +- .../src/store/modules/data-visualization/dvMain.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 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 095893a6a9..4cbcb52e6f 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -935,7 +935,7 @@ function removeItem(index) { dvMainStore.removeLinkageInfo(item['id']) if (isMainCanvas(canvasId.value)) { // 主画布中存在隐藏组件 直接从原始componentData中进行删除 - dvMainStore.deleteComponentById(item.id) + dvMainStore.deleteComponentById(item.id, undefined, false) } else { componentData.value.splice(index, 1) } diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index 74a1d51c63..56f0283469 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -552,15 +552,15 @@ export const dvMainStore = defineStore('dataVisualization', { }) }, - deleteComponentById(componentId, componentData = this.componentData) { + deleteComponentById(componentId, componentData = this.componentData, deep = true) { if (componentId) { let indexResult componentData.forEach((component, index) => { if (componentId === component.id) { indexResult = index - } else if (component.component === 'Group') { + } else if (deep && component.component === 'Group') { this.deleteComponentById(componentId, component.propValue || []) - } else if (component.innerType === 'DeTabs') { + } else if (deep && component.innerType === 'DeTabs') { component.propValue.forEach(ele => { this.deleteComponentById(componentId, ele.componentData || []) })