Skip to content

Commit

Permalink
perf: 优化数据读取机制
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Apr 2, 2024
1 parent ee8f677 commit bfe359c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 11 additions & 1 deletion resources/assets/js/pages/manage/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ export default {
...mapGetters(['dashboardTask', 'assistTask', 'transforTasks']),
routeName() {
return this.$route.name
},
columns() {
const list = [];
['today', 'overdue', 'all'].some(type => {
Expand Down Expand Up @@ -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)
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion resources/assets/js/pages/manage/messenger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ export default {
}, 600);
},
windowActive(val) {
this.updateDialogs(val ? 1000 : -1);
},
tabActive: {
handler(val) {
if (val == 'contacts') {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bfe359c

Please sign in to comment.