Merge pull request #11188 from dataease/refactor_app-check-tips

refactor(仪表板、数据大屏): 应用提示优化
This commit is contained in:
王嘉豪 2024-07-26 09:21:57 +08:00 committed by GitHub
commit 436621cbb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import componentList, {
import eventBus from '@/utils/eventBus'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import {
appCanvasNameCheck,
decompression,
dvNameCheck,
findById,
@ -24,6 +25,7 @@ import {
} from '@/views/chart/components/editor/util/chart'
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
import { deepCopy } from '@/utils/utils'
import { ElMessage } from 'element-plus-secondary'
const dvMainStore = dvMainStoreWithOut()
const { curBatchOptComponents, dvInfo, canvasStyleData, componentData, canvasViewInfo, appData } =
storeToRefs(dvMainStore)
@ -355,6 +357,20 @@ export async function canvasSave(callBack) {
watermarkInfo: null
}
let dsNameCheck = 'success'
if (appData.value) {
await appCanvasNameCheck({
datasetFolderPid: canvasInfo.datasetFolderPid,
datasetFolderName: canvasInfo.datasetFolderName
}).then(rsp => {
dsNameCheck = rsp.data
})
}
if (dsNameCheck === 'repeat') {
ElMessage.error('数据集名称已存在')
return
}
const method = dvInfo.value.id && dvInfo.value.optType !== 'copy' ? updateCanvas : saveCanvas
if (method === updateCanvas) {
await dvNameCheck({