Merge pull request #13967 from dataease/pr@dev-v2@fix_new-redo

fix(仪表板、数据大屏): 修复新建仪表板保存后做撤销操作,会重新新建问题 #13936
This commit is contained in:
王嘉豪
2024-12-11 11:16:25 +08:00
committed by GitHub

View File

@@ -94,6 +94,8 @@ export const snapshotStore = defineStore('snapshot', {
this.snapshotIndex--
const componentSnapshot =
deepCopy(this.snapshotData[this.snapshotIndex]) || getDefaultCanvasInfo()
componentSnapshot.dvInfo.id = dvInfo.value.id
componentSnapshot.dvInfo.pid = dvInfo.value.pid
// undo 是当前没有记录
this.snapshotPublish(componentSnapshot)
this.styleChangeTimes++
@@ -104,6 +106,8 @@ export const snapshotStore = defineStore('snapshot', {
if (this.snapshotIndex < this.snapshotData.length - 1) {
this.snapshotIndex++
const snapshotInfo = deepCopy(this.snapshotData[this.snapshotIndex])
snapshotInfo.dvInfo.id = dvInfo.value.id
snapshotInfo.dvInfo.pid = dvInfo.value.pid
this.snapshotPublish(snapshotInfo)
this.styleChangeTimes++
}
@@ -114,7 +118,6 @@ export const snapshotStore = defineStore('snapshot', {
dvMainStore.setCanvasViewInfo(snapshotInfo.canvasViewInfo)
dvMainStore.setNowPanelJumpInfoInner(snapshotInfo.nowPanelJumpInfo)
dvMainStore.setNowPanelTrackInfo(snapshotInfo.nowPanelTrackInfo)
dvMainStore.updateCurDvInfo(snapshotInfo.dvInfo)
const curCacheViewIdInfo = deepCopy(this.cacheViewIdInfo)
this.cacheViewIdInfo = snapshotInfo.cacheViewIdInfo