From 908a596641fa73f0b7b022f16db1ce099fe4abb0 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 29 Dec 2023 18:14:35 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/modules/data-visualization/dvMain.ts | 4 +++- core/core-frontend/src/utils/canvasUtils.ts | 4 +--- 2 files changed, 4 insertions(+), 4 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 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) })