Browse Source

fix: 加班展示记录处理

chenzhen2 2 years ago
parent
commit
f0aac616e7
2 changed files with 15 additions and 6 deletions
  1. 13 6
      src/utils/index.ts
  2. 2 0
      src/views/envmonitor/components/workOvertime/WorkConfig.vue

+ 13 - 6
src/utils/index.ts

@@ -571,12 +571,18 @@ export const formateTimeContinuous: any = function (index: any = 1,
           endTime = cusEndTime;
         }
       });
-    }
-    if (text) {
-      let nowIndex: any = index + 1;
-      that.text = text
-      if (nowIndex < data.length - 1) {
-        return formateTimeContinuous(nowIndex, startTime, endTime, 1, data, that);
+      if (text) {
+        let nowIndex: any = index + 1;
+        that.text = text
+        if (nowIndex < data.length - 1) {
+          return formateTimeContinuous(nowIndex, startTime, endTime, 1, data, that);
+        } else {
+          return {
+            text: that.text,
+            startTime: startTime,
+            endTime: endTime,
+          };
+        }
       } else {
         return {
           text: that.text,
@@ -591,6 +597,7 @@ export const formateTimeContinuous: any = function (index: any = 1,
         endTime: endTime,
       };
     }
+
   } else {
     // 预约时候后找最近的一段预约时间
     // let cusStartTime: any = data[index].cusStartTime;

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

@@ -279,6 +279,7 @@ export default defineComponent({
                 /**
                  * 需要补加上和未来时间连续的问题
                  */
+                
                 let btnObj: any = proxyData.formateTimeContinuous(
                   1,
                   startTime,
@@ -342,6 +343,7 @@ export default defineComponent({
                     endTime,
                     1
                   );
+                  // debugger
                   proxyData.timerText.text = `工作时间`;
                   proxyData.timerText.timer =
                     formatTimerStr(startTime) + "~" + formatTimerStr(endTime);