浏览代码

首页展示风机编号

SunZehao 2 年之前
父节点
当前提交
ec7420b0b0
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 1 0
      src/components/focus/detailsCharts.vue
  2. 6 4
      src/components/matrixBlock.vue

+ 1 - 0
src/components/focus/detailsCharts.vue

@@ -36,6 +36,7 @@ export default {
   methods: {
     showEcharts(showData) {
       let chartDom = document.getElementById("showEcharts");
+        chartDom.removeAttribute("_echarts_instance_")
       let myChart = echarts.init(chartDom, "#ffffff");
       let option;
       option = {

+ 6 - 4
src/components/matrixBlock.vue

@@ -133,11 +133,13 @@ export default {
   methods: {
     getName(item, type) {
         let name = ''
-        if (item.stationId) {
-            if (type === 'top') {
+        if (type === 'top') {
+            if (item.stationId) {
                 name = item.stationId.slice(0, item.stationId.indexOf('_'))
-            } else {
-                name = item.stationId.slice(item.stationId.indexOf('_'))
+            }
+        } else {
+            if (item.windturbineId) {
+                name = item.windturbineId.slice(item.windturbineId.indexOf('_'))
             }
         }
         return name