Browse Source

fix:手动控制调整

chenzhen2 4 tháng trước cách đây
mục cha
commit
53daef361a

+ 28 - 0
project.config.json

@@ -0,0 +1,28 @@
+{
+  "appid": "wxa2f22e7832ade915",
+  "compileType": "miniprogram",
+  "libVersion": "3.4.5",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "setting": {
+    "coverView": true,
+    "es6": true,
+    "postcss": true,
+    "minified": true,
+    "enhance": true,
+    "showShadowRootInWxmlPanel": true,
+    "packNpmRelationList": [],
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    }
+  },
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  }
+}

+ 7 - 0
project.private.config.json

@@ -0,0 +1,7 @@
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "projectname": "sagacloud-sagacare-ipad",
+  "setting": {
+    "compileHotReLoad": true
+  }
+}

+ 30 - 30
src/views/envmonitor/components/Air/manualIndex.vue

@@ -238,7 +238,7 @@ import {
   onUnmounted,
   onBeforeMount,
   onBeforeUnmount,
-  nextTick
+  nextTick,
 } from "vue";
 import { Switch, Dialog, Toast } from "vant";
 import { swiper } from "@/utils/swiper";
@@ -253,7 +253,7 @@ export default defineComponent({
     temperature: {
       // 空调基本信息
       type: Number,
-      default: () => 0
+      default: () => 0,
     },
     // hasAir: {
     //   // 有无空调
@@ -263,33 +263,33 @@ export default defineComponent({
     airVolumes: {
       // 风量信息
       type: Array,
-      default: () => []
+      default: () => [],
     },
     projectId: {
       type: String,
-      default: () => ""
+      default: () => "",
     },
     spaceId: {
       type: String,
-      default: () => ""
+      default: () => "",
     },
     userIsControl: {
       type: Boolean,
-      default: () => false
+      default: () => false,
     },
     forceOverTimeFlag: {
       type: Boolean,
-      default: () => false
+      default: () => false,
     },
     seviceEquipmentList: {
       // 是否走服务定制的设备
       type: Array,
-      default: () => []
-    }
+      default: () => [],
+    },
   },
   components: {
     Switch,
-    [Dialog.Component.name]: Dialog.Component
+    [Dialog.Component.name]: Dialog.Component,
   },
   setup(props, contx) {
     const propsVal = props;
@@ -307,7 +307,7 @@ export default defineComponent({
       gear: 0, //  风量
       boundPoint: {}, // 开关 档位 温度 模式点位
       isOpen: false, // 空调开关 true 是开
-      runStatus: 0 // 查询设备的真实状态
+      runStatus: 0, // 查询设备的真实状态
     };
     const feedbackTimer: any = null;
     const airTimer: any = null;
@@ -355,7 +355,7 @@ export default defineComponent({
         remark: [],
         nowImg: "",
         toWhere: "",
-        designTemperature: 0
+        designTemperature: 0,
       },
       checkNav(type: any = "all") {
         proxyData.navType = type;
@@ -470,9 +470,10 @@ export default defineComponent({
           return;
         }
         handBox.addEventListener("touchstart", function(e: any) {
-          barLeft = isNaN(parseInt(barBox.style.left))
+          let oldBarLeft=barBox && barBox.style && barBox.style.left || 0
+          barLeft = isNaN(parseInt(oldBarLeft))
             ? 0
-            : parseInt(barBox.style.left);
+            : parseInt(oldBarLeft);
           isMove = true;
         });
         handBox.addEventListener("touchend", function(e: any) {
@@ -510,7 +511,7 @@ export default defineComponent({
               // console.log(proxyData.realTemp);
               barBox.style.left = left + proxyData.sliderPading + "px";
             }
-          }
+          },
         });
       },
       // 定时获取空调状态
@@ -648,7 +649,7 @@ export default defineComponent({
       changeChildItemAir(btnType: any, childItem: any, symbol: any) {
         const domAirOpen = !childItem.isOpen;
         let isExeSpaceTime: Boolean = proxyData.checkDeviceIsExeSpaceTime([
-          childItem
+          childItem,
         ]);
         if (
           proxyData.forceOverTimeFlag &&
@@ -673,7 +674,7 @@ export default defineComponent({
           let obj: any = {
             id: childItem.id, //类型:String  必有字段  备注:设备id
             code: childItem.switchCode, //类型:String  必有字段  备注:编码 EquipSwtichSet
-            value: childItem.isOpen ? "1" : "0" //类型:String  必有字段  备注:值 0
+            value: childItem.isOpen ? "1" : "0", //类型:String  必有字段  备注:值 0
           };
           arr.push(obj);
         } else if (btnType === "temp") {
@@ -692,7 +693,7 @@ export default defineComponent({
           let obj: any = {
             id: childItem.id, //类型:String  必有字段  备注:设备id
             code: childItem.tempSetCode, //类型:String  必有字段  备注:编码 EquipSwtichSet
-            value: childItem.tempSet //类型:String  必有字段  备注:值 0
+            value: childItem.tempSet, //类型:String  必有字段  备注:值 0
           };
           arr.push(obj);
           proxyData.childDisabled(childItem, arr);
@@ -721,7 +722,7 @@ export default defineComponent({
           let obj: any = {
             id: childItem.id, //类型:String  必有字段  备注:设备id
             code: childItem.gearCode, //类型:String  必有字段  备注:编码 EquipSwtichSet
-            value: childItem.isAutoGear ? 4 : childItem.gear //类型:String  必有字段  备注:值 0
+            value: childItem.isAutoGear ? 4 : childItem.gear, //类型:String  必有字段  备注:值 0
           };
           arr.push(obj);
         } else if (btnType === "model") {
@@ -739,7 +740,7 @@ export default defineComponent({
           let obj: any = {
             id: childItem.id, //类型:String  必有字段  备注:设备id
             code: childItem.modeSetCode, //类型:String  必有字段  备注:编码 EquipSwtichSet
-            value: childItem.workMode //类型:String  必有字段  备注:值 0
+            value: childItem.workMode, //类型:String  必有字段  备注:值 0
           };
           arr.push(obj);
         }
@@ -753,7 +754,7 @@ export default defineComponent({
       // 改变设备状态
       setSpaceCondtioners(data: any) {
         setSpaceCondtioners(data)
-          .then(res => {
+          .then((res) => {
             // proxyData.setLoadingNumber();
             proxyData.loadinngEnd();
           })
@@ -773,7 +774,7 @@ export default defineComponent({
           let obj: any = {
             id: item.id, //类型:String  必有字段  备注:设备id
             code: item[equpObj.codeKey], //类型:String  必有字段  备注:编码 EquipSwtichSet
-            value: equpObj.value //类型:String  必有字段  备注:值 0
+            value: equpObj.value, //类型:String  必有字段  备注:值 0
           };
           data.push(obj);
         });
@@ -882,7 +883,7 @@ export default defineComponent({
           let obj: any = {
             id: item.id, //类型:String  必有字段  备注:设备id
             code: item.switchCode, //类型:String  必有字段  备注:编码 EquipSwtichSet
-            value: proxyData.airData.isOpen ? "1" : "0" //类型:String  必有字段  备注:值 0
+            value: proxyData.airData.isOpen ? "1" : "0", //类型:String  必有字段  备注:值 0
           };
           data.push(obj);
         });
@@ -981,13 +982,13 @@ export default defineComponent({
       // 空调信息airTemp的修改
       getAirInfo(isAddTimer: any = 0) {
         const paramObj = {
-          spaceId: proxyData.spaceId
+          spaceId: proxyData.spaceId,
           // spaceId: props.spaceId,//'Sp110108025564f438d7fef64eea8202a6462f1bbcce' 空间id
         };
         //wx.showLoading();
         let str: any = setQueryConfig(paramObj);
         querySpaceConditioners(str)
-          .then(res => {
+          .then((res) => {
             let data: any = res.data || {};
             proxyData.firstLoadingAir = false;
             proxyData.loadingAir = false;
@@ -1021,7 +1022,7 @@ export default defineComponent({
               proxyData.getAirInfoToTimer(3000);
             }
           });
-      }
+      },
     });
     watch(
       [() => props, () => props.spaceId],
@@ -1041,7 +1042,7 @@ export default defineComponent({
       },
       {
         deep: true,
-        immediate: true
+        immediate: true,
       }
     );
     onBeforeUnmount(() => {
@@ -1049,7 +1050,6 @@ export default defineComponent({
         clearTimeout(proxyData.airTimer);
         proxyData.airTimer = null;
         proxyData.distroyFlag = true;
-        console.log("定时器销毁了--");
       }
     });
     onMounted(() => {
@@ -1059,9 +1059,9 @@ export default defineComponent({
       // 获取空调信息
     });
     return {
-      ...toRefs(proxyData)
+      ...toRefs(proxyData),
     };
-  }
+  },
 });
 </script>
 <style lang="scss" scoped>

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

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

+ 3 - 3
src/views/envmonitor/index.vue

@@ -194,7 +194,7 @@
       <!--空调手动控制 end-->
       <!--空调自动控制 start-->
       <Air
-        v-if="controlMode == 0 && spaceExistenceDevice.airConditioner"
+        v-if="controlMode === 0 && spaceExistenceDevice.airConditioner"
         id="airId"
         key="airKey"
         @triggerWork="triggerWork"
@@ -278,7 +278,7 @@
       teleport="#app"
     >
       <work-overtime
-        v-if="isShowWork && controlMode == 0"
+        v-if="isShowWork && controlMode === 0"
         :spaceInfo="spaceInfo"
         @closeWork="closeWork"
         :projectId="projectId"
@@ -2025,7 +2025,7 @@ export default defineComponent({
           item.active = false;
         });
         // proxyData.controlMode = ''; // 模式变成自动的
-        // proxyData.controlMode='';
+        proxyData.controlMode='';
         proxyData.isWork = false;
         proxyData.roomType = "";
         proxyData.officeData.temperature = "";