Sfoglia il codice sorgente

2023-03-21 update

1. update controlType 和 lockType
moccus 1 anno fa
parent
commit
09a7ec6664

+ 40 - 0
src/components/control/areaCard.vue

@@ -75,6 +75,15 @@
               >
               </MatrixBlock>
             </div>
+            <div class="matrix" v-if="resetList.length > 0">
+              <div class="problemTitle titleSty">复位</div>
+              <MatrixBlock
+                @on-click="handleDetial"
+                @choose-click="handleClick"
+                :dataList="resetList"
+              >
+              </MatrixBlock>
+            </div>
           </div>
         </div>
       </div>
@@ -145,6 +154,7 @@ export default {
       stopList: [],
       maintainList: [],
       unMaintainList: [],
+      resetList: [],
       chooseList: [],
       sendList: [],
       currentWindturbine: {},
@@ -231,6 +241,9 @@ export default {
                   case "UnMaintain":
                     this.windturbinelist[item.windturbineId].controlType = 8;
                     break;
+                  case "Reset":
+                    this.windturbinelist[item.windturbineId].controlType = 5;
+                    break;
                 }
                 dateList.push(this.windturbinelist[item.windturbineId]);
               }
@@ -370,6 +383,10 @@ export default {
             item.controlType = "8";
             windControlList.push(item);
           });
+          this.resetList.forEach((item) => {
+            item.controlType = "5";
+            windControlList.push(item);
+          })
           this.sendCommand(mss, windControlList);
         }
       }
@@ -406,6 +423,11 @@ export default {
           item.active = !item.active;
         }
       });
+      this.resetList.forEach((item) => {
+        if (item.windturbineId === values.windturbineId) {
+          item.active = !item.active;
+        }
+      });
     },
     handleDetial(itm) {
       this.dialogVisible = true;
@@ -426,6 +448,8 @@ export default {
             item.controlType = 6;
           } else if (item.operateStyle === "UnMaintain") {
             item.controlType = 8;
+          } else if (item.operateStyle === "Reset") {
+            item.controlType = 5;
           }
         });
         let mss = {};
@@ -687,6 +711,7 @@ export default {
         let startList = [];
         let maintainList = [];
         let unMaintainList = [];
+        let resetList = []
         for (let id of arr) {
           let val = json[id];
           this.chooseList.forEach((item) => {
@@ -711,6 +736,8 @@ export default {
                 val.status === 6
               ) {
                 unMaintainList.push(val);
+              }else if(item.operateStyle === "Reset" && val.status === 5){
+                resetList.push(val)
               }
             }
           });
@@ -725,6 +752,8 @@ export default {
           let stopFlag = false;
           let maintainFlag = false;
           let unMaintainFlag = false;
+          let resetIndex = null
+          let resetFlag = false
           startList.forEach((param, index) => {
             if (item.windturbineId === param.windturbineId) {
               starIndex = index;
@@ -749,15 +778,23 @@ export default {
               unMaintainFlag = true;
             }
           });
+          resetList.forEach((param, index) => {
+            if (item.windturbineId === param.windturbineId) {
+              resetIndex = index;
+              resetFlag = true;
+            }
+          });
           starFlag ? startList.splice(starIndex, 1) : "";
           stopFlag ? stopList.splice(stopIndex, 1) : "";
           maintainFlag ? maintainList.splice(maintainIndex, 1) : "";
           unMaintainFlag ? unMaintainList.splice(unMaintainIndex, 1) : "";
+          resetFlag ? resetList.splice(resetIndex, 1) : "";
         });
         this.stopList = stopList;
         this.startList = startList;
         this.maintainList = maintainList;
         this.unMaintainList = unMaintainList;
+        this.resetList = resetList
       });
     },
   },
@@ -799,6 +836,9 @@ export default {
                 case "UnMaintain":
                   this.windturbinelist[item.windturbineId].controlType = 8;
                   break;
+                case "Reset":
+                  this.windturbinelist[item.windturbineId].controlType = 5;
+                  break;
               }
               dateList.push(this.windturbinelist[item.windturbineId]);
             }

+ 4 - 4
src/components/control/controlAllArea.vue

@@ -593,8 +593,8 @@ export default {
             stationId: item.stationId,
             projectId: item.projectId,
             modelId: item.modelId,
-            controlType: item.controlType,
-            lockType: item.lockType,
+            controlType: item.controlType + '',
+            lockType: item.lockType + '',
             userName: `system_${bd.LoginUser.name}`,
             userId: 0,
             auto: false,
@@ -641,8 +641,8 @@ export default {
             stationId: item.stationId,
             projectId: item.projectId,
             modelId: item.modelId,
-            controlType: item.controlType,
-            lockType: item.lockType,
+            controlType: item.controlType + '',
+            lockType: item.lockType + '',
             userName: `system_${bd.LoginUser.name}`,
             userId: 0,
           };