perf: 优化数据读取机制

This commit is contained in:
Pang 2024-04-03 07:53:44 +08:00
parent ee8f67793a
commit bfe359c440
2 changed files with 16 additions and 2 deletions

View File

@ -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)
}
}
},

View File

@ -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)