Merge pull request #7481 from dataease/pr@dev-v2@refactor_copy

refactor: 优化资源复制
This commit is contained in:
王嘉豪 2023-12-29 18:16:05 +08:00 committed by GitHub
commit 6732a476ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -883,8 +883,10 @@ export const dvMainStore = defineStore('dataVisualization', {
if (this.dvInfo) { if (this.dvInfo) {
this.dvInfo.dataState = 'ready' this.dvInfo.dataState = 'ready'
this.dvInfo.optType = null this.dvInfo.optType = null
if (newId) {
this.dvInfo.id = newId this.dvInfo.id = newId
} }
}
}, },
createInit(dvType, resourceId?, pid?) { createInit(dvType, resourceId?, pid?) {
const optName = dvType === 'dashboard' ? '新建仪表板' : '新建数据大屏' const optName = dvType === 'dashboard' ? '新建仪表板' : '新建数据大屏'

View File

@ -168,9 +168,7 @@ export function canvasSave(callBack) {
const method = dvInfo.value.id ? updateCanvas : saveCanvas const method = dvInfo.value.id ? updateCanvas : saveCanvas
method(canvasInfo).then(res => { method(canvasInfo).then(res => {
if (res && res.data) {
dvMainStore.updateDvInfoId(res.data) dvMainStore.updateDvInfoId(res.data)
}
snapshotStore.resetStyleChangeTimes() snapshotStore.resetStyleChangeTimes()
callBack(res) callBack(res)
}) })