Browse Source

fix:加班的bug解决

chenzhen2 1 year ago
parent
commit
1a9956f9e8
1 changed files with 15 additions and 16 deletions
  1. 15 16
      src/views/envmonitor/components/ManualWork/index.vue

+ 15 - 16
src/views/envmonitor/components/ManualWork/index.vue

@@ -1243,7 +1243,7 @@ export default defineComponent({
       },
       //  加班数据格式化=》后台需要的数据结构(删除加班逻辑)
       formateDelTimer() {
-        // debugger;
+        debugger;
         let timerArr: any = proxyData.nowData.timerArr;
         let endIndex: any = proxyData.endIndex > 0 ? proxyData.endIndex - 1 : 0;
         // debugger
@@ -1258,7 +1258,7 @@ export default defineComponent({
           let delTimerArr: any = [];
           let addTimeArr: any = [];
           let flag = false;
-          debugger;
+          // debugger;
           for (let i = 0; i < customSceneList.length; i++) {
             let item: any = customSceneList[i];
             if (item.startTime === startTime && item.endTime === endTime) {
@@ -1578,25 +1578,24 @@ export default defineComponent({
             .then(() => {
               let sceneEquipList: any = [];
               formTimeArr.map((item: any) => {
-                if (item.type == "1") {
-                  if (item.sceneEquipList) {
-                    item.sceneEquipList.map((scene: any) => {
-                      let obj: any = {
-                        projectId: scene.projectId, //类型:String  必有字段  备注:无
-                        objectId: scene.objectId, //类型:String  必有字段  备注:设备id
-                        type: scene.type,
-                      };
-                      sceneEquipList.push(obj);
-                    });
-                  }
+                if (item.sceneEquipList && item.sceneEquipList.length) {
+                  item.sceneEquipList.map((scene: any) => {
+                    let obj: any = {
+                      projectId: scene.projectId, //类型:String  必有字段  备注:无
+                      objectId: scene.objectId, //类型:String  必有字段  备注:设备id
+                      type: scene.type,
+                    };
+                    sceneEquipList.push(obj);
+                  });
                 }
               });
               sceneEquipList = proxyData.removeDuplicateObj(sceneEquipList);
 
               formTimeArr.map((item: any) => {
-                if (item.type !== "1") {
-                  item.sceneEquipList = sceneEquipList;
-                }
+                // if (item.type !== "1") {
+                //   item.sceneEquipList = sceneEquipList;
+                // }
+                item.sceneEquipList = sceneEquipList;
               });
 
               proxyData.saveBatchCustomScene(formTimeArr, 2);