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 513f95eb5e..91b5383477 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -883,7 +883,9 @@ export const dvMainStore = defineStore('dataVisualization', { if (this.dvInfo) { this.dvInfo.dataState = 'ready' this.dvInfo.optType = null - this.dvInfo.id = newId + if (newId) { + this.dvInfo.id = newId + } } }, createInit(dvType, resourceId?, pid?) { diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 8e805f9bcc..602f9965c2 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -168,9 +168,7 @@ export function canvasSave(callBack) { const method = dvInfo.value.id ? updateCanvas : saveCanvas method(canvasInfo).then(res => { - if (res && res.data) { - dvMainStore.updateDvInfoId(res.data) - } + dvMainStore.updateDvInfoId(res.data) snapshotStore.resetStyleChangeTimes() callBack(res) })