From bfe359c440c8bcdb98dd688a9ba203dbcdb1bb2d Mon Sep 17 00:00:00 2001 From: Pang Date: Wed, 3 Apr 2024 07:53:44 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/pages/manage/dashboard.vue | 12 +++++++++++- resources/assets/js/pages/manage/messenger.vue | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/pages/manage/dashboard.vue b/resources/assets/js/pages/manage/dashboard.vue index d1264e165..30697a521 100644 --- a/resources/assets/js/pages/manage/dashboard.vue +++ b/resources/assets/js/pages/manage/dashboard.vue @@ -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) + } } }, diff --git a/resources/assets/js/pages/manage/messenger.vue b/resources/assets/js/pages/manage/messenger.vue index e6bfb56d1..1f67fc098 100644 --- a/resources/assets/js/pages/manage/messenger.vue +++ b/resources/assets/js/pages/manage/messenger.vue @@ -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)