Merge pull request #8063 from dataease/pr@dev-v2@refactor_save-button

refactor(数据大屏): 保存按钮防止重复提交
This commit is contained in:
王嘉豪 2024-02-19 17:30:32 +08:00 committed by GitHub
commit 356cee93f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 13 deletions

View File

@ -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 = () => {

View File

@ -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 = () => {