From 90f5671544e01f8c3187eafbfc961c6334b931b0 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 23 Jan 2024 12:37:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E7=BB=84=E5=90=88=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/modules/data-visualization/copy.ts | 4 ++++ .../src/store/modules/data-visualization/dvMain.ts | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/core/core-frontend/src/store/modules/data-visualization/copy.ts b/core/core-frontend/src/store/modules/data-visualization/copy.ts index e61afca528..d3da8c80fe 100644 --- a/core/core-frontend/src/store/modules/data-visualization/copy.ts +++ b/core/core-frontend/src/store/modules/data-visualization/copy.ts @@ -108,6 +108,9 @@ export const copyStore = defineStore('copy', { // 旧-新ID映射关系 const idMap = {} const newComponent = deepCopyHelper(data, idMap) + if (newComponent.canvasId.includes('Group')) { + newComponent.canvasId = 'canvas-main' + } dvMainStore.addCopyComponent(newComponent, idMap, copyDataTemp.copyCanvasViewInfo) if (dvInfo.value.type === 'dashboard') { if (dvMainStore.multiplexingStyleAdapt && copyDataTemp.copyFrom === 'multiplexing') { @@ -115,6 +118,7 @@ export const copyStore = defineStore('copy', { } eventBus.emit('addDashboardItem-' + newComponent.canvasId, newComponent) } + i++ } }, moveTime) 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 4c3f21cba4..37cad0c879 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -221,7 +221,17 @@ export const dvMainStore = defineStore('dataVisualization', { }) } } + if (!this.curComponent) { + this.componentData.forEach(componentItem => { + componentItem['canvasActive'] = false + }) + } if (component) { + this.componentData.forEach(componentItem => { + if (!component.canvasId.includes(componentItem.id)) { + componentItem['canvasActive'] = false + } + }) // Is the current component in editing status if (!this.curComponent) { component['editing'] = false