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,6 +142,8 @@ const saveCanvasWithCheck = () => {
} }
const saveResource = () => { const saveResource = () => {
if (styleChangeTimes.value > 0) {
snapshotStore.resetStyleChangeTimes()
dvMainStore.matrixSizeAdaptor() dvMainStore.matrixSizeAdaptor()
queryList.value.forEach(ele => { queryList.value.forEach(ele => {
useEmitt().emitter.emit(`updateQueryCriteria${ele.id}`) useEmitt().emitter.emit(`updateQueryCriteria${ele.id}`)
@ -153,6 +155,7 @@ const saveResource = () => {
window.history.pushState({}, '', `#/dashboard?resourceId=${dvInfo.value.id}`) window.history.pushState({}, '', `#/dashboard?resourceId=${dvInfo.value.id}`)
}) })
} }
}
const clearCanvas = () => { const clearCanvas = () => {
dvMainStore.setCurComponent({ component: null, index: null }) dvMainStore.setCurComponent({ component: null, index: null })

View File

@ -85,11 +85,14 @@ const saveCanvasWithCheck = () => {
} }
const saveResource = () => { const saveResource = () => {
if (styleChangeTimes.value > 0) {
snapshotStore.resetStyleChangeTimes()
canvasSave(() => { canvasSave(() => {
ElMessage.success('保存成功') ElMessage.success('保存成功')
window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`) window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`)
}) })
} }
}
const clearCanvas = () => { const clearCanvas = () => {
dvMainStore.setCurComponent({ component: null, index: null }) dvMainStore.setCurComponent({ component: null, index: null })