Browse Source

常规上传

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 1 month ago
parent
commit
16c9f30f08
2 changed files with 89 additions and 59 deletions
  1. 1 1
      src/components/allMatricesNoDia.vue
  2. 88 58
      src/components/control/parametersContrast.vue

+ 1 - 1
src/components/allMatricesNoDia.vue

@@ -740,7 +740,7 @@ export default {
     },
     parametersContrast() {
       if (this.chooseList.length > 0) {
-        this.parametersDisplay = true;
+        // this.parametersDisplay = true;
       }
     },
     getPvMsg(msg) {

+ 88 - 58
src/components/control/parametersContrast.vue

@@ -93,6 +93,7 @@
 </template>
 <script>
 import api from "api/index";
+import dataJson from "../temperatureMatrixNoDiaJson.json";
 export default {
   props: {
     chooseList: {
@@ -131,6 +132,36 @@ export default {
       });
       let list = Array.from(new Set(arr));
       let params = list.join(",");
+
+      let labelList = [
+        {
+          name: "全部",
+        },
+      ];
+      this.chooseList.forEach((ele) => {
+        labelList.push({ name: ele.code });
+      });
+
+      this.labelList = labelList;
+      this.dataList = dataJson.column;
+
+      let titleList = [];
+      let dataList = [[]];
+
+      new Array(10).forEach((cEle) => {
+        dataList[0].push({ name: `#01`, value: 66, maxValue: 55 });
+      });
+      dataJson.column.forEach((pEle) => {
+        pEle.children.forEach((cEle) => {
+          titleList.push({ name: cEle.name });
+        });
+      });
+
+      this.titleList = titleList;
+      this.dataList = dataList;
+      console.log(1122, dataJson.column);
+
+      return;
       api.stationCompared(params).then((res) => {
         if (res) {
           this.arrList = res.data[list[0]];
@@ -146,64 +177,63 @@ export default {
       });
     },
     getLatest(index) {
-      let list = [];
-
-      let arr = this.arrList.map((item) => {
-        return {
-          ...item,
-        };
-      });
-      this.titleList.forEach((item, index) => {
-        if (index !== 0) {
-          arr.filter((val) => val.name === item.name)[0].type = true;
-        }
-      });
-      arr.map((item) => {
-        if (this.labelList.filter((val) => val.name === item.name)[0]?.type) {
-          list.push(item.code);
-        }
-      });
-      arr.unshift({
-        name: "风机",
-        value: this.chooseList[index].windturbineId,
-      });
-      let params = list.join(",");
-      api
-        .nitWinturbineBaseData({
-          thingType: "windturbine",
-          thingId: this.chooseList[index].windturbineId,
-          uniformCodes: params,
-        })
-        .then((res) => {
-          if (res) {
-            arr.forEach((item) => {
-              if (item.type) {
-                item.value = res.data[item.code]?.value;
-              }
-            });
-            this.dataList.push(arr);
-            if (index < this.chooseList.length - 1) {
-              index++;
-              this.getLatest(index);
-            } else {
-              this.titleList.forEach((item, index) => {
-                if (index > 0) {
-                  let datas = [];
-                  this.dataList.map((items) => {
-                    datas.push(
-                      items.filter((val) => item.name === val.name)[0]?.value
-                    );
-                  });
-                  item.maxValue = Math.max.apply(
-                    null,
-                    datas.map((v) => v)
-                  );
-                  item.showFlag = false;
-                }
-              });
-            }
-          }
-        });
+      // let list = [];
+      // let arr = this.arrList.map((item) => {
+      //   return {
+      //     ...item,
+      //   };
+      // });
+      // this.titleList.forEach((item, index) => {
+      //   if (index !== 0) {
+      //     arr.filter((val) => val.name === item.name)[0].type = true;
+      //   }
+      // });
+      // arr.map((item) => {
+      //   if (this.labelList.filter((val) => val.name === item.name)[0]?.type) {
+      //     list.push(item.code);
+      //   }
+      // });
+      // arr.unshift({
+      //   name: "风机",
+      //   value: this.chooseList[index].windturbineId,
+      // });
+      // let params = list.join(",");
+      // api
+      //   .nitWinturbineBaseData({
+      //     thingType: "windturbine",
+      //     thingId: this.chooseList[index].windturbineId,
+      //     uniformCodes: params,
+      //   })
+      //   .then((res) => {
+      //     if (res) {
+      //       arr.forEach((item) => {
+      //         if (item.type) {
+      //           item.value = res.data[item.code]?.value;
+      //         }
+      //       });
+      //       this.dataList.push(arr);
+      //       if (index < this.chooseList.length - 1) {
+      //         index++;
+      //         this.getLatest(index);
+      //       } else {
+      //         this.titleList.forEach((item, index) => {
+      //           if (index > 0) {
+      //             let datas = [];
+      //             this.dataList.map((items) => {
+      //               datas.push(
+      //                 items.filter((val) => item.name === val.name)[0]?.value
+      //               );
+      //             });
+      //             item.maxValue = Math.max.apply(
+      //               null,
+      //               datas.map((v) => v)
+      //             );
+      //             item.showFlag = false;
+      //           }
+      //         });
+      //       }
+      //     }
+      //   });
     },
     closed() {
       this.labelList = [];