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