Преглед на файлове

fix: 设备档位bug调整处理

chenzhen2 преди 2 години
родител
ревизия
1fee2cc3e6
променени са 2 файла, в които са добавени 25 реда и са изтрити 20 реда
  1. 6 6
      src/views/choiceSpace/choiceSpace.vue
  2. 19 14
      src/views/envmonitor/components/Air/manualIndex.vue

+ 6 - 6
src/views/choiceSpace/choiceSpace.vue

@@ -137,7 +137,9 @@ export default defineComponent({
       { text: "销量排序", value: "c" },
     ];
     let positionArr: any = [];
-    let checkPositon: any = {};
+    let checkPositon: any = {
+      buildingName:''
+    };
     const defaultSpaceData: any = {};
     const buildingData: any = [];
     const buildingItem: any = {};
@@ -232,7 +234,6 @@ export default defineComponent({
             proxyData.activeIndex = index;
           }
         });
-        console.log(proxyData.checkPositon);
       },
       // 格式化建筑数据
       formateBuildingData() {
@@ -310,8 +311,7 @@ export default defineComponent({
         getDefaultLocation(paramsStr).then((res) => {
           let resData: any = res;
           proxyData.defaultSpaceData = resData?.data ?? {};
-          proxyData.checkPositon.buildingId =
-            proxyData.defaultSpaceData.buildingId;
+          proxyData.checkPositon.buildingId =proxyData.defaultSpaceData.buildingId;
           proxyData.setCheckPersiton();
           proxyData.getBuildingList();
         });
@@ -401,8 +401,8 @@ export default defineComponent({
               proxyData.insertWorkSpace(data[0], 1);
               proxyGlobal.proxy.$loadinngEnd();
               router.push({
-               name: "envmonitor",
-               query: { spaceId: data[0].spaceId },
+                name: "envmonitor",
+                query: { spaceId: data[0].spaceId },
               });
             } else {
               Toast("请选择办公空间!");

+ 19 - 14
src/views/envmonitor/components/Air/manualIndex.vue

@@ -70,7 +70,9 @@
           <div class="volume-icon">
             <div
               class="icon-item"
-              :style="{ opacity: airData.gear <= 1 ? '0.6' : 1 }"
+              :style="{
+                opacity: airData.gear <= 1 ? '0.6' : 1,
+              }"
               @click="changeZongAir('gear', 'windLow')"
             >
               <img :src="parseImgUrl('ipdImages', 'wind_small.png')" />
@@ -380,6 +382,7 @@ export default defineComponent({
         } else {
           proxyData.lightIcon = "arrow-up";
         }
+        proxyData.barSwiperInit();
       },
       // 设置温度条的位置
       setBarNowPerstion() {
@@ -505,7 +508,7 @@ export default defineComponent({
           }
         }
         if (btnType == "gear" && text == "auto") {
-          proxyData.airData.isAutoGear == 1 ? 0 : 1;
+          proxyData.airData.isAutoGear = 1;
           obj.value = proxyData.airData.isAutoGear ? 4 : proxyData.airData.gear;
           obj.codeKey = "gearCode";
         }
@@ -707,6 +710,19 @@ export default defineComponent({
           item.isOpen = item.runStatus === 1 ? true : false;
         });
       },
+      // 初始化滚动
+      barSwiperInit() {
+        if (proxyData.airData.isOpen && !proxyData.showChild) {
+          if (!proxyData.swiperIinit) {
+            nextTick(() => {
+              proxyData.endBoxSwiper();
+              proxyData.setBarNowPerstion();
+            });
+          } else {
+            proxyData.setBarNowPerstion();
+          }
+        }
+      },
       // 空调信息airTemp
       getAirInfo() {
         const paramObj = {
@@ -746,18 +762,7 @@ export default defineComponent({
                 "air_close.png"
               );
             }
-
-            if (proxyData.airData.isOpen) {
-              if (!proxyData.swiperIinit) {
-                nextTick(() => {
-                  proxyData.endBoxSwiper();
-                  proxyData.setBarNowPerstion();
-                });
-              } else {
-                proxyData.setBarNowPerstion();
-              }
-            }
-
+            proxyData.barSwiperInit();
             proxyData.getAirInfoToTimer(3000);
           })
           .catch(() => {});