mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 12:42:51 +00:00
perf: 优化数据读取机制
This commit is contained in:
parent
ee8f67793a
commit
bfe359c440
@ -123,6 +123,10 @@ export default {
|
||||
|
||||
...mapGetters(['dashboardTask', 'assistTask', 'transforTasks']),
|
||||
|
||||
routeName() {
|
||||
return this.$route.name
|
||||
},
|
||||
|
||||
columns() {
|
||||
const list = [];
|
||||
['today', 'overdue', 'all'].some(type => {
|
||||
@ -159,8 +163,14 @@ export default {
|
||||
|
||||
watch: {
|
||||
windowActive(active) {
|
||||
if (this.routeName !== 'manage-dashboard') {
|
||||
return
|
||||
}
|
||||
this.loadInterval(active)
|
||||
this.loadLicense(active);
|
||||
this.loadLicense(active)
|
||||
if (active) {
|
||||
this.$store.dispatch("getTaskForDashboard", 600)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -565,6 +565,10 @@ export default {
|
||||
}, 600);
|
||||
},
|
||||
|
||||
windowActive(val) {
|
||||
this.updateDialogs(val ? 1000 : -1);
|
||||
},
|
||||
|
||||
tabActive: {
|
||||
handler(val) {
|
||||
if (val == 'contacts') {
|
||||
@ -1067,7 +1071,7 @@ export default {
|
||||
this.__updateDialogs && clearTimeout(this.__updateDialogs)
|
||||
if (timeout > -1) {
|
||||
this.__updateDialogs = setTimeout(_ => {
|
||||
if (this.tabActive === 'dialog') {
|
||||
if (this.tabActive === 'dialog' && this.routeName === 'manage-messenger') {
|
||||
this.$store.dispatch("getDialogAuto").catch(() => {});
|
||||
}
|
||||
}, timeout)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user