2 Коміти 6cf57fb9fc ... bb6e9f6c4e

Автор SHA1 Опис Дата
  dong bb6e9f6c4e 销毁echarts再重新创建 2 місяців тому
  dong e60e7fd35d 小修改 2 місяців тому
1 змінених файлів з 23 додано та 19 видалено
  1. 23 19
      src/views/module_tpm/equipmentRunStatis/realtime.vue

+ 23 - 19
src/views/module_tpm/equipmentRunStatis/realtime.vue

@@ -212,25 +212,25 @@ export default {
         return
       }
       // 获取图表信息
-      getAction(_this.url.listparams, _this.queryParams).then((res) => {
-        if (res.success) {
-          console.log("listparams")
-          _this.equipmentparams = res.result.records || res.result;
-          getAction(_this.url.list, _this.queryParams).then((res) => {
-          console.log("list")
-            if (res.success) {
-            _this.mongodbdata = [];
-              _this.mongodbdata = res.result.records || res.result;
-              _this.initEcharts();
-            } else {
-              this.$message.warning(res.message)
-            }
-          });
-        } else {
-          this.$message.warning(res.message)
-        }
-      });
-      // this.getTest();
+      // getAction(_this.url.listparams, _this.queryParams).then((res) => {
+      //   if (res.success) {
+      //     console.log("listparams")
+      //     _this.equipmentparams = res.result.records || res.result;
+      //     getAction(_this.url.list, _this.queryParams).then((res) => {
+      //     console.log("list")
+      //       if (res.success) {
+      //       _this.mongodbdata = [];
+      //         _this.mongodbdata = res.result.records || res.result;
+      //         _this.initEcharts();
+      //       } else {
+      //         this.$message.warning(res.message)
+      //       }
+      //     });
+      //   } else {
+      //     this.$message.warning(res.message)
+      //   }
+      // });
+      this.getTest();
     },
     // 后端好了需要删掉
     getTest() {
@@ -241,6 +241,10 @@ export default {
     initEcharts() {
       var _this = this
       var chartDom = this.$refs.trendCharts
+
+      if (_this.myChart != null && _this.myChart.dispose) {
+        _this.myChart.dispose(); // 销毁实例
+      }
       _this.myChart = echarts.init(chartDom)
       _this.echartsHeight = 4 * 300;
       // 获取time