Преглед изворни кода

fix:空调模块新增需要调整

chenzhen2 пре 1 година
родитељ
комит
6fab3584cb

+ 32 - 25
src/views/envmonitor/components/Air/manualIndex.vue

@@ -189,7 +189,7 @@
         <div
           class="adjust-box"
           :style="{
-            opacity: childItem.runStatus && childItem.isOpen ? '' : '0.3',
+            opacity: childItem.isOpen ? '' : '0.3',
           }"
         >
           <div class="adjust-item">
@@ -442,16 +442,24 @@ export default defineComponent({
           proxyData.lightIcon = "arrow-up";
         }
 
+        // if (proxyData.showChild) {
+        //   await nextTick(() => {
+        //     proxyData.setChildSelectList();
+        //   });
+        // } else {
+        //   await nextTick(() => {
+        //     proxyData.barSwiperInit();
+        //   });
+        // }
         if (proxyData.showChild) {
-          await nextTick(() => {
-            proxyData.setChildSelectList();
-          });
+          proxyData.updateChildSatus();
         } else {
-          await nextTick(() => {
-            proxyData.barSwiperInit();
-          });
+          proxyData.updateParentSatus();
         }
 
+        // isAddTimer==0(需要定时再调) isAddTimer==1(不需要定时调)
+        proxyData.getAirInfo(1);
+
         // proxyData.getAirInfoToTimer(0);
       },
       // 设置温度条的位置
@@ -571,7 +579,8 @@ export default defineComponent({
         }
         let timerLen: any = 15;
         if (equipmentCategory && equipmentCategory == "ACATVI") {
-          timerLen = 120;
+          // timerLen = 120;
+          timerLen = 15;
         }
         return timerLen;
       },
@@ -856,6 +865,16 @@ export default defineComponent({
           item.isOpen = proxyData.airData.isOpen;
         });
       },
+      // 更新总开关的开关状态
+      updateParentSatus() {
+        let flag: any = false;
+        proxyData.equipList.map((item: any) => {
+          if (item.isOpen) {
+            flag = true;
+          }
+        });
+        proxyData.airData.isOpen = flag;
+      },
       // 总控制改变空调状态
       airChange() {
         // 先不更新状态等确认框弹出后再更新状
@@ -874,7 +893,7 @@ export default defineComponent({
         proxyData.loadingAir = true;
         // 操作空调后,先关闭定时刷新接口,等固定时间再更新空调状态
         proxyData.updateAirStatus();
-        proxyData.updateChildSatus();
+
         if (proxyData.airData.isOpen) {
           nextTick(() => {
             proxyData.barSwiperInit();
@@ -977,7 +996,7 @@ export default defineComponent({
         });
       },
       // 空调信息airTemp的修改
-      getAirInfo() {
+      getAirInfo(isAddTimer: any = 0) {
         const paramObj = {
           spaceId: proxyData.spaceId,
           // spaceId: props.spaceId,//'Sp110108025564f438d7fef64eea8202a6462f1bbcce' 空间id
@@ -1001,24 +1020,12 @@ export default defineComponent({
             // 设置子设备的状态
             proxyData.setChildSelectList();
             proxyData.formateSetChildStatus();
-
-            // // 设置当前空调等图片
-            // if (proxyData.airData.isOpen) {
-            //   proxyData.airData.airImg = parseImgUrl(
-            //     "page-officehome",
-            //     "openair.png"
-            //   );
-            // } else {
-            //   proxyData.airData.airImg = parseImgUrl(
-            //     "page-officehome",
-            //     "air_close.png"
-            //   );
-            // }
-
             nextTick(() => {
               proxyData.barSwiperInit();
             });
-            proxyData.getAirInfoToTimer();
+            if (proxyData.isAddTimer == 0) {
+              proxyData.getAirInfoToTimer();
+            }
           })
           .catch(() => {});
       },

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

@@ -87,7 +87,8 @@
       @click.stop="showAll"
     >
       <van-icon :name="lightIcon" class="light-icon" />
-      <span>展开更多</span>
+      <span v-if="lightIcon == 'arrow-down'">展开更多</span>
+      <span v-else>收起全部</span>
     </div>
   </div>
 </template>