浏览代码

常规消缺

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 1 月之前
父节点
当前提交
9db6590c71
共有 2 个文件被更改,包括 68 次插入65 次删除
  1. 1 1
      src/components/allMatricesNoDia.vue
  2. 67 64
      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) {

+ 67 - 64
src/components/control/parametersContrast.vue

@@ -74,12 +74,13 @@
                   ></div>
                   <div style="position: absolute">
                     {{
-                      index === 0
+                      9999 ||
+                      (index === 0
                         ? scope?.row.filter((val) => val.name === item.name)[0]
                             ?.value
                         : scope?.row
                             .filter((val) => val.name === item.name)[0]
-                            ?.value?.toFixed(2)
+                            ?.value?.toFixed(2))
                     }}
                   </div>
                 </div>
@@ -146,11 +147,14 @@ export default {
       this.dataList = dataJson.column;
 
       let titleList = [];
-      let dataList = [[]];
+      let dataList = [];
+
+      for (let i = 0; i < 10; i++) {
+        dataList.push([
+          { name: `A01`, value: 66, maxValue: 55, showFlag: false },
+        ]);
+      }
 
-      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 });
@@ -159,7 +163,6 @@ export default {
 
       this.titleList = titleList;
       this.dataList = dataList;
-      console.log(1122, dataJson.column);
 
       return;
       api.stationCompared(params).then((res) => {
@@ -177,63 +180,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 = [];