From 5eec729cc139469ea014ba537e5d57fd58a7e065 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 25 Jul 2024 10:44:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=84=E5=90=88=E7=9B=B8=E5=85=B3=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=9A=E9=80=89=E5=A4=A7=E5=B1=8F=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E6=8B=96=E5=8A=A8=E8=BE=B9=E6=A1=86=E5=90=8E?= =?UTF-8?q?=E7=BB=84=E5=90=88=E5=87=BA=E7=8E=B0=E9=9A=90=E8=97=8F=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=AD=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/modules/data-visualization/dvMain.ts | 6 +++--- .../src/store/modules/data-visualization/snapshot.ts | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) 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),