mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 21:32:49 +00:00
perf: 优化数据结构
This commit is contained in:
parent
cedffd17b3
commit
195a305fc3
4
resources/assets/js/app.js
vendored
4
resources/assets/js/app.js
vendored
@ -219,6 +219,7 @@ if (isElectron) {
|
|||||||
|
|
||||||
// 同步执行派遣
|
// 同步执行派遣
|
||||||
const dispatchId = $A.randomString(6) + "_" + Date.now().toString()
|
const dispatchId = $A.randomString(6) + "_" + Date.now().toString()
|
||||||
|
$A.syncPauses = new Map();
|
||||||
$A.syncDispatch = (action, data) => {
|
$A.syncDispatch = (action, data) => {
|
||||||
if (!$A.Ready) {
|
if (!$A.Ready) {
|
||||||
return false
|
return false
|
||||||
@ -226,6 +227,9 @@ $A.syncDispatch = (action, data) => {
|
|||||||
if (!isElectron) {
|
if (!isElectron) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if ($A.syncPauses.has(action)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!$A.isJson(data)) {
|
if (!$A.isJson(data)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2037,11 +2037,13 @@ export default {
|
|||||||
getMsgs(data) {
|
getMsgs(data) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
setTimeout(_ => this.msgLoadIng++, 2000)
|
setTimeout(_ => this.msgLoadIng++, 2000)
|
||||||
|
$A.isSubElectron && $A.syncPauses.set("saveDialogMsg", true)
|
||||||
this.$store.dispatch("getDialogMsgs", data)
|
this.$store.dispatch("getDialogMsgs", data)
|
||||||
.then(resolve)
|
.then(resolve)
|
||||||
.catch(reject)
|
.catch(reject)
|
||||||
.finally(_ => {
|
.finally(_ => {
|
||||||
this.msgLoadIng--
|
this.msgLoadIng--
|
||||||
|
$A.isSubElectron && $A.syncPauses.delete("saveDialogMsg")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user