Przeglądaj źródła

注氮控制更新

lxh 1 rok temu
rodzic
commit
a54bc60d5e

+ 15 - 15
src/views/vent/monitorManager/compressor/components/nitrogenHome1.vue

@@ -135,8 +135,8 @@
                       :disabled="airCompressorState[groupNum - 1][`controlModel`]"
                       @change="handlerDevice(airCompressorState[groupNum - 1], index)"
                     /> -->
-                    <a-button v-if="index==0" size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1], index,true)">一键启停</a-button>
-                    <a-button v-else size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1], index, true)">一键复位</a-button>
+                    <a-button v-if="index==0" size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1],false)">一键启停</a-button>
+                    <a-button v-else size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1], false)">一键启停</a-button>
                  
                   </div>
                 </div>
@@ -151,8 +151,8 @@
                       :disabled="airCompressorState[groupNum - 1][`controlModel`]"
                       @change="handlerDevice(airCompressorState[groupNum - 1], index)"
                     /> -->
-                    <a-button v-if="index==0" size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1], index,false)">一键启停</a-button>
-                    <a-button v-else size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1], index,false)">一键复位</a-button>
+                    <a-button v-if="index==0" size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1],true)">一键复位</a-button>
+                    <a-button v-else size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1],true)">一键复位</a-button>
                   </div>
                 </div>
               </div>
@@ -207,7 +207,7 @@
   const loading = ref(true);
   let kzParam = reactive<any>({
     data: {},
-    activeIndex: 0,
+    isFw:null,
   });
   // const kyjs = ['1号空压机', '1号空压机', '1号空压机', '1号空压机'];
 
@@ -310,7 +310,8 @@
             airCompressorState.push({
               id: v.deviceID,
               deviceType:v.deviceType,
-              compressRunSigF1: false,
+              HMIReset:v.readData.HMIReset,
+              HMIStartStop:v.readData.HMIStartStop
             });
           });
         }
@@ -320,22 +321,21 @@
     }
   }
 
-  function handlerDevice(data, index,bol) {
-    console.log(index,'index-------')
+  function handlerDevice(data,bol) {
     console.log(bol,'bol-------')
     kzParam.data = data;
-    kzParam.activeIndex = index;
+    kzParam.isFw = bol;
     console.log(kzParam,'kz--------')
-    if (index == 1) {
+    if ( bol) {
       modalTitle.value = '一键复位';
       modalType.value = '1';
       modalIsShow.value = true;
-      kzParam.data.compressRunSigF1 = bol ? true : false
+      kzParam.data.HMIReset=!data.HMIReset
     } else {
       modalTitle.value = '一键启停';
       modalType.value = '2';
       modalIsShow.value = true;
-      kzParam.data.compressRunSigF1 = bol ? true : false;
+      kzParam.data.HMIStartStop =!data.HMIStartStop;
     }
   }
   function handleOK(passWord, handlerState) {
@@ -346,19 +346,19 @@
     // }
 
     let data = {};
-    if (kzParam.activeIndex == 1) {
+    if (kzParam.isFw ) {
       data = {
         deviceid: kzParam.data.id,
         devicetype:kzParam.data.deviceType,
         password: passWord,
-        HMIReset: kzParam.data.compressRunSigF1,
+        HMIReset: kzParam.data.HMIReset,
       };
     } else {
       data = {
         deviceid: kzParam.data.id,
         password: passWord,
         devicetype:kzParam.data.deviceType,
-        HMIStartStop: kzParam.data.compressRunSigF1,
+        HMIStartStop: kzParam.data.HMIStartStop,
       };
     }