Explorar el Código

fix: 强制加班

chenzhen2 hace 2 años
padre
commit
364b05c245

+ 11 - 1
src/views/envmonitor/components/Air.vue

@@ -195,6 +195,10 @@ export default defineComponent({
       type: Boolean,
       default: () => false,
     },
+    forceOverTimeFlag: {
+      type: Boolean,
+      default: () => false,
+    },
   },
   components: {
     Switch,
@@ -219,6 +223,7 @@ export default defineComponent({
       loadingAir: false,
       temperature: props.temperature,
       userIsControl: props.userIsControl,
+      forceOverTimeFlag: props.forceOverTimeFlag,
       firstLoadingAir: true,
       domAirOpeen: domAirOpeen,
       feedbackTimer: feedbackTimer,
@@ -398,6 +403,11 @@ export default defineComponent({
           .then(() => {
             // 操作空调
             const domAirOpen = !proxyData.airData.isOpen;
+            if (proxyData.forceOverTimeFlag && domAirOpen) {
+              //需要强制加班
+              contx.emit("triggerWork");
+              return;
+            }
             const itemId = domAirOpen ? 12 : 10; // 12 开启 10关闭
             proxyData.domAirOpeen = domAirOpen;
             let btnTypeDetail = "";
@@ -512,6 +522,7 @@ export default defineComponent({
       }
       proxyData.temperature = props.temperature;
       proxyData.userIsControl = newProps.userIsControl;
+      proxyData.forceOverTimeFlag = newProps.forceOverTimeFlag;
     });
     onBeforeUnmount(() => {
       if (proxyData.airTimer) {
@@ -864,6 +875,5 @@ export default defineComponent({
   .van-switch--disabled {
     opacity: 0.5;
   }
- 
 }
 </style>

+ 258 - 207
src/views/envmonitor/components/Light.vue

@@ -3,50 +3,45 @@
     <div class="light-top">
       <div class="light-desc">
         <p class="light-title">
-          {{ isShowChildLight ? '光照' : lampList[0].localName }}
+          {{ isShowChildLight ? "光照" : lampList[0].localName }}
         </p>
-        <p :class="isShowChildLight?'light-status':'light-status'">
-          {{ lampSw ? '照明已开启' : '照明已关闭' }}
+        <p :class="isShowChildLight ? 'light-status' : 'light-status'">
+          {{ lampSw ? "照明已开启" : "照明已关闭" }}
         </p>
         <div class="show-all" @click.stop="showAll" v-if="isShowChildLight">
-          <van-icon
-            :name="lightIcon"
-            class="light-icon"
-          />
+          <van-icon :name="lightIcon" class="light-icon" />
           <span>显示全部</span>
         </div>
       </div>
       <div class="light-right">
-        <img
-          :src="lightImg"
-          alt=""
-        >
-        <Switch 
-                v-if="!showFlag"
-                :disabled="!userIsControl"
-                v-model="lampSw"
-                @click="eqChange('allLamp','',0)"
-                inactive-color="rgba(196, 196, 196, 0.4)"
-                class="switch-btn"
+        <img :src="lightImg" alt="" />
+        <Switch
+          v-if="!showFlag"
+          :disabled="!userIsControl"
+          v-model="lampSw"
+          @click="eqChange('allLamp', '', 0)"
+          inactive-color="rgba(196, 196, 196, 0.4)"
+          class="switch-btn"
         />
       </div>
     </div>
     <!--灯控制按钮-->
-    <div class="light-control"
-         v-for="(item,index) in lampList"
-         :key="item.id"
-         v-if="showFlag && isShowChildLight"
+    <div
+      class="light-control"
+      v-for="(item, index) in lampList"
+      :key="item.id"
+      v-if="showFlag && isShowChildLight"
     >
       <div class="control-title">
         {{ item.localName }}
       </div>
-      <Switch 
-              active-color="$elActiveColor"
-              :disabled="!userIsControl"
-              v-model="item.switch"
-              @click="eqChange('main',item,index)"
-              inactive-color="rgba(196, 196, 196, 0.2)"
-              class="switch-btn"
+      <Switch
+        active-color="$elActiveColor"
+        :disabled="!userIsControl"
+        v-model="item.switch"
+        @click="eqChange('main', item, index)"
+        inactive-color="rgba(196, 196, 196, 0.2)"
+        class="switch-btn"
       />
     </div>
   </div>
@@ -62,165 +57,196 @@ import {
   getCurrentInstance,
   watch,
   onBeforeMount,
-  onUnmounted, onBeforeUnmount
-} from 'vue'
-import { Switch, Toast } from 'vant'
-import { getLampHttp, getStatusHttp, setallLampHttp } from '@/apis/envmonitor'
-import { parseImgUrl } from '@/utils'
+  onUnmounted,
+  onBeforeUnmount,
+} from "vue";
+import { Switch, Toast } from "vant";
+import { getLampHttp, getStatusHttp, setallLampHttp } from "@/apis/envmonitor";
+import { parseImgUrl } from "@/utils";
 
 export default defineComponent({
   props: {
     projectId: {
       type: String,
-      default: () => ''
+      default: () => "",
     },
     spaceId: {
       type: String,
-      default: () => ''
+      default: () => "",
     },
     userIsControl: {
       type: Boolean,
-      default: () => false
-    }
+      default: () => false,
+    },
+    forceOverTimeFlag: {
+      type: Boolean,
+      default: () => false,
+    },
   },
   components: { Switch },
-  setup(props) {
-    const lampList: any = []
-    let lightsStatusTimer: any = null
-    const timeOut: any = null
-    const initData: any = []
-    let lightParams: any = []
+  setup(props, contx) {
+    const lampList: any = [];
+    let lightsStatusTimer: any = null;
+    const timeOut: any = null;
+    const initData: any = [];
+    let lightParams: any = [];
     const proxyData = reactive({
       userIsControl: props.userIsControl,
+      forceOverTimeFlag: props.forceOverTimeFlag,
       setStatus: false,
       lightParams: lightParams,
-      allowSvg: 'down_Arrow.svg',
+      allowSvg: "down_Arrow.svg",
       timeOut: timeOut,
-      lightIcon: 'arrow-down',
+      lightIcon: "arrow-down",
       showFlag: false,
       loadingLight: false,
       initData: initData,
       lampList: lampList,
       lightsStatusTimer: lightsStatusTimer,
       startCheckLightsTime: 0,
-      lightImg: parseImgUrl('page-officehome', 'lamp_close_v2.png'),
-      lampSw: false,  // 主灯开关
+      lightImg: parseImgUrl("page-officehome", "lamp_close_v2.png"),
+      lampSw: false, // 主灯开关
       // 点击展示所有的登录
       showAll() {
-        proxyData.showFlag = !proxyData.showFlag
-        proxyData.lightIcon = 'arrow-down'
+        proxyData.showFlag = !proxyData.showFlag;
+        proxyData.lightIcon = "arrow-down";
       },
       // 获取灯的状态
       getLampList() {
-        getLampHttp({ spaceId: props.spaceId }).then(res => {
-          const resData: any = res
-          if (!proxyData.setStatus) {
-            if (resData && resData.result == 'success') {
-              let content = resData?.content ?? []
-              let lampOpen = false // 如果有一个开 则总灯开
-              for (let i = 0; i < content.length; i++) {
-                content[i].type = 'lamp'
-                content[i].imgOpen = parseImgUrl('page-officehome', 'lampch_open.png')
-                content[i].imgClose = parseImgUrl('page-officehome', 'lampch_close.png')
-                content[i].switch = content[i].runStatus ? true : false
-                if (content[i].runStatus) {
-                  lampOpen = true
+        getLampHttp({ spaceId: props.spaceId })
+          .then((res) => {
+            const resData: any = res;
+            if (!proxyData.setStatus) {
+              if (resData && resData.result == "success") {
+                let content = resData?.content ?? [];
+                let lampOpen = false; // 如果有一个开 则总灯开
+                for (let i = 0; i < content.length; i++) {
+                  content[i].type = "lamp";
+                  content[i].imgOpen = parseImgUrl(
+                    "page-officehome",
+                    "lampch_open.png"
+                  );
+                  content[i].imgClose = parseImgUrl(
+                    "page-officehome",
+                    "lampch_close.png"
+                  );
+                  content[i].switch = content[i].runStatus ? true : false;
+                  if (content[i].runStatus) {
+                    lampOpen = true;
+                  }
+                  content[i].loading = false;
                 }
-                content[i].loading = false
+                proxyData.initData = JSON.parse(JSON.stringify(content)); //  灯的数据
+                proxyData.lampSw = lampOpen; // 主灯开关
+                proxyData.lampList = content;
+                proxyData.lightImg = proxyData.lampSw
+                  ? parseImgUrl("page-officehome", "lamp_open_v2.png")
+                  : parseImgUrl("page-officehome", "lamp_close_v2.png");
               }
-              proxyData.initData = JSON.parse(JSON.stringify(content))//  灯的数据
-              proxyData.lampSw = lampOpen // 主灯开关
-              proxyData.lampList = content
-              proxyData.lightImg = proxyData.lampSw ? parseImgUrl('page-officehome', 'lamp_open_v2.png')
-                : parseImgUrl('page-officehome', 'lamp_close_v2.png')
             }
-          }
-          console.log('执行了----====')
-          proxyData.startLightsStatusTimer()
-        }).catch(() => {
-          proxyData.startLightsStatusTimer()
-        })
+            console.log("执行了----====");
+            proxyData.startLightsStatusTimer();
+          })
+          .catch(() => {
+            proxyData.startLightsStatusTimer();
+          });
       },
       // 调整灯
       eqChange(type: any, item: any, index: any) {
         if (proxyData.userIsControl) {
-          if (type === 'allLamp') {  //  总开关按钮所有灯
+          // debugger
+          if (type === "allLamp") {
+            if (proxyData.forceOverTimeFlag && proxyData.lampSw) {
+              // 强制加班开灯
+              contx.emit("triggerWork");
+              return;
+            }
+            //  总开关按钮所有灯
             //  当前要执行的灯的操作
-            proxyData.loadingLight = true
+            proxyData.loadingLight = true;
             // const statusFlag = !proxyData.lampSw
             // console.log('proxyData.lampSw==')
-            const statusFlag = proxyData.lampSw
+            const statusFlag = proxyData.lampSw;
             // 瞬间修改状态
-            proxyData.setStatus = true
-            proxyData.updateAllLampStatus(statusFlag)
-            proxyData.setLamp(type, '', statusFlag, 0)// 调接口
+            proxyData.setStatus = true;
+            proxyData.updateAllLampStatus(statusFlag);
+            proxyData.setLamp(type, "", statusFlag, 0); // 调接口
           } else {
+            if (proxyData.forceOverTimeFlag && item.switch) {
+              // 强制加班开灯
+              contx.emit("triggerWork");
+              return;
+            }
             //当前要执行的灯的操作
             // 按钮loading
-            item.loading = true
-            const statusFlag: any = item.switch
-            let id = item.id
-            proxyData.setStatus = true
-            proxyData.updateLampStatus(item, statusFlag)
-            proxyData.setLamp(type, id, statusFlag, index)// 调接口
+            item.loading = true;
+            const statusFlag: any = item.switch;
+            let id = item.id;
+            proxyData.setStatus = true;
+            proxyData.updateLampStatus(item, statusFlag);
+            proxyData.setLamp(type, id, statusFlag, index); // 调接口
           }
         } else {
-          Toast('您没有当前空间的控制权限!')
+          Toast("您没有当前空间的控制权限!");
         }
       },
       //  控制灯的接口
       setLamp(type: string, id: any, statusFlag: any, index: any) {
-        let params: any = []
-        if (type === 'allLamp') {
+        let params: any = [];
+        if (type === "allLamp") {
           for (let i = 0; i < proxyData.initData.length; i++) {
-            proxyData.initData[i].switch = statusFlag
+            proxyData.initData[i].switch = statusFlag;
           }
-          params = proxyData.initData
+          params = proxyData.initData;
         } else {
-          params = [{
-            id: id,
-            switch: statusFlag
-          }]
+          params = [
+            {
+              id: id,
+              switch: statusFlag,
+            },
+          ];
         }
-        proxyData.lightParams = params
+        proxyData.lightParams = params;
         // 调服务端的接口像后台发送灯的操作的指令
-        setallLampHttp(params).then(res => {
-          const resData: any = res
-          // set成功后1s关闭定时器
-          setTimeout(() => {
-            proxyData.setStatus = false
-          }, 1000)
-          if (resData.result === 'success') {
-            // const checkData: any = proxyData.judgeChangeResponeseSuccess(resData)
-            // proxyData.getTimeLampStatus(checkData, type, id, statusFlag, index)
-          } else {
-            proxyData.initLampLoading()
-          }
-        }).catch(() => {
-          setTimeout(() => {
-            proxyData.setStatus = false
-          }, 1000)
-        })
+        setallLampHttp(params)
+          .then((res) => {
+            const resData: any = res;
+            // set成功后1s关闭定时器
+            setTimeout(() => {
+              proxyData.setStatus = false;
+            }, 1000);
+            if (resData.result === "success") {
+              // const checkData: any = proxyData.judgeChangeResponeseSuccess(resData)
+              // proxyData.getTimeLampStatus(checkData, type, id, statusFlag, index)
+            } else {
+              proxyData.initLampLoading();
+            }
+          })
+          .catch(() => {
+            setTimeout(() => {
+              proxyData.setStatus = false;
+            }, 1000);
+          });
       },
       // 报错后关闭灯的loading
       initLampLoading() {
-        proxyData.loadingLight = false
+        proxyData.loadingLight = false;
         proxyData.lampList.map((item: any) => {
-          item.loading = false
-        })
+          item.loading = false;
+        });
       },
       //手动修改灯的状态
       updateAllLampStatus(statusFlag: any) {
-        proxyData.lampSw = statusFlag
+        proxyData.lampSw = statusFlag;
         for (let i = 0; i < proxyData.lampList.length; i++) {
-          proxyData.lampList[i].switch = statusFlag
+          proxyData.lampList[i].switch = statusFlag;
           // if (proxyData.lampList[i].type == 'lamp') {
           // }
         }
       },
       // 单个灯的状态修改
       updateLampStatus(item: any, statusFlag: any) {
-        item.switch = statusFlag
+        item.switch = statusFlag;
         // let flag: any = true
         // for (let i = 0; i < proxyData.lampList.length; i++) {
         //   if (proxyData.lampList[i].type == 'lamp') {
@@ -232,152 +258,179 @@ export default defineComponent({
         // }
       },
       // 轮询查看状态
-      getTimeLampStatus(checkData: any, type: any, id: any, statusFlag: any, index: any) {
-        if (checkData['success'] && checkData['success'].length) {
-          if (type === 'allLamp') {   // 点击主灯按钮
-            proxyData.updateAllLampLoading(checkData['success'])// 所有灯
-          } else {  // 当个的时候修改loading的状态
-            proxyData.updateLampLoading(index)
+      getTimeLampStatus(
+        checkData: any,
+        type: any,
+        id: any,
+        statusFlag: any,
+        index: any
+      ) {
+        if (checkData["success"] && checkData["success"].length) {
+          if (type === "allLamp") {
+            // 点击主灯按钮
+            proxyData.updateAllLampLoading(checkData["success"]); // 所有灯
+          } else {
+            // 当个的时候修改loading的状态
+            proxyData.updateLampLoading(index);
           }
-          proxyData.getLampList()
+          proxyData.getLampList();
         }
-        if (checkData['processing'] && checkData['processing'].length) {
-          let checkParams: any = proxyData.lightParams
-          let processArr: any = checkData['processing']
-          let params: any = []
+        if (checkData["processing"] && checkData["processing"].length) {
+          let checkParams: any = proxyData.lightParams;
+          let processArr: any = checkData["processing"];
+          let params: any = [];
           processArr.map((item: any) => {
             let obj: any = {
               id: item.id,
-              orderSeqNum: item.orderSeqNum
-            }
+              orderSeqNum: item.orderSeqNum,
+            };
             for (let i = 0; i < checkParams.length; i++) {
               if (item.id === checkParams[i].id) {
-                obj.switch = checkParams[i].switch
-                break
+                obj.switch = checkParams[i].switch;
+                break;
               }
             }
-            params.push(obj)
-          })
-          proxyData.checkChangeLightStatusSuccess(params, type, id, statusFlag, index)
+            params.push(obj);
+          });
+          proxyData.checkChangeLightStatusSuccess(
+            params,
+            type,
+            id,
+            statusFlag,
+            index
+          );
         }
-        if (checkData['error'] && checkData['error'].length) {
-          if (type === 'allLamp') {   // 点击主灯按钮
-            proxyData.updateAllLampLoading(checkData['error'])// 所有灯
-          } else {  // 当个的时候修改loading的状态
-            proxyData.updateLampLoading(index)
+        if (checkData["error"] && checkData["error"].length) {
+          if (type === "allLamp") {
+            // 点击主灯按钮
+            proxyData.updateAllLampLoading(checkData["error"]); // 所有灯
+          } else {
+            // 当个的时候修改loading的状态
+            proxyData.updateLampLoading(index);
           }
         }
       },
       // 查看指令是否成功完成
       judgeChangeResponeseSuccess(resData: any) {
-        let data: any = resData?.content ?? []
-        let processingArr: any = []
-        let successArr: any = []
-        let errorArr: any = []
+        let data: any = resData?.content ?? [];
+        let processingArr: any = [];
+        let successArr: any = [];
+        let errorArr: any = [];
         for (let i = 0; i < data.length; i++) {
-          let item: any = data[i]
-          if (item.result = 'success') {
-            if (item.state === 200 && item.exeResult === 'success') {
-              successArr.push(item)
-            } else if (item.state === 200 && item.exeResult === 'processing:rcvd'
-              || (item.state === 202 && !item.exeResult)) {
-              processingArr.push(item)
+          let item: any = data[i];
+          if ((item.result = "success")) {
+            if (item.state === 200 && item.exeResult === "success") {
+              successArr.push(item);
+            } else if (
+              (item.state === 200 && item.exeResult === "processing:rcvd") ||
+              (item.state === 202 && !item.exeResult)
+            ) {
+              processingArr.push(item);
             } else {
-              errorArr.push(item)
+              errorArr.push(item);
             }
           } else {
-            errorArr.push(item)
+            errorArr.push(item);
           }
         }
         let obj: any = {
-          'success': successArr,
-          'processing': processingArr,
-          'error': errorArr
-        }
-        return obj
+          success: successArr,
+          processing: processingArr,
+          error: errorArr,
+        };
+        return obj;
       },
       // 操作成功后更新所有灯的真实状态
       updateAllLampLoading(arr: any) {
         for (let i = 0; i < proxyData.lampList.length; i++) {
-          if (proxyData.lampList[i].type == 'lamp') {
+          if (proxyData.lampList[i].type == "lamp") {
             arr.map((item: any) => {
               if (proxyData.lampList[i].id === item.id) {
-                proxyData.lampList[i].loading = false
+                proxyData.lampList[i].loading = false;
               }
-            })
+            });
           }
         }
         let loadingLen = proxyData.lampList.filter((item: any) => {
-          return item.loading
-        })
+          return item.loading;
+        });
         if (loadingLen.length === 0) {
-          proxyData.loadingLight = false
+          proxyData.loadingLight = false;
         }
       },
       // 动态切换主灯的状态
       updateLampLoading(index: any) {
-        proxyData.lampList[index].loading = false
+        proxyData.lampList[index].loading = false;
       },
       // 灯的指令完成后更新状态
-      checkChangeLightStatusSuccess(checkParams: any, type: any, id: any, value: any, index: any) {
+      checkChangeLightStatusSuccess(
+        checkParams: any,
+        type: any,
+        id: any,
+        value: any,
+        index: any
+      ) {
         // 轮询查询灯的状态
-        getStatusHttp(checkParams).then(res => {
-          const resData: any = res
-          const checkData: any = proxyData.judgeChangeResponeseSuccess(resData)
-          proxyData.getTimeLampStatus(checkData, type, id, value, index)
-        })
+        getStatusHttp(checkParams).then((res) => {
+          const resData: any = res;
+          const checkData: any = proxyData.judgeChangeResponeseSuccess(resData);
+          proxyData.getTimeLampStatus(checkData, type, id, value, index);
+        });
       },
       // 定时刷新接口
       startLightsStatusTimer() {
         if (proxyData.lightsStatusTimer) {
-          window.clearTimeout(proxyData.lightsStatusTimer)
-          proxyData.lightsStatusTimer = null
+          window.clearTimeout(proxyData.lightsStatusTimer);
+          proxyData.lightsStatusTimer = null;
         }
         proxyData.lightsStatusTimer = window.setTimeout(() => {
-          proxyData.getLampList()
-        }, 2000)
-      }
-    })
+          proxyData.getLampList();
+        }, 2000);
+      },
+    });
     const isShowChildLight = computed(() => {
-      return proxyData.lampList.length && proxyData.lampList.length > 1
-    })
+      return proxyData.lampList.length && proxyData.lampList.length > 1;
+    });
     watch(
       props,
       (newProps: any) => {
-        if (newProps.spaceId) {   // 空间id改变的重新获取值调用接口
-          console.log('spaceid变化了=======')
-          proxyData.startLightsStatusTimer()
+        if (newProps.spaceId) {
+          // 空间id改变的重新获取值调用接口
+          console.log("spaceid变化了=======");
+          proxyData.startLightsStatusTimer();
         }
         // 定时调空间信息
-        proxyData.userIsControl = newProps.userIsControl
-      }, {
+        proxyData.userIsControl = newProps.userIsControl;
+        proxyData.forceOverTimeFlag = newProps.forceOverTimeFlag;
+      },
+      {
         deep: false,
-        immediate: true
-      })
+        immediate: true,
+      }
+    );
     onBeforeUnmount(() => {
       if (proxyData.lightsStatusTimer) {
-        window.clearTimeout(proxyData.lightsStatusTimer)
-        proxyData.lightsStatusTimer = null
+        window.clearTimeout(proxyData.lightsStatusTimer);
+        proxyData.lightsStatusTimer = null;
       }
-    })
+    });
     onMounted(() => {
       // console.log('空间切换====d')
       // 获取空调信息
-      proxyData.getLampList()
+      proxyData.getLampList();
       // proxyData.startLightsStatusTimer()
-    })
+    });
     return {
       isShowChildLight,
-      ...toRefs(proxyData
-      )
-    }
-  }
-})
+      ...toRefs(proxyData),
+    };
+  },
+});
 </script>
 <style lang="scss" scoped>
 .light {
   width: 100%;
-  background: #FFFFFF;
+  background: #ffffff;
   box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.07), 0px 4px 10px rgba(0, 0, 0, 0.05);
   border-radius: 25px;
   margin: 15px 0px;
@@ -396,7 +449,7 @@ export default defineComponent({
   font-family: PingFang SC;
   font-size: 16px;
   line-height: 19px;
-  color: #4D5262;
+  color: #4d5262;
   flex: none;
   order: 0;
   flex-grow: 0;
@@ -426,7 +479,7 @@ export default defineComponent({
   padding-left: 5px;
   font-size: 16px;
   line-height: 19px;
-  color: #4D5262;
+  color: #4d5262;
   flex: none;
   order: 0;
   flex-grow: 0;
@@ -438,14 +491,13 @@ export default defineComponent({
   padding-left: 5px;
   font-size: 14px;
   line-height: 16px;
-  color: #C4C4C4;
+  color: #c4c4c4;
   flex: none;
   order: 1;
   flex-grow: 0;
   margin: 10px 0px;
 }
 
-
 .show-all {
   font-family: PingFang SC;
   //display: none;
@@ -458,7 +510,7 @@ export default defineComponent({
   padding-bottom: 22px;
   font-size: 14px;
   line-height: 16px;
-  color: #C4C4C4;
+  color: #c4c4c4;
   margin: 0px 5px;
 }
 
@@ -474,14 +526,13 @@ export default defineComponent({
     font-family: PingFang SC;
     font-size: 16px;
     line-height: 30px;
-    color: #4D5262;
+    color: #4d5262;
   }
 
   .switch-btn {
     margin-top: 5px;
   }
 }
-
 </style>
 <style class="style" lang="scss">
 .light {

+ 3 - 0
src/views/envmonitor/components/workOvertime/WorkConfig.vue

@@ -299,6 +299,9 @@ export default defineComponent({
                 }
               }
             }
+            // debugger
+            // 记录开灯标记
+            contx.emit("setForceOverTimeFlag", proxyData.forcedOverTimeFlag);
           }
         }
       },

+ 16 - 2
src/views/envmonitor/index.vue

@@ -98,6 +98,7 @@
           :scenarioArr="scenarioArr"
           :workkArr="workkArr"
           @triggerWork="triggerWork"
+          @setForceOverTimeFlag="setForceOverTimeFlag"
         ></work-config>
         <scenario-config
           v-if="roomType === '会议室' && scenarioArr && scenarioArr.length"
@@ -113,6 +114,8 @@
         v-if="officeData.temperature || spaceExistenceDevice.airConditioner"
         id="airId"
         key="airId"
+        @triggerWork="triggerWork"
+        :forceOverTimeFlag="forceOverTimeFlag"
         @updateAirTemp="updateAirTemp"
         :hasAir="spaceExistenceDevice.airConditioner"
         :airVolumes="officeData.airVolumes"
@@ -124,6 +127,8 @@
       />
       <Light
         v-if="spaceExistenceDevice.light"
+        :forceOverTimeFlag="forceOverTimeFlag"
+        @triggerWork="triggerWork"
         id="lightId"
         key="lightId"
         :userIsControl="userIsControl"
@@ -649,6 +654,15 @@ export default defineComponent({
         proxyData.isShowWork = false;
         console.log("关闭加班功能---");
       },
+      forceOverTimeFlag: false,
+      setForceOverTimeFlag(flag: any) {
+        // debugger
+        if (proxyData.roomType === "开放" && flag) {
+          proxyData.forceOverTimeFlag = true;
+        } else {
+          proxyData.forceOverTimeFlag = false;
+        }
+      },
       // /**
       //  * 修改空间id
       //  * @param spaceId
@@ -1465,14 +1479,14 @@ export default defineComponent({
           for (let i = 0; i < proxyData.workkArr.length; i++) {
             let customSceneList: any =
               proxyData.workkArr[i]?.customSceneList ?? [];
-              customSceneList=customSceneList.sort(proxyData.compare)
+            customSceneList = customSceneList.sort(proxyData.compare);
           }
 
           proxyData.queryCustomAndScenceTimer(5000);
         });
       },
       // 数组排序
-      compare(obj1:any, obj2:any) {
+      compare(obj1: any, obj2: any) {
         var val1 = obj1.startTime;
         var val2 = obj2.startTime;
         if (val1 < val2) {