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 2 tháng trước cách đây
mục cha
commit
43bbc0f82d
1 tập tin đã thay đổi với 71 bổ sung67 xóa
  1. 71 67
      src/views/Home/components/map.vue

+ 71 - 67
src/views/Home/components/map.vue

@@ -896,10 +896,7 @@
             </div>
           </div>
           <div class="hover72Power">
-            <div
-              id="hover72Powers"
-              style="width: 100%; height: 100%"
-            ></div>
+            <div id="hover72Powers" style="width: 100%; height: 100%"></div>
           </div>
         </template>
       </div>
@@ -1823,71 +1820,73 @@ export default {
   methods: {
     initPageData(res) {
       let that = this;
-      const theme = sessionStorage.getItem("theme") === "true" ? true : false;
-      if (res && res.data) {
-        // 72小时功率曲线
-        if (res.data["72time"] && res.data["72time"].length > 0) {
-          let xAxis = [];
-          let seriesSpeed = [];
-          let seriesGl = [];
-          let seriesSJ = [];
-          let seriesYc = [];
-          res.data["72time"].forEach((it) => {
-            xAxis.push(dayjs(it.time).format("MM-DD HH:mm"));
-            seriesSpeed.push(it.speed);
-            seriesGl.push(it.expectedpower);
-            seriesSJ.push(it.power);
-            seriesYc.push(it.predictedpower);
-          });
-          let series = [
-            {
-              name: "平均风速",
-              data: seriesSpeed,
-              yAxisIndex: 1,
-              type: "line",
-              symbol: "none",
-            },
-            {
-              name: "理论功率",
-              data: seriesGl,
-              type: "line",
-              symbol: "none",
-              yAxisIndex: 0,
-            },
-            {
-              name: "实际功率",
-              data: seriesSJ,
-              type: "line",
-              symbol: "none",
-              yAxisIndex: 0,
-            },
-            {
-              name: "预测功率",
-              data: seriesYc,
-              type: "line",
-              symbol: "none",
-              yAxisIndex: 0,
-            },
-          ];
+      that.$nextTick(() => {
+        const theme = sessionStorage.getItem("theme") === "true" ? true : false;
+        if (res && res.data) {
+          // 72小时功率曲线
+          if (res.data["72time"] && res.data["72time"].length > 0) {
+            let xAxis = [];
+            let seriesSpeed = [];
+            let seriesGl = [];
+            let seriesSJ = [];
+            let seriesYc = [];
+            res.data["72time"].forEach((it) => {
+              xAxis.push(dayjs(it.time).format("MM-DD HH:mm"));
+              seriesSpeed.push(it.speed);
+              seriesGl.push(it.expectedpower);
+              seriesSJ.push(it.power);
+              seriesYc.push(it.predictedpower);
+            });
+            let series = [
+              {
+                name: "平均风速",
+                data: seriesSpeed,
+                yAxisIndex: 1,
+                type: "line",
+                symbol: "none",
+              },
+              {
+                name: "理论功率",
+                data: seriesGl,
+                type: "line",
+                symbol: "none",
+                yAxisIndex: 0,
+              },
+              {
+                name: "实际功率",
+                data: seriesSJ,
+                type: "line",
+                symbol: "none",
+                yAxisIndex: 0,
+              },
+              {
+                name: "预测功率",
+                data: seriesYc,
+                type: "line",
+                symbol: "none",
+                yAxisIndex: 0,
+              },
+            ];
 
-          const allPowerData = seriesGl.concat(seriesSJ, seriesYc);
-          const powerMin = Math.min(...allPowerData);
-          const powerMax = Math.max(...allPowerData);
-          const windSpeedMin = Math.min(...seriesSpeed);
-          const windSpeedMax = Math.max(...seriesSpeed);
-          const splitNumber = 4;
-
-          that.getPowerLine(
-            xAxis,
-            series,
-            powerMin,
-            powerMax,
-            windSpeedMin,
-            windSpeedMax,
-            splitNumber
-          );
+            const allPowerData = seriesGl.concat(seriesSJ, seriesYc);
+            const powerMin = Math.min(...allPowerData);
+            const powerMax = Math.max(...allPowerData);
+            const windSpeedMin = Math.min(...seriesSpeed);
+            const windSpeedMax = Math.max(...seriesSpeed);
+            const splitNumber = 4;
+
+            that.getPowerLine(
+              xAxis,
+              series,
+              powerMin,
+              powerMax,
+              windSpeedMin,
+              windSpeedMax,
+              splitNumber
+            );
+          }
         }
-      }
+      });
     },
 
     getPowerLine(
@@ -2575,6 +2574,11 @@ export default {
       this.tabShow = this.activeTab;
       this.mapClickBack(wpIds, this.activeTab);
       this.currentActiveTab(this.penetrateType);
+      this.initPageData({
+        data: {
+          "72time": dataJson["72time"],
+        },
+      });
     },
     clickLabel(wpId, planBtnName, penetrateType) {
       this.penetrateType = penetrateType;