diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue index 90a8e4ad5b..712cbe22b2 100644 --- a/core/core-frontend/src/components/dashboard/DbToolbar.vue +++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue @@ -142,16 +142,19 @@ const saveCanvasWithCheck = () => { } const saveResource = () => { - dvMainStore.matrixSizeAdaptor() - queryList.value.forEach(ele => { - useEmitt().emitter.emit(`updateQueryCriteria${ele.id}`) - }) - - canvasSave(() => { + if (styleChangeTimes.value > 0) { snapshotStore.resetStyleChangeTimes() - ElMessage.success('保存成功') - window.history.pushState({}, '', `#/dashboard?resourceId=${dvInfo.value.id}`) - }) + dvMainStore.matrixSizeAdaptor() + queryList.value.forEach(ele => { + useEmitt().emitter.emit(`updateQueryCriteria${ele.id}`) + }) + + canvasSave(() => { + snapshotStore.resetStyleChangeTimes() + ElMessage.success('保存成功') + window.history.pushState({}, '', `#/dashboard?resourceId=${dvInfo.value.id}`) + }) + } } const clearCanvas = () => { diff --git a/core/core-frontend/src/components/data-visualization/DvToolbar.vue b/core/core-frontend/src/components/data-visualization/DvToolbar.vue index 7abdb4cddb..180e0575c2 100644 --- a/core/core-frontend/src/components/data-visualization/DvToolbar.vue +++ b/core/core-frontend/src/components/data-visualization/DvToolbar.vue @@ -85,10 +85,13 @@ const saveCanvasWithCheck = () => { } const saveResource = () => { - canvasSave(() => { - ElMessage.success('保存成功') - window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`) - }) + if (styleChangeTimes.value > 0) { + snapshotStore.resetStyleChangeTimes() + canvasSave(() => { + ElMessage.success('保存成功') + window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`) + }) + } } const clearCanvas = () => {