浏览代码

LY js bugfix

ly 2 年之前
父节点
当前提交
9a55d5a51f

+ 4 - 5
ui/src/views/dashboard/productProportion.vue

@@ -88,12 +88,11 @@ export default {
   mounted() {
     this.getList()
     // 每隔30秒请求一次数据
-    window.setInterval(() => {
-      setTimeout(() => {
-        ///调取接口获取数据
-        this.getList();
-      }, 0)
+    // 每隔秒请求一次数据
+    setInterval(() => {
+      this.getList();
     }, 10000)
+
   },
   methods: {
     /** 查询dashboard抓取数据列表 */

+ 4 - 6
ui/src/views/front/bottomEnergy.vue

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

+ 3 - 6
ui/src/views/front/bottomLeft.vue

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

+ 4 - 6
ui/src/views/front/energyConsumption.vue

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

+ 6 - 16
ui/src/views/front/productProportion.vue

@@ -22,35 +22,25 @@
 </template>
 
 <script>
-import productProportion from "../dashboard/productProportion";
 import resize from "@/views/dashboard/mixins/resize";
 export default {
   props: ['dashboarddata','transformdata'],
   components: {
-    productProportion
   },
   data() {
     return {
       chart: null,
-      // 查询参数
-      queryParams: {
-      },
     };
   },
   mixins: [resize],
   mounted() {
-    this.initChart()
-    // 每隔30秒请求一次数据
-    window.setInterval(() => {
-      setTimeout(() => {
-        ///调取接口获取数据
-        this.$nextTick(() => {
-          this.initChart();
-        })
-
-      }, 0)
-    }, 20000)
+    console.log(this.dashboarddata);
+    this.initChart();
+    setInterval(() => {
+      this.initChart();
+    }, 3600000);
   },
+
   methods: {
     initChart() {
       // 基于准备好的dom,初始化echarts实例

+ 3 - 6
ui/src/views/monitor/bccHome/index.vue

@@ -398,12 +398,9 @@
       }, 30000)
 
       // 一天请求一次数据
-      window.setInterval(() => {
-        setTimeout(() => {
-          ///调取接口获取数据
-          this.getMonthList();
-        }, 0)
-      }, 1000 * 10 * 6 * 60 * 6);
+      setInterval(() => {
+        this.getMonthList();
+      }, 3600000)
 
     },
     beforeDestroy(){

+ 3 - 6
ui/src/views/monitor/elec/index.vue

@@ -355,12 +355,9 @@
       }, 30000)
 
       // 一天请求一次数据
-      window.setInterval(() => {
-        setTimeout(() => {
-          ///调取接口获取数据
-          this.getMonthList();
-        }, 0)
-      }, 1000 * 10 * 6 * 60 * 6)
+      setInterval(() => {
+        this.getMonthList();
+      }, 3600000)
     },
     beforeDestroy(){
       if(this.timer){