mirror of
https://github.com/dataease/dataease.git
synced 2026-05-20 02:58:10 +08:00
feat: 增加全局loading
This commit is contained in:
20
frontend/src/utils/loading.js
Normal file
20
frontend/src/utils/loading.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import store from '@/store'
|
||||
|
||||
export const tryShowLoading = identification => {
|
||||
if (!identification) return
|
||||
// const count = store.getters.loadingMap[identification]
|
||||
|
||||
store.dispatch('request/addLoading', identification)
|
||||
}
|
||||
|
||||
export const tryHideLoading = identification => {
|
||||
if (!identification) return
|
||||
const count = store.getters.loadingMap[identification]
|
||||
if (count > 0) {
|
||||
// setTimeout(() => {
|
||||
// store.dispatch('request/reduceLoading', identification)
|
||||
// }, 1000)
|
||||
store.dispatch('request/reduceLoading', identification)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user