From 7550fb636fec7a84dbdea55196d97ed635d7ab10 Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期四, 24 八月 2023 14:16:41 +0800
Subject: [PATCH] 平台端bug修改

---
 screen_standard/src/views/index.vue |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/screen_standard/src/views/index.vue b/screen_standard/src/views/index.vue
index c9970c2..864ebad 100644
--- a/screen_standard/src/views/index.vue
+++ b/screen_standard/src/views/index.vue
@@ -272,13 +272,16 @@
 
 watch(() => departId.value, (val) => {
   if (val) {
+    clearTimeout(timer.value)
+    clearTimeout(timer5.value)
     init()
+    timer5.value = setInterval(init, 60000)
+    timer.value = setInterval(scrillAction, 100)
   }
 })
 
 
 const init = () => {
-  console.log(timer.value);
   // 褰撴棩鍛樺伐浜ч噺TOP10
   getTop(companyId.value, departId.value)
     .then(res => {
@@ -359,7 +362,6 @@
             num: item.unqualifiedNum
           }
         })
-        console.log(data.num);
         setTypeChart()
       }
     })
@@ -753,14 +755,17 @@
 }
 
 onMounted(() => {
+  if (departId.value) {
+    console.log('onMounted');
+    init()
+    timer5.value = setInterval(init, 60000)
+    timer.value = setInterval(scrillAction, 100)
+  }
   window.addEventListener('resize', () => {
     setTypeChart()
     setDayChart()
   })
-  if (!departId.value) return;
-  init()
-  timer5.value = setInterval(init, 60000)
-  timer.value = setInterval(scrillAction, 100)
+  
 })
 
 onUnmounted(() => {

--
Gitblit v1.9.3