Kaynağa Gözat

常规消缺

wangb 5 ay önce
ebeveyn
işleme
1320edf090

+ 26 - 26
src/App.vue

@@ -989,7 +989,7 @@ export default {
       dialogList: [],
       realList: [],
       audioElement: null,
-      routepath: ""
+      routepath: "",
     };
   },
   watch: {
@@ -998,18 +998,18 @@ export default {
     //     this.showHeader = route.path === "/login" ? false : true;
     //     this.isShowMenu =
     //       route.path === "/login" || route.path === "/home" ? false : true;
-    //         // 
+    //         //
     //   },
     //   immediate: true,
     // },
     $route(to, from) {
       // 当路由发生变化时,更新 currentPath
-      this.routepath = to.path
+      this.routepath = to.path;
       this.showHeader = to.path === "/login" ? false : true;
-        this.isShowMenu =
-          to.path === "/login" || to.path === "/home" ? false : true;
-      this.pagestyFn(to.path)
-    }
+      this.isShowMenu =
+        to.path === "/login" || to.path === "/home" ? false : true;
+      this.pagestyFn(to.path);
+    },
   },
 
   async created() {
@@ -1304,7 +1304,7 @@ export default {
         this.audioElement = new Audio();
         this.audioElement.src = "./static/sound/lv5.mp3";
         this.audioElement.loop = true;
-        this.audioElement?.play();
+        false && this.audioElement?.play();
       } else if (
         (lv1Play || lv2Play || lv3Play || lv4Play) &&
         !this.seriousWarning
@@ -1317,7 +1317,7 @@ export default {
             this.stopPlayAudioEffect
           );
         });
-        this.audioElement?.play();
+        false && this.audioElement?.play();
       } else {
         if (!this.seriousWarning) {
           this.stopPlayAudioEffect();
@@ -1456,25 +1456,25 @@ export default {
       return str;
     },
     pagestyFn(path) {
-        let str = "";
-        if (path) {
-            if (path.indexOf("home") > -1) {
-                str = "width:100%;height:100vh";
-            } else {
-                if (!this.isCollapse) {
-                  if (path.indexOf("generatingCap") > -1) {
-                    str = "width: calc(100% - 200px);height:100vh";
-                  } else if (path.indexOf("powerPrediction") > -1) {
-                    str = "width: calc(100% - 160px);height:100vh";
-                  } else if (path.indexOf("integratedAlarm") > -1) {
-                    str = "width: calc(100% - 300px);height:100vh";
-                  }
-                } else {
-                  str = "width: calc(100% - 66px);height:100vh";
-                }
+      let str = "";
+      if (path) {
+        if (path.indexOf("home") > -1) {
+          str = "width:100%;height:100vh";
+        } else {
+          if (!this.isCollapse) {
+            if (path.indexOf("generatingCap") > -1) {
+              str = "width: calc(100% - 200px);height:100vh";
+            } else if (path.indexOf("powerPrediction") > -1) {
+              str = "width: calc(100% - 160px);height:100vh";
+            } else if (path.indexOf("integratedAlarm") > -1) {
+              str = "width: calc(100% - 300px);height:100vh";
             }
+          } else {
+            str = "width: calc(100% - 66px);height:100vh";
+          }
         }
-        return str;
+      }
+      return str;
     },
     headerName(name) {
       this.showMenuData = [];

+ 28 - 17
src/views/generatingCapacity/dataAnalysis/agcAnalysis/components/current-scatter-chart.vue

@@ -122,6 +122,7 @@ export default {
           ele.progressive = 300; // 每次渲染的数据点数量
           ele.progressiveChunkMode = "sequential"; // 顺序分批渲染
           ele.silent = true;
+
           if (ele.name === "偏差上限") {
             ele.areaStyle = that.linearGradientColor[0];
             ele.silent = true;
@@ -208,22 +209,22 @@ export default {
             axisPointer: {
               type: "cross",
             },
-            formatter(data) {
-              let label = ``;
-              data.forEach((ele, index) => {
-                label += `<p>
-                              <span style="background:${
-                                that.color[index]
-                              };margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:50%;over-flow:hidden;"></span>
-                              <span>${
-                                ele.seriesName
-                              }:<span style="font-weight: 700;margin-left:10px">${
-                  ele.value || 0
-                }</span></span>
-                            </p>`;
-              });
-              return label;
-            },
+            // formatter(data) {
+            //   let label = ``;
+            //   data.forEach((ele, index) => {
+            //     label += `<p>
+            //                   <span style="background:${
+            //                     that.color[index]
+            //                   };margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:50%;over-flow:hidden;"></span>
+            //                   <span>${
+            //                     ele.seriesName
+            //                   }:<span style="font-weight: 700;margin-left:10px">${
+            //       ele.value || 0
+            //     }</span></span>
+            //                 </p>`;
+            //   });
+            //   return label;
+            // },
           },
           brush: {
             seriesIndex: [2, 3],
@@ -258,6 +259,13 @@ export default {
           textStyle: {
             fontSize: util.vh(16),
             color: theme ? "#fff" : "#000",
+            rich: {
+              a: {
+                fontSize: 15,
+                width: 110,
+                color: theme ? "#000" : "#fff",
+              },
+            },
           },
           //图例-每一条数据的名字
           legend: {
@@ -266,13 +274,16 @@ export default {
             right: 70,
             type: "scroll",
             top: "5",
-            // icon: "circle",
+            icon: "circle",
             itemWidth: 6,
             inactiveColor: theme ? "#000" : "#fff",
             textStyle: {
               color: theme ? "#000" : "#fff",
               fontSize: 12,
             },
+            // formatter(name) {
+            //   return [`{a| ${name}}`].join(" ");
+            // },
           },
           grid: {
             top: 58,

+ 66 - 15
src/views/generatingCapacity/dataAnalysis/angleAnalysis/index.vue

@@ -11,6 +11,8 @@
         <div class="treeDataMain">
           <tree-cop
             :data="treeData"
+            @checkChange="funTreeCheckChange"
+            :show-checkbox="false"
             :height="treeHeight"
             :currentNodeKey="currentNodeKey"
             @currentChange="funCurrentChange"
@@ -20,6 +22,7 @@
         </div>
         <div class="excelDataMain">
           <excel-cop
+            :checkIds="excelCheckIds"
             :data="excelList"
             :height="excelHeight"
             :theme="theme"
@@ -52,7 +55,12 @@
             </div>
             <div v-show="activeTab === '1'" :style="{ height: tableHeight }">
               <!-- :height="`calc( ${tableHeight})`" -->
-              <p :style="!theme ? 'color: #fff' : 'color: #000'" style="width: 100%;text-align: center">变桨角度偏差率:{{angleData ? angleData : 0}}%</p>
+              <p
+                :style="!theme ? 'color: #fff' : 'color: #000'"
+                style="width: 100%; text-align: center"
+              >
+                变桨角度偏差率:{{ angleData ? angleData : 0 }}%
+              </p>
               <CurrentScatterChart
                 ref="chartRef"
                 width="100%"
@@ -151,14 +159,16 @@ const speedParams = ref({});
 const currentNodeKey = ref("");
 
 import jsonData from "./components/data.json";
+const excelCheckIds = ref([]);
 const funExcelChange = async (obj) => {
+  excelCheckIds.value = [obj.id];
   chartRef.value.setMarkItem({});
   //点击excel项时
   funSubmit({
     ids: obj.id,
   });
-  tableShowId.value = obj.id
-  tableName.value = obj.name.substring(0, obj.name.indexOf('_'));
+  tableShowId.value = obj.id;
+  tableName.value = obj.name.substring(0, obj.name.indexOf("_"));
   getSpeedLine({
     ids: obj.id,
   });
@@ -176,27 +186,43 @@ const createMark = (markInfo) => {
 const treeData = ref([]);
 const actTreeNode = ref(null); //当前激活的treeNode
 const funRepeatMap = (arr, type) => {
+  // return arr.map((o) => {
+  //   if (o.children) {
+  //     const findIndex = o.children.findIndex((p) => !!p.type);
+  //     if (findIndex !== -1) {
+  //       o.childs = o.children;
+  //       o.children = [];
+  //       if (!actTreeNode.value && type === "prepare") {
+  //         //判断当且仅有process获取tree时 赋值
+  //         actTreeNode.value = o;
+  //       }
+  //     }
+  //   }
+  //   return {
+  //     ...o,
+  //     children: o.children.length ? funRepeatMap(o.children, type) : [],
+  //   };
+  // });
   return arr.map((o) => {
     if (o.children) {
       const findIndex = o.children.findIndex((p) => !!p.type);
       if (findIndex !== -1) {
         o.childs = o.children;
         o.children = [];
-        if (!actTreeNode.value && type === "prepare") {
-          //判断当且仅有process获取tree时 赋值
+        if (!actTreeNode.value) {
           actTreeNode.value = o;
         }
       }
     }
     return {
       ...o,
-      children: o.children.length ? funRepeatMap(o.children, type) : [],
+      children: o.children.length ? funRepeatMap(o.children) : [],
     };
   });
 };
 
 const funGetTree = async () => {
-//   const res = await httpRequest.get("/power/prepare/treepitch");
+  //   const res = await httpRequest.get("/power/prepare/treepitch");
   const res = await httpRequest.get("/power/process/tree");
   treeData.value = funRepeatMap(res.data, "process");
   excelList.value = [];
@@ -221,7 +247,33 @@ const funGetTree = async () => {
     };
     currentNodeKey.value = actTreeNode.value?.id || "";
     funExcelChange(obj);
+  } else {
+    initPageData();
+  }
+};
+const funTreeCheckChange = ({
+  current,
+  checkedNodes,
+  checkedKeys,
+  halfCheckedNodes,
+  halfCheckedKeys,
+}) => {
+  //tree change  -> excel change
+  funCurrentChange({
+    current,
+    currentNode: "",
+  });
+  const checkIds = [];
+  if (checkedNodes.length) {
+    for (const node of checkedNodes) {
+      if (node.childs && node.childs.length) {
+        for (const child of node.childs) {
+          checkIds.push(child.id);
+        }
+      }
+    }
   }
+  excelCheckIds.value = checkIds;
 };
 const funCurrentChange = ({ current, currentNode }) => {
   if (current.childs) {
@@ -291,22 +343,22 @@ const funSubmit = async (params) => {
     return false;
   }
 
-  angleData.value = res.data.angle
+  angleData.value = res.data.angle;
 
   let exTime = [];
   let yp1 = [],
     yp2 = [],
     yp3 = [],
     speed = [];
-  res.data.bw.forEach((it) => {
+  res.data?.bw?.forEach((it) => {
     exTime.push(it.time);
     yp1.push(it.yp1);
     yp2.push(it.yp2);
     yp3.push(it.yp3);
     speed.push(it.speed);
   });
-  tableData.value = res.data.bw;
-  seriesAllData.value = res.data.bw;
+  tableData.value = res.data?.bw || [];
+  seriesAllData.value = res.data?.bw || [];
   // res.data.bw.forEach(it => {
   //     yp2.push(it.yp2)
   // })
@@ -443,7 +495,7 @@ watch(
 );
 
 const abnormalPoint = ref([]);
-const initPageData = () => {
+const initPageData = async () => {
   treeData.value = funRepeatMap(
     JSON.parse(JSON.stringify(jsonData.treeData)),
     "prepare"
@@ -542,8 +594,8 @@ const initPageData = () => {
       },
     ];
 
-    tableShowId.value = obj.id
-    tableName.value = obj.name.substring(0, obj.name.indexOf('_'));
+    tableShowId.value = obj.id;
+    tableName.value = obj.name.substring(0, obj.name.indexOf("_"));
 
     let xAsis = [];
     let series = [];
@@ -586,7 +638,6 @@ const areNumbersDistinct = (arr) => {
 
 /**mounted */
 onMounted(() => {
-  initPageData();
   funGetTree();
   theme.value = store.state.theme;
   echartsTheme.value = !theme.value ? "dark" : "";

+ 50 - 3
src/views/powerPrediction/batteryDivinerPage.vue

@@ -619,7 +619,17 @@ export default {
               series.push(seriesObj);
             });
           }
-          let color = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
+          let color = [
+            "#5470c6",
+            "#91cc75",
+            "#fac858",
+            "#ee6666",
+            "#73c0de",
+            "#3ba272",
+            "#fc8452",
+            "#9a60b4",
+            "#ea7ccc",
+          ];
           this.getPowerLine(
             "powerChart",
             "日发电量预测曲线",
@@ -681,7 +691,17 @@ export default {
               series1.push(seriesObj1);
             });
           }
-          let color = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
+          let color = [
+            "#5470c6",
+            "#91cc75",
+            "#fac858",
+            "#ee6666",
+            "#73c0de",
+            "#3ba272",
+            "#fc8452",
+            "#9a60b4",
+            "#ea7ccc",
+          ];
           this.getPowerLine(
             "monthChart",
             "本月单日发电量预测",
@@ -738,7 +758,16 @@ export default {
               series1.push(seriesObj1);
             });
           }
-          let color = ['#5470c6', '#91cc75', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
+          let color = [
+            "#5470c6",
+            "#91cc75",
+            "#ee6666",
+            "#73c0de",
+            "#3ba272",
+            "#fc8452",
+            "#9a60b4",
+            "#ea7ccc",
+          ];
           this.getPowerLine(
             "windChart1",
             "今年月度发电量预测",
@@ -784,6 +813,24 @@ export default {
         }
       });
 
+      powerLineData.forEach((pEle) => {
+        for (let i = 0; i < pEle.length; i++) {
+          if (pEle[i] === "-") {
+            pEle.splice(i, 1);
+            i--;
+          }
+        }
+      });
+
+      fsLineData.forEach((pEle) => {
+        for (let i = 0; i < pEle.length; i++) {
+          if (pEle[i] === "-") {
+            pEle.splice(i, 1);
+            i--;
+          }
+        }
+      });
+
       const allPowerData = [].concat(...powerLineData);
       const powerMin = Math.min(...allPowerData);
       const powerMax = Math.max(...allPowerData);