Browse Source

fix:手动控制调整

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

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

@@ -228,7 +228,16 @@ export default defineComponent({
         getLampHttp({ spaceId: proxyData.spaceId })
         getLampHttp({ spaceId: proxyData.spaceId })
           .then((res) => {
           .then((res) => {
             const resData: any = 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") {
             if (resData && resData.result == "success") {
                 let content = resData?.content ?? [];
                 let content = resData?.content ?? [];
                 let lampOpen = false; // 如果有一个开 则总灯开
                 let lampOpen = false; // 如果有一个开 则总灯开
@@ -278,6 +287,7 @@ export default defineComponent({
                   }
                   }
                 }
                 }
               }
               }
+
             // console.log("执行了----====");
             // console.log("执行了----====");
             if(isAddTimer==0){
             if(isAddTimer==0){
               proxyData.startLightsStatusTimer();
               proxyData.startLightsStatusTimer();

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

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