refactor(数据大屏): 保存按钮防止重复提交

This commit is contained in:
wangjiahao 2024-02-19 17:29:00 +08:00
parent 2205709244
commit c094606dc3
2 changed files with 19 additions and 13 deletions

View File

@ -141,16 +141,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

@ -84,10 +84,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 = () => {