Browse Source

功率预测矩阵图表修复展示内容错误问题

baiyanting 1 year ago
parent
commit
a1a0cbf0ef

+ 5 - 13
src/views/stateMonitor/powerPredictMatrix/components/multiple-line-chart.vue

@@ -25,16 +25,16 @@ export default {
       default: () => {},
       default: () => {},
     },
     },
     isDouble: { type: Boolean, default: false },
     isDouble: { type: Boolean, default: false },
-    type: { type: String, default: "" },
+    type: { type: Number, default: -1 },
   },
   },
   data() {
   data() {
     return {
     return {
       id: "",
       id: "",
       chart: null,
       chart: null,
       chartName: [
       chartName: [
-        { name: "实际功率", code: "sjgl", color: "#4B55AE" },
-        { name: "理论功率", code: "llgl", color: "#1C99FF" },
-        { name: "预测功率", code: "ycgl", color: "#F8DE5B" },
+        { name: "实际功率", name1: "实际功率", code: "sjgl", color: "#4B55AE" },
+        { name: "理论功率", name1: "理论功率", code: "llgl", color: "#1C99FF" },
+        { name: "预测功率", name1: "预测功率", code: "ycgl", color: "#F8DE5B" },
         { name: "实际风速", name1: "实际光照", code: "pjfs", color: "#05BB4C" },
         { name: "实际风速", name1: "实际光照", code: "pjfs", color: "#05BB4C" },
         { name: "预测风速", name1: "预测光照", code: "ycfs", color: "#FF8300" },
         { name: "预测风速", name1: "预测光照", code: "ycfs", color: "#FF8300" },
       ],
       ],
@@ -104,14 +104,6 @@ export default {
       }
       }
       return series;
       return series;
     },
     },
-    // lengend() {
-    //     let arr=[]
-    //   this.chartData.lengend.forEach((i) => {
-    //     if (this.chartName.some((item) => item.code == i)) {
-    //       i = item.name;
-    //     }
-    //   });
-    // },
   },
   },
   methods: {
   methods: {
     initChart() {
     initChart() {
@@ -127,7 +119,7 @@ export default {
         legend: {
         legend: {
           data: this.chartName.map((item) => {
           data: this.chartName.map((item) => {
             return {
             return {
-              name: item.name,
+              name: this.type == -1 ? item.name : item.name1,
               itemStyle: {
               itemStyle: {
                 color: item.color,
                 color: item.color,
               },
               },

+ 1 - 0
src/views/stateMonitor/powerPredictMatrix/index.vue

@@ -17,6 +17,7 @@
             ref="multipLineChart"
             ref="multipLineChart"
             height="100%"
             height="100%"
             width="100%"
             width="100%"
+            :type="activeTab"
             :chartData="list[index]"
             :chartData="list[index]"
           />
           />
         </div>
         </div>