Переглянути джерело

更新V1.0.6后BUG修复、柱状图BUG修复

yangxiao 3 роки тому
батько
коміт
81560e126a

+ 6 - 2
src/components/chart/bar/list-bar-chart2.vue

@@ -72,7 +72,7 @@ export default {
   methods: {
     initChart(value, index) {
       var currColor = this.colors[index % 2];
-      var $dom = document.getElementById(this.id + (index + 1));
+      var $dom = document.getElementById((this.id + (index + 1)));
       $dom.style.width = this.width;
       $dom.style.height = `calc(${this.height} / ${this.list.length} - 4px)`;
       let chart = echarts.init($dom);
@@ -295,7 +295,11 @@ export default {
     });
   },
   updated() {
-    this.initChart();
+    this.$nextTick(() => {
+      this.list.forEach((value, index) => {
+        this.initChart(value, index);
+      });
+    });
   },
 };
 </script>

+ 13 - 13
src/views/Home/Home.vue

@@ -109,7 +109,7 @@
             <tr class="">
               <td class="text gray">装机容量</td>
               <td class="value green">{{jczbmap.zjrl}}</td>
-              <td class="unit gray">万kwh</td>
+              <td class="unit gray">万kw</td>
             </tr>
             <tr class="">
               <td class="text gray">装机台数</td>
@@ -670,7 +670,17 @@ export default {
           that.dialogShow = true;
         }
       });
-    }
+    },
+
+    // 地图进入事件
+    onEnter() {
+      this.powerplanShowSingle = true;
+    },
+
+    // 地图退出事件
+    onBack() {
+      this.powerplanShowSingle = false;
+    },
   },
 
   created () {
@@ -686,17 +696,7 @@ export default {
   unmounted () {
     clearInterval(this.timmer);
     this.timmer = null;
-  },
-  methods: {
-    // 地图进入事件
-    onEnter() {
-      this.powerplanShowSingle = true;
-    },
-    // 地图退出事件
-    onBack() {
-      this.powerplanShowSingle = false;
-    },
-  },
+  }
 };
 </script>
 

+ 1 - 1
src/views/Home/components/power-review.vue

@@ -3,7 +3,7 @@
     <Row type="flex" justify="center" :align="'middle'">
       <!-- 功率复核 PowerLoad -->
       <Col v-for="item in PowerLoad" :key="item" :span="6">
-      <dash-pie-chart :title="item.title" :value="item.value" height="9.722vh" />
+        <dash-pie-chart :title="item.title" :value="item.value" height="9.722vh" />
       </Col>
     </Row>
   </div>