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 36709fb489..567afe4125 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -1273,12 +1273,12 @@ export const dvMainStore = defineStore('dataVisualization', { } this.canvasStyleData = { ...deepCopy(DEFAULT_CANVAS_STYLE_DATA_DARK), backgroundColor: null } }, - removeGroupArea() { + removeGroupArea(curComponentData = this.componentData) { // 清理临时组件 - const groupAreaHis = this.componentData.filter(ele => ele.component === 'GroupArea') + const groupAreaHis = curComponentData.filter(ele => ele.component === 'GroupArea') if (groupAreaHis && groupAreaHis.length > 0) { groupAreaHis.forEach(ele => { - this.deleteComponentById(ele.id) + this.deleteComponentById(ele.id, curComponentData) }) } } diff --git a/core/core-frontend/src/store/modules/data-visualization/snapshot.ts b/core/core-frontend/src/store/modules/data-visualization/snapshot.ts index 627ba302d5..085235bc3c 100644 --- a/core/core-frontend/src/store/modules/data-visualization/snapshot.ts +++ b/core/core-frontend/src/store/modules/data-visualization/snapshot.ts @@ -154,10 +154,11 @@ export const snapshotStore = defineStore('snapshot', { recordSnapshot() { this.styleChangeTimes = ++this.styleChangeTimes if (dataPrepareState.value) { - dvMainStore.removeGroupArea() + const snapshotComponentData = deepCopy(componentData.value) + dvMainStore.removeGroupArea(snapshotComponentData) // 添加新的快照 const newSnapshot = { - componentData: deepCopy(componentData.value), + componentData: snapshotComponentData, canvasStyleData: deepCopy(canvasStyleData.value), canvasViewInfo: deepCopy(canvasViewInfo.value), cacheViewIdInfo: deepCopy(this.cacheViewIdInfo),