From 7e48b3eca618b8be9a69a8027299687ed10b9a68 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 24 二月 2023 08:37:01 +0800
Subject: [PATCH] 1.新增定时刷新 两小时一次

---
 src/views/kb/index.vue |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/views/kb/index.vue b/src/views/kb/index.vue
index b7b91fb..fe4eca5 100644
--- a/src/views/kb/index.vue
+++ b/src/views/kb/index.vue
@@ -87,6 +87,11 @@
       value2: 78792
     }
   },
+  created() {
+    setInterval(() => {
+      location.reload()
+    }, 1000 * 60 * 60 * 2)
+  },
   mounted() {
     // 鍔犺浇涓栫晫鍦板浘
     this.loadArea()
@@ -101,7 +106,7 @@
     setInterval(() => {
       this.value1 = Math.floor(Math.random() * 10000 + 5000)
       this.value2 = Math.floor(Math.random() * 10000 + 5000)
-    }, 3000)
+    }, 9000)
   },
   methods: {
 
@@ -147,7 +152,7 @@
         //   }
         // ]
         loadEcharts('pie1', pie1(pie1data))
-      }, 10000)
+      }, 20000)
 
       let bar1data1 = ['92', '90', '96', '98', '99', '97']
       let bar1data2 = ['70', '60', '50', '40', '30']
@@ -159,15 +164,15 @@
         bar1data1 = [Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92)]
         bar1data2 = [Math.floor(Math.random() * 15 + 70), Math.floor(Math.random() * 15 + 70), Math.floor(Math.random() * 15 + 70), Math.floor(Math.random() * 15 + 70), Math.floor(Math.random() * 15 + 70)]
         loadEcharts('bar1', bar1(bar1data1, bar1data2))
-      }, 9000)
+      }, 15000)
 
       //  鍔犺浇宸︿腑
       // let dataY = ['200', '400', '500', '300', '400', '440', '330', '380', '400', '460', '390', '270']
-      const dataY = [8101, 6382, 7541, 7279, 5288, 7562, 7163, 7541, 4288]
-      const dataY2 = [5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000)]
-      const dataY3 = [5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000)]
-      const dataY4 = [3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000)]
-      const dataY5 = [3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000)]
+      const dataY = [8101, 6382, 7541, 7279, 5288, 7562, 7163, 7541, 7541, 7000, 6000, 6500]
+      const dataY2 = [5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000)]
+      const dataY3 = [5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000)]
+      const dataY4 = [3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000)]
+      const dataY5 = [3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000)]
       loadEcharts('line1', line1(dataY, dataY2, dataY3, dataY4, dataY5))
       setInterval(() => {
         // dataY = [
@@ -185,7 +190,7 @@
         //   Math.floor(Math.random() * 100 + 400)
         // ]
         loadEcharts('line1', line1(dataY, dataY2, dataY3, dataY4, dataY5))
-      }, 8000)
+      }, 18000)
 
       //  鍔犺浇鍙充笅
       let scaleData1 = [
@@ -301,7 +306,7 @@
         ]
         loadEcharts('pie2', pie2('鍝佽川宸紓姣斿垪', scaleData1))
         loadEcharts('pie3', pie2('寮傚父棰勮姣斿垪', scaleData2))
-      }, 7000)
+      }, 17000)
 
       let list = [500, 400, 300, 200, 100]
       //  鍔犺浇宸︿笂
@@ -309,23 +314,23 @@
       setInterval(() => {
         list = [Math.floor(Math.random() * 100) + 500, Math.floor(Math.random() * 100) + 400, Math.floor(Math.random() * 100) + 300, Math.floor(Math.random() * 100) + 200, Math.floor(Math.random() * 100) + 100]
         loadEcharts('bar2', bar2(list))
-      }, 6000)
+      }, 26000)
 
       //  鍔犺浇鍙充笂
       loadEcharts('bar3', bar3())
       setInterval(() => {
         loadEcharts('bar3', bar3())
-      }, 5500)
+      }, 22000)
       //  鍔犺浇涓笅
       loadEcharts('bar4', bar4())
       setInterval(() => {
         loadEcharts('bar4', bar4())
-      }, 6500)
+      }, 16500)
 
       loadEcharts('barline1', barline1())
       setInterval(() => {
         loadEcharts('barline1', barline1())
-      }, 7500)
+      }, 17500)
     },
     // 鍔犺浇鍙充腑锛堝純鐢級
     loadCustom1() {

--
Gitblit v1.9.3