ly 3 jaren geleden
bovenliggende
commit
a0892c0089

+ 7 - 0
ui/src/views/front/bottomEnergy.vue

@@ -47,6 +47,13 @@ export default {
   },
   mounted() {
     this.initChart()
+    // 每隔秒请求一次数据
+    window.setInterval(() => {
+      setTimeout(() => {
+        ///调取接口获取数据
+        this.initChart();
+      }, 0)
+    }, 1000 * 10 * 6 * 60 * 6)
   },
   methods: {
     beforeDestroy() {

+ 7 - 0
ui/src/views/front/bottomLeft.vue

@@ -43,6 +43,13 @@ export default {
   },
   mounted() {
     this.initChart()
+    // 每隔秒请求一次数据
+    window.setInterval(() => {
+      setTimeout(() => {
+        ///调取接口获取数据
+        this.initChart();
+      }, 0)
+    }, 1000 * 10 * 6 * 60 * 6)
   },
   methods: {
     beforeDestroy() {

+ 7 - 0
ui/src/views/front/energyConsumption.vue

@@ -40,6 +40,13 @@ export default {
   },
   mounted() {
     this.initChart();
+    // 每隔秒请求一次数据
+    window.setInterval(() => {
+      setTimeout(() => {
+        ///调取接口获取数据
+        this.initChart();
+      }, 0)
+    }, 1000 * 10 * 6 * 60 * 6)
   },
   methods: {
     initChart() {

+ 4 - 10
ui/src/views/front/productProportion.vue

@@ -39,25 +39,19 @@ export default {
   },
   mixins: [resize],
   mounted() {
-    this.getList()
+    this.initChart()
     // 每隔30秒请求一次数据
-    window.setInterval(() => {undefined
-      setTimeout(() => {undefined
+    window.setInterval(() => {
+      setTimeout(() => {
         ///调取接口获取数据
-        this.getList();
+        this.initChart();
       }, 0)
     }, 20000)
   },
   methods: {
-    /** 查询dashboard抓取数据列表 */
-    getList()
-    {
-        this.initChart();
-    },
     initChart() {
       // 基于准备好的dom,初始化echarts实例
       this.chart = this.echarts.init(document.getElementById("productProportion"));
-
       this.chart.setOption({
         color: [
           "#37a2da",

+ 1 - 1
ui/src/views/monitor/elec/index.vue

@@ -361,7 +361,7 @@
           ///调取接口获取数据
           this.getMonthList();
         }, 0)
-      }, 20000)
+      }, 1000 * 10 * 6 * 60 * 6)
     },
     beforeDestroy(){
       if(this.timer){