|
@@ -93,6 +93,7 @@ const Runtime: React.FC = () => {
|
|
resList.forEach((ritem) => {
|
|
resList.forEach((ritem) => {
|
|
ritem.runTimeStatus = 'normalRun'; //正常工作
|
|
ritem.runTimeStatus = 'normalRun'; //正常工作
|
|
var timeList = [];
|
|
var timeList = [];
|
|
|
|
+
|
|
if (ritem.hasOwnProperty('workTimeStartTime')) {
|
|
if (ritem.hasOwnProperty('workTimeStartTime')) {
|
|
var timeStrArr = [ritem.workTimeStartTime, ritem.workTimeEndTime];
|
|
var timeStrArr = [ritem.workTimeStartTime, ritem.workTimeEndTime];
|
|
timeList.push(timeStrArr);
|
|
timeList.push(timeStrArr);
|
|
@@ -110,9 +111,17 @@ const Runtime: React.FC = () => {
|
|
ritem.runTimeStatus = 'overtimeWork'; //加班
|
|
ritem.runTimeStatus = 'overtimeWork'; //加班
|
|
}
|
|
}
|
|
ritem.showTimeList = timeList;
|
|
ritem.showTimeList = timeList;
|
|
|
|
+ console.log('timeList', timeList);
|
|
ritem.showTimeStr =
|
|
ritem.showTimeStr =
|
|
- timeList.length > 0 ? timeList[0][0] + '-' + timeList[timeList.length - 1][1] : '';
|
|
|
|
|
|
+ timeList.length > 0
|
|
|
|
+ ? timeList[0][0] +
|
|
|
|
+ '-' +
|
|
|
|
+ (timeList[timeList.length - 1][1] > timeList[0][1]
|
|
|
|
+ ? timeList[timeList.length - 1][1]
|
|
|
|
+ : timeList[0][1])
|
|
|
|
+ : '';
|
|
});
|
|
});
|
|
|
|
+
|
|
setSpaceTimeList(resList);
|
|
setSpaceTimeList(resList);
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|
|
@@ -135,6 +144,10 @@ const Runtime: React.FC = () => {
|
|
setTimer.current = setInterval(() => {
|
|
setTimer.current = setInterval(() => {
|
|
getDeviceTime();
|
|
getDeviceTime();
|
|
}, 10000);
|
|
}, 10000);
|
|
|
|
+
|
|
|
|
+ return () => {
|
|
|
|
+ clearInterval(setTimer.current);
|
|
|
|
+ };
|
|
}
|
|
}
|
|
}, [selFloorId, selTime]);
|
|
}, [selFloorId, selTime]);
|
|
|
|
|