Browse Source

fix: 手动控制的加班绑定设备功能

chenzhen2 2 years ago
parent
commit
408e95ec11

+ 3 - 0
dist/sgipad/images/ipdImages/check-active.svg

@@ -0,0 +1,3 @@
+<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="9" cy="9" r="8.5" fill="#FFE723" stroke="#424C59"/>
+</svg>

+ 3 - 0
dist/sgipad/images/ipdImages/check.svg

@@ -0,0 +1,3 @@
+<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="9" cy="9" r="8.5" stroke="#C4C9CF"/>
+</svg>

+ 3 - 0
public/images/ipdImages/check-close.svg

@@ -0,0 +1,3 @@
+<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="9" cy="9" r="8.5" stroke="#C4C9CF"/>
+</svg>

+ 18 - 0
public/images/ipdImages/check-open.svg

@@ -0,0 +1,18 @@
+<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g filter="url(#filter0_d_1_3)">
+<circle cx="13" cy="9" r="8.5" fill="#CE9F27" stroke="#424C59"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M16.7816 6.25329C16.4943 5.99461 16.0517 6.0178 15.793 6.3051L12.1474 10.354L10.3762 8.38676C10.1175 8.09946 9.67486 8.07627 9.38756 8.33495C9.10026 8.59364 9.07706 9.03625 9.33575 9.32355L11.5655 11.8C11.6675 11.9133 11.7982 11.9855 11.9366 12.0156C12.1984 12.114 12.505 12.049 12.7035 11.8286L16.8334 7.24188C17.0921 6.95458 17.0689 6.51198 16.7816 6.25329Z" fill="#424C59"/>
+</g>
+<defs>
+<filter id="filter0_d_1_3" x="0" y="0" width="26" height="26" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
+<feOffset dy="4"/>
+<feGaussianBlur stdDeviation="2"/>
+<feComposite in2="hardAlpha" operator="out"/>
+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_3"/>
+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_3" result="shape"/>
+</filter>
+</defs>
+</svg>

+ 6 - 2
src/apis/envmonitor.ts

@@ -170,7 +170,9 @@ export const querySpaceSceneConfig = (params: any) => {
  *  查询加班记录
  */
 export const queryCustomAndScence = (params: any) => {
-  return https().request<any>(`${duoduoenvService}customScene/queryCustomAndScence?${params}`, Method.GET, undefined, ContentType.json)
+  //return https().request<any>(`${duoduoenvService}customScene/queryCustomAndScence?${params}`, Method.GET, undefined, ContentType.json)
+
+  return https().request<any>(`${testApi}customScene/queryCustomAndScence?${params}`, Method.GET, undefined, ContentType.json)
 }
 
 /**
@@ -178,9 +180,11 @@ export const queryCustomAndScence = (params: any) => {
  * @param params
  */
 export const saveBatchCustomScene = (data: any) => {
-  return post(`${duoduoenvService}customScene/saveBatchCustomScene`, data)
+  // return post(`${duoduoenvService}customScene/saveBatchCustomScene`, data)
+  return post(`${testApi}customScene/saveBatchCustomScene`, data)
 }
 
+
 /**
  *  查询默认位置
  */

+ 2 - 1
src/styles/index.scss

@@ -174,7 +174,8 @@ div:focus {
 .popup-content {
   height: 100%;
   width: 500px;
-  padding: 3.33vh 20px;
+  padding: 10px 20px;
+  // padding: 2.33vh 20px;
 }
 
 .van-switch--on {

+ 1 - 1
src/views/envmonitor/components/ManualWork/WorkConfig.vue

@@ -99,7 +99,7 @@ export default defineComponent({
       },
       // 触发加班按钮
       triggerWork() {
-        contx.emit("triggerWork");
+        contx.emit("triggerWork",1);
       },
       timerText: timerText,
       text: text,

+ 251 - 69
src/views/envmonitor/components/ManualWork/index.vue

@@ -2,7 +2,7 @@
   <div class="work-content">
     <div class="work-space">
       <div class="space-title">{{ spaceInfo.spaceName }} 申请延时</div>
-      <div class="device-tip">延时期间,空间相关设备会开启</div>
+      <div class="tip">延时期间,空间相关设备会开启</div>
     </div>
     <div class="add-time" id="addTimeId">
       <div class="date_box" v-if="dateArr && dateArr.length">
@@ -53,18 +53,66 @@
       </div>
     </div>
     <!--预约的设备 start-->
-    <div class="device-box">
-      <div class="device-title">
-        <span></span>
-        <span></span>
-        <span></span>
-      </div>
+    <div class="device-title">
+      <span class="line"></span>
+      <span class="text">预约开启设备</span>
+      <span class="line"></span>
+    </div>
+    <div class="work-device">
+      <div class="row-title">空调</div>
+      <template
+        v-for="(item, index) in nowData.equipmentList"
+        :key="'eq' + index"
+      >
+        <div class="device-box" v-if="item.equipmentCategory !== 'SELTLT'">
+          <div class="device-row" @click="checkEquipment(item)">
+            <span>{{ item.name }}</span>
+            <img
+              :src="
+                item.isCheck
+                  ? parseImgUrl('ipdImages', 'check-open.svg')
+                  : parseImgUrl('ipdImages', 'check-close.svg')
+              "
+              alt=""
+            />
+          </div>
+        </div>
+      </template>
+      <div class="row-title">灯</div>
+      <template
+        v-for="(item, index) in nowData.equipmentList"
+        :key="'eq' + index"
+      >
+        <div class="device-box" v-if="item.equipmentCategory === 'SELTLT'">
+          <div class="device-row" @click="checkEquipment(item)">
+            <span>{{ item.name }}</span>
+            <img
+              :src="
+                item.isCheck
+                  ? parseImgUrl('ipdImages', 'check-open.svg')
+                  : parseImgUrl('ipdImages', 'check-close.svg')
+              "
+              alt=""
+            />
+          </div>
+        </div>
+      </template>
+
       <div class="device-tip">
-        *空调延时采用后付费方式,系统将根据您申请的时间产生延时费用。预约时间下您可自由开启空间下的设备。
-        收费标准按开机设备对应空间的面积计费,空调加时费用按50元/m2·h进行计费,照明设备延时使用不计费。
-        如您提前结束工作,请点击“我要离开”按钮,系统会自动调整设备关闭时间,感谢与您一同共创可持续的办公环境。
+        <span>计费方式:</span>
+        <p>
+          <span> * </span>
+          空调延时采用后付费方式,系统将根据您申请的时间产生延时费用。预约时间下您可自由开启空间下的设备。
+        </p>
+        <p>
+          收费标准按开机设备对应空间的面积计费,空调加时费用按50元/m2·h进行计费,照明设备延时使用不计费。
+        </p>
+        <p>
+          如您提前结束工作,请点击“我要离开”按钮,系统会自动调整设备关闭时间,感谢与您一同共创可持续的办公环境。
+        </p>
       </div>
     </div>
+
     <van-loading class="temp-loading" v-if="showLoading" />
   </div>
 </template>
@@ -99,6 +147,7 @@ import { myTime } from "@/model/workTimeData";
 import { propsToAttrMap } from "@vue/shared";
 import { isTemplateElement } from "@babel/types";
 import { saveBatchCustomScene } from "@/apis/envmonitor";
+import { number } from "echarts";
 
 export default defineComponent({
   components: {
@@ -117,6 +166,10 @@ export default defineComponent({
       type: Object,
       default: () => {},
     },
+    enterType: {
+      type: Number,
+      default: () => 1,
+    },
   },
   setup(props, context) {
     const proxyGlobal: any = getCurrentInstance();
@@ -134,6 +187,7 @@ export default defineComponent({
     const userInfo: any = getUserInfo();
     const proxyData = reactive({
       userInfo: userInfo,
+      parseImgUrl: parseImgUrl,
       isEvent: false,
       screenInfo: screenInfo,
       projectId: props.projectId,
@@ -147,6 +201,7 @@ export default defineComponent({
       startLen: 0,
       formBtn: false,
       showLoading: false,
+      enterType: props.enterType, // 1:all 2:空调 3:灯
       setScreennWidth() {
         let addTimeEl: any = document.querySelector("#addTimeId");
         proxyData.screenInfo.screenWidth = addTimeEl.offsetWidth;
@@ -168,7 +223,7 @@ export default defineComponent({
         }
         return nowIndex;
       },
-      // 获取当前位置的坐标
+      // 获取当前位置的坐标(多端服务定制的判断规则-待开发)
       getNowPerstion(timerArr: any) {
         let nowIndex: any = proxyData.getNowIndex();
         let obj: any = {
@@ -182,6 +237,10 @@ export default defineComponent({
         let cusEndTime: any = proxyData.parseCusEndTime(
           proxyData.nowData.cusEndTime
         );
+
+        let spaceCustomContentList: any =
+          proxyData.nowData.spaceCustomContentList || [];
+
         if (formatTimer >= cusStartTime && formatTimer <= cusEndTime) {
           //在服务定制时间之间
           timerArr.map((item: any, index: any) => {
@@ -189,6 +248,7 @@ export default defineComponent({
               obj.nowIndex = index;
             }
           });
+          spaceCustomContentList.map((item: any) => {});
         } else if (formatTimer < cusStartTime) {
           timerArr.map((item: any, index: any) => {
             if (item.formatTimer === cusStartTime) {
@@ -201,8 +261,8 @@ export default defineComponent({
         }
         return obj;
       },
-      // 设置可选时间
-      setOptionnalTime(timerArr: any) {
+      // 设置当前可选择的时间可选时间
+      setNowBarPerstion(timerArr: any) {
         let sliderList: any = document.querySelector("#sliderListId");
         let slidersWrapper: any = document.querySelector("#slidersWrapperId");
         let sliderWidth: any = slidersWrapper.getBoundingClientRect().width;
@@ -595,22 +655,26 @@ export default defineComponent({
         proxyData.formBtn = false;
         let nowIndex: any = proxyData.getNowIndex();
         if (proxyData.nowData.week === "今天" && index < nowIndex) {
-          // 过去的时间不可选择
-          // 过去的时间不可选择
           return;
         }
-        if (proxyData.nowData.cusStartTime && proxyData.nowData.cusEndTime) {
-          let formatTimer: any = proxyData.nowTimerArr[index].formatTimer; //在服务定制时间之间
-          let cusStartTime: any = proxyData.parseCusStartTime(
-            proxyData.nowData.cusStartTime
-          );
-          let cusEndTime: any = proxyData.parseCusEndTime(
-            proxyData.nowData.cusEndTime
+
+        let spaceCustomContentList: any =
+          proxyData.nowData.spaceCustomContentList || [];
+        let formatTimer: any = proxyData.nowTimerArr[index].formatTimer; //在服务定制时间之间
+        let flag: any = false;
+        spaceCustomContentList.map((spaceCustom: any) => {
+          let startTime: any = proxyData.parseCusStartTime(
+            spaceCustom.startTime
           );
-          if (formatTimer >= cusStartTime && formatTimer < cusEndTime) {
-            return;
+          let endTime: any = proxyData.parseCusEndTime(spaceCustom.endTime);
+          if (formatTimer >= startTime && formatTimer < endTime) {
+            flag = true;
           }
+        });
+        if (flag) {
+          return;
         }
+
         proxyData.setOptionnalPerstion(index);
       },
       /**
@@ -618,21 +682,14 @@ export default defineComponent({
        */
       dateArr: dateArr,
       myTimeArr: myTimeArr,
-      // // 服务定制开始时间转化(处理服务定制时间包含几分钟的问题)
-      // parseCusStatTime() {},
-      // // 服务定制结束时间转化(处理服务定制时间包含几分钟的问题)
-      // parseCusEndTime(time: any) {
-      //   let newTime: any = "";
-      //   if (time) {
-      //     let minute: any = (time / 100) % 100;
-      //     if (minute < 30) {
-
-      //     } else if (minute > 30) {
-      //     } else {
-      //       newTime = time;
-      //     }
-      //   }
-      // },
+      // 格式化设备
+      formateEquipment() {
+        if (proxyData.enterType === 1) {
+          proxyData.nowData.equipmentList.map((item: any) => {
+            item.isCheck = true;
+          });
+        }
+      },
       setWorkTimeList() {
         proxyData.isUpdate = false;
         proxyGlobal.proxy.$loadinngEnd();
@@ -641,6 +698,7 @@ export default defineComponent({
         let nowDate: any = formatDate("YYYY-MM-DD");
         for (let i = 0; i < data.length; i++) {
           let date: any = formatDateStr(data[i].date);
+
           let cusStartTime: any = proxyData.parseCusStartTime(
             data[i].cusStartTime
           );
@@ -656,6 +714,7 @@ export default defineComponent({
             let obj: any = {
               timer: proxyData.timerArr[i],
               isCheck: false,
+              isServiceTime: false,
               formatTimer: proxyData.timerArr[i].replace(/[:]/g, "") + "00",
             };
             timerArr.push(obj);
@@ -695,28 +754,38 @@ export default defineComponent({
               }
             }
           });
-          // 是否在固定区域时间
-          if (cusStartTime && cusEndTime) {
-            timerArr.map((item: any) => {
-              if (
-                item.formatTimer >= cusStartTime &&
-                item.formatTimer < cusEndTime
-              ) {
-                item.isServiceTime = true;
-              } else {
-                item.isServiceTime = false;
-              }
-            });
-          }
+
+          let spaceCustomContentList: any =
+            data[i].spaceCustomContentList || [];
+          spaceCustomContentList.map((spaceCustom: any) => {
+            let startTime: any = proxyData.parseCusStartTime(
+              spaceCustom.startTime
+            );
+            let endTime: any = proxyData.parseCusEndTime(spaceCustom.endTime);
+            // 是否在固定区域时间
+            if (startTime && endTime) {
+              // debugger
+              timerArr.map((item: any) => {
+                if (
+                  item.formatTimer >= startTime &&
+                  item.formatTimer < endTime
+                ) {
+                  item.isServiceTime = true;
+                }
+              });
+            }
+          });
 
           proxyData.dateArr.push({
             date: date,
             isActive: false,
+            equipmentList: data[i].equipmentList,
             oldDate: data[i].date,
             objectId: data[i].objectId,
             cusStartTime: data[i].cusStartTime,
             customSceneList: customSceneList,
             cusEndTime: data[i].cusEndTime,
+            spaceCustomContentList: data[i].spaceCustomContentList,
             day: getDate(new Date(date)),
             week: week,
             timerArr: timerArr,
@@ -752,8 +821,9 @@ export default defineComponent({
         proxyData.activeIndex = index;
         proxyData.nowTimerArr = proxyData.dateArr[index].timerArr;
         proxyData.nowData = proxyData.dateArr[index];
+        proxyData.formateEquipment();
         nextTick(() => {
-          proxyData.setOptionnalTime(proxyData.nowTimerArr);
+          proxyData.setNowBarPerstion(proxyData.nowTimerArr);
           let nowIndex: any = proxyData.getNowIndex();
           if (proxyData.nowData.week === "今天") {
             proxyData.setPastTime(nowIndex);
@@ -778,12 +848,6 @@ export default defineComponent({
         proxyData.setScreennWidth();
         proxyData.sliderSwiper();
         proxyData.endBoxSwiper();
-        // if (!proxyData.flag) {
-        //   proxyData.setScreennWidth();
-        //   proxyData.sliderSwiper();
-        //   proxyData.endBoxSwiper();
-        //   proxyData.flag = true;
-        // }
       },
       // 加班数据格式化=》后台需要的数据结构(添加加班逻辑)
       formateAddTimer() {
@@ -888,8 +952,10 @@ export default defineComponent({
       },
       // 格式化加班单个数据
       formaTimeObj(item: any, type: any, startTime: any, endTime: any) {
+        console.log(item);
         let obj: any = {
           projectId: proxyData.projectId, //类型:String  必有字段  备注:项目id
+          sceneEquipList: item ? item.sceneEquipList : [],
           objectId: proxyData.nowData.objectId, //类型:String  必有字段  备注:空间id
           sourceType: "sagacareAndtenantslink", //类型:String  必有字段  备注:sagacareAndtenantslink 来源
           startDate: proxyData.nowData.oldDate, //类型:String  必有字段  备注://开始日期
@@ -1034,12 +1100,48 @@ export default defineComponent({
         proxyData.formBtn = false;
         context.emit("closeWork");
       },
+      // 数组去除重复
+      removeDuplicateObj(arr: any) {
+        let obj = {};
+        arr = arr.reduce((newArr: any, next: any) => {
+          obj[next.objectId]
+            ? ""
+            : (obj[next.objectId] = true && newArr.push(next));
+          return newArr;
+        }, []);
+        return arr;
+      },
+      checkEquipment(item: any) {
+        item.isCheck = !item.isCheck;
+      },
       // 提交申请
       addWorkTimer() {
         let formTimerArr: any = proxyData.formateAddTimer();
-        proxyData.saveBatchCustomScene(formTimerArr);
-        // console.log("提交申请-----");
-        // console.log(formTimerArr);
+        let sceneEquipList: any = [];
+        proxyData.nowData.equipmentList.map((item: any) => {
+          if (item.isCheck) {
+            let obj: any = {
+              projectId: item.projectId, //类型:String  必有字段  备注:无
+              objectId: item.id, //类型:String  必有字段  备注:设备id
+              type: item.equipmentCategory,
+            };
+            sceneEquipList.push(obj);
+          }
+        });
+        formTimerArr.map((item: any) => {
+          if (item.type == "1") {
+            sceneEquipList.push(item.sceneEquipList);
+          }
+        });
+        sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
+        formTimerArr.map((item: any) => {
+          if (item.type == "0" || item.type == "2") {
+            item.sceneEquipList = sceneEquipList;
+          }
+        });
+        console.log("提交申请-----");
+        console.log(formTimerArr);
+        // proxyData.saveBatchCustomScene(formTimerArr);
       },
       // 提交加班记录
       saveBatchCustomScene(formTimerArr: any, type: any = 1) {
@@ -1057,7 +1159,6 @@ export default defineComponent({
             } else if (type === 2) {
               // 删除
               proxyData.isUpdate = true;
-              // proxyData.setWorkTimeList();
             }
             proxyData.formBtn = false;
           })
@@ -1092,7 +1193,7 @@ export default defineComponent({
       if (proxyData.isUpdate) {
         proxyData.setWorkTimeList();
       }
-      // proxyData.getWorkTimeList();
+      proxyData.enterType = newProps.enterType;
     });
     onMounted(() => {
       // 设置dom最外层的宽
@@ -1110,6 +1211,7 @@ export default defineComponent({
   position: relative;
   height: 100%;
   width: 100%;
+  overflow: hidden;
   background: #fff;
 }
 .work-space {
@@ -1124,8 +1226,8 @@ export default defineComponent({
     line-height: 31px;
     color: #000000;
   }
-  .device-tip {
-    padding-bottom: 36px;
+  .tip {
+    padding-bottom: 20px;
     font-family: "Noto Sans SC";
     font-style: normal;
     font-weight: 400;
@@ -1146,7 +1248,7 @@ export default defineComponent({
     display: flex;
     justify-content: space-between;
     width: 100%;
-    padding-bottom: 35px;
+    padding-bottom: 15px;
 
     .date-item {
       padding-top: 20px;
@@ -1295,9 +1397,12 @@ export default defineComponent({
   }
 }
 .add-time-btn {
-  margin-top: 10px;
+  position: absolute;
+  bottom: 5px;
+  left: 50%;
+  transform: translateX(-50%);
   display: flex;
-  padding-top: 24px;
+  padding-top: 10px;
   text-align: center;
 
   .cancel-btn {
@@ -1331,4 +1436,81 @@ export default defineComponent({
     color: #1f2529;
   }
 }
+
+.work-device {
+  // padding-top: 10px;
+  height: 30vh;
+  overflow-y: auto;
+  .device-tip {
+    padding-top: 20px;
+    font-weight: 400;
+    font-size: 12px;
+
+    color: #8d9399;
+    span {
+      display: inline-block;
+      padding-bottom: 10px;
+    }
+    p {
+      line-height: 24px;
+    }
+  }
+}
+.device-box {
+  display: flex;
+  justify-content: space-between;
+
+  .device-row {
+    display: flex;
+    justify-content: space-between;
+    width: 48%;
+    font-family: "PingFang SC";
+    font-style: normal;
+    font-weight: 400;
+    font-size: 14px;
+    padding: 10px;
+    color: #1b2129;
+    background: #f7f9fa;
+    border-radius: 4px;
+    margin-top: 10px;
+    line-height: 30px;
+    span {
+      display: inline-block;
+    }
+    img {
+      width: 30px;
+      height: 30px;
+    }
+  }
+}
+
+.row-title {
+  display: block;
+  padding-top: 20px;
+  padding-bottom: 5px;
+}
+.device-title {
+  padding-top: 20px;
+  text-align: center;
+  // padding-bottom: 10px;
+  .line {
+    display: inline-block;
+    vertical-align: middle;
+    width: 155px;
+    height: 0px;
+    border: 1px solid #e1e5eb;
+  }
+  .text {
+    display: inline-block;
+    vertical-align: middle;
+    padding-left: 10px;
+    padding-right: 10px;
+    font-family: "PingFang SC";
+    font-style: normal;
+    font-weight: 400;
+    font-size: 12px;
+    line-height: 17px;
+    color: #8d9399;
+  }
+}
 </style>

+ 1 - 0
src/views/envmonitor/components/Map/MapBox.vue

@@ -1223,6 +1223,7 @@ export default defineComponent({
     }
     .device span {
       color: #fff !important;
+      font-size:16px;
     }
   }
 

+ 1 - 3
src/views/envmonitor/components/Map/SpaceBox.vue

@@ -137,9 +137,6 @@ export default defineComponent({
   height: 100%;
   background: $elBg;
   .space-box {
-    // display: flex;
-    // padding-top: 20px;
-    // justify-content: space-between;
     .space-item {
       display: inline-block;
       margin-top: 20px;
@@ -154,6 +151,7 @@ export default defineComponent({
         width: 100%;
         line-height: 100px;
         text-align: center;
+        font-size:16px;
       }
       &:nth-child(3n) {
         margin-right: 0;

+ 52 - 13
src/views/envmonitor/index.vue

@@ -10,12 +10,13 @@
     }"
   >
     <div class="main-left">
-      <div class="left-top" 
-          @touchstart="gtouchstart($event)"
-          @touchmove="gtouchmove()"
-          @touchend="showDeleteButton">
-        <div
-          class="logo-box">
+      <div
+        class="left-top"
+        @touchstart="gtouchstart($event)"
+        @touchmove="gtouchmove()"
+        @touchend="showDeleteButton"
+      >
+        <div class="logo-box">
           <img class="logo-icon" v-if="logImg" :src="logImg" alt="" />
           <img
             class="logo-icon"
@@ -136,7 +137,7 @@
       <div
         class="work-btn"
         v-if="
-          (roomType === '开放' && isWork && controlMode !== 1) ||
+          (roomType === '开放' && isWork) ||
           (roomType === '会议室' && scenarioArr && scenarioArr.length)
         "
       >
@@ -150,13 +151,13 @@
         ></work-config>
 
         <!--手动控制的加班 start-->
-        <!-- <manual-work
+        <manual-config
           v-if="roomType === '开放' && isWork && controlMode === 1"
           :scenarioArr="scenarioArr"
           :workkArr="workkArr"
           @triggerWork="triggerWork"
           @setForceOverTimeFlag="setForceOverTimeFlag"
-        ></manual-work> -->
+        ></manual-config>
 
         <scenario-config
           v-if="roomType === '会议室' && scenarioArr && scenarioArr.length"
@@ -172,6 +173,7 @@
       <manual-index
         v-if="controlMode === 1"
         @triggerWork="triggerWork"
+        :enterType="1"
         :forceOverTimeFlag="forceOverTimeFlag"
         @updateAirTemp="updateAirTemp"
         :hasAir="spaceExistenceDevice.airConditioner"
@@ -314,7 +316,7 @@ import WorkOvertime from "./components/workOvertime/index.vue";
 import ManualOvertime from "./components/ManualWork/index.vue";
 import Contact from "./components/Contact/index.vue";
 import WorkConfig from "./components/workOvertime/WorkConfig.vue";
-import ManualWork from "./components/ManualWork/WorkConfig.vue";
+import ManualConfig from "./components/ManualWork/WorkConfig.vue";
 import ScenarioConfig from "./components/Scenario/ScenarioConfig.vue";
 import MapBox from "@/views/envmonitor/components/Map/MapBox.vue";
 import Header from "@/components/header/Index.vue";
@@ -354,6 +356,7 @@ import {
   getHours,
   getLocalNewSpaceInfo,
   getNowWeek,
+  getRelNowTime,
   getUserInfo,
   parseImgUrl,
   setQueryConfig,
@@ -379,7 +382,7 @@ export default defineComponent({
     TimeBox,
     WorkOvertime,
     WorkConfig,
-    ManualWork,
+    ManualConfig,
     ScenarioConfig,
     Detail,
     Contact,
@@ -568,6 +571,7 @@ export default defineComponent({
     let padImgData: any = [];
     let controlMode: number = 0;
     const proxyData = reactive({
+      enterType: 1,
       parseImgUrl: parseImgUrl,
       fileUrl: proxyGlobal.proxy.$fileUrl,
       nowDate: nowDate,
@@ -825,8 +829,9 @@ export default defineComponent({
       /**
        * 加班
        */
-      triggerWork() {
+      triggerWork(type: any = 1) {
         proxyData.isShowWork = true;
+        proxyData.enterType = type;
       },
       /**
        * 关闭加班
@@ -1642,6 +1647,7 @@ export default defineComponent({
        */
       workkArr: workkArr,
       secenTimer: secenTimer,
+      // 定时查空间的加班记录
       queryCustomAndScenceTimer(timer: any = 10000) {
         if (proxyData.secenTimer) {
           clearTimeout(proxyData.secenTimer);
@@ -1651,6 +1657,7 @@ export default defineComponent({
           proxyData.queryCustomAndScence();
         }, timer);
       },
+      // 定时查空间的加班记录
       queryCustomAndScence() {
         let params: any = {
           spaceId: proxyData.spaceInfo.spaceId,
@@ -1664,10 +1671,42 @@ export default defineComponent({
               proxyData.workkArr[i]?.customSceneList ?? [];
             customSceneList = customSceneList.sort(proxyData.compare);
           }
+          // 手动控制的情况下走新的服务定制
+          if (proxyData.controlMode === 1) {
+            proxyData.formateManualWorkTime();
+          }
 
           proxyData.queryCustomAndScenceTimer(5000);
         });
       },
+      // 手动控制加班处理时间段拼接的逻辑
+      formateManualWorkTime() {
+        for (let i = 0; i < proxyData.workkArr.length; i++) {
+          let item: any = proxyData.workkArr[i];
+          item.cusStartTime = "";
+          item.cusEndTime = "";
+          let spaceCustomContentList: any =
+            proxyData.workkArr[i].spaceCustomContentList || [];
+          let nowTime: any = getRelNowTime();
+          for (let j = 0; j < spaceCustomContentList.length; j++) {
+            if (item.cusStartTime && item.cusEndTime) {
+              if (item.cusEndTime + 1 === spaceCustomContentList[j].startTime) {
+                item.cusEndTime = spaceCustomContentList[j].endTime;
+              }
+            } else {
+              if (
+                nowTime >= spaceCustomContentList[j].startTime &&
+                nowTime <= spaceCustomContentList[j].endTime
+              ) {
+                item.cusStartTime = spaceCustomContentList[j].startTime;
+                item.cusEndTime = spaceCustomContentList[j].endTime;
+              }
+            }
+          }
+          console.log("proxyData.workkArr===");
+          console.log(proxyData.workkArr);
+        }
+      },
       // 数组排序
       compare(obj1: any, obj2: any) {
         var val1 = obj1.startTime;
@@ -2219,7 +2258,7 @@ export default defineComponent({
       position: relative;
       display: inline-block;
       vertical-align: middle;
-      width: 195px;
+      width: 186px;
       height: 40px;
       font-size: 0;
       img {

+ 6 - 2
src/views/mapData/indexOld.vue

@@ -6,6 +6,7 @@
         class="file-upload-input"
         id="upfile"
         type="file"
+        webkitdirectory
         @change="getFile"
       />
     </div>
@@ -77,7 +78,9 @@ export default defineComponent({
       },
       getFile(e: any) {
         console.log(e.target.files);
-        let fileSelect: any = e.target.files[0];
+        let files:any=e.target.files
+        for(let i=0;i<files.length;i++){
+        let fileSelect: any = files[i]
         let name: any = fileSelect.name;
         name = name.split(".")[0];
         // this.fileName = fileSelect.name;
@@ -97,6 +100,8 @@ export default defineComponent({
           // proxyData.handleStr(result);
           proxyData.handPoint(result, name);
         };
+        }
+        
       },
       handPoint(result: any, name: any) {
         result = result.replace(/\"/g, "");
@@ -187,7 +192,6 @@ export default defineComponent({
           divobj.top = proxyData.getNum(item, "TOP");
           let title: any = proxyData.getNum(item, "title");
           let titleArr: any = title.split("-");
-          console.log(titleArr);
           divobj.spaceId = titleArr[0];
           divobj.order = titleArr[1] * 1;
           if (titleArr[2] && titleArr[2] === "c") {

+ 2 - 1
vue.config.js

@@ -108,7 +108,8 @@ module.exports = {
       },
       '/sgipad/test/': {
         // target: 'https://duoduoenv.sagacloud.cn',
-        target: 'http://192.168.0.13:52009',
+        // target: 'http://192.168.0.13:52009',
+        target: 'http://192.168.4.54:58002',
         changeOrigin: true,
         pathRewrite: {
           '^/sgipad/test': ''