Prechádzať zdrojové kódy

feat:设备状态不一致的问题

chenzhen2 10 mesiacov pred
rodič
commit
6322b2a0b4

+ 1 - 9
src/views/envmonitor/components/Light/index.vue

@@ -229,14 +229,7 @@ export default defineComponent({
           .then((res) => {
             const resData: any = res;
             let lampFlag:any=false;
-            if(proxyData.lampList &&  proxyData.lampList.length){
-              lampFlag=false;
-            }else {
-              lampFlag=true
-            }
-            if (!proxyData.setStatus || lampFlag || isAddTimer) {
-              // console.log("灯的状态修改--");
-              if (resData && resData.result == "success") {
+            if (resData && resData.result == "success") {
                 let content = resData?.content ?? [];
                 let lampOpen = false; // 如果有一个开 则总灯开
                 for (let i = 0; i < content.length; i++) {
@@ -285,7 +278,6 @@ export default defineComponent({
                   }
                 }
               }
-            }
             // console.log("执行了----====");
             if(isAddTimer==0){
               proxyData.startLightsStatusTimer();