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