diff --git a/SafeCampus.WEB/src/views/attendance/roolcall/detail.vue b/SafeCampus.WEB/src/views/attendance/roolcall/detail.vue index 8fe2a9e..ef3d200 100644 --- a/SafeCampus.WEB/src/views/attendance/roolcall/detail.vue +++ b/SafeCampus.WEB/src/views/attendance/roolcall/detail.vue @@ -8,7 +8,7 @@ >应到:{{ listData.length }}人 实到:{{ HighlightData.length }}人 + >实到:{{ listData.length - UnRollCallData.length }}人 趴桌子:{{ LieOnTable.length }}人
-
+
-
+
签到
{ }) .then((res: any) => { HighlightData.value = res.data.list; - listData.value - .map((item: any) => { - item.status = 0; - return item; - }) - .forEach((item: any) => { - HighlightData.value.forEach((item1: any) => { - if (item.personId === item1.personId) { - item.status = 1; - } - }); + listData.value = listData.value.map((e: any) => { + e.alarmTypes = []; + // alarmType:lie_on_table 趴桌子 class_room_call 点名(实到) + let arr = HighlightData.value.filter((e1: any) => { + return e1.personId == e.personId; }); + e.alarmTypes = arr.map((e: any) => e.alarmType); + return e; + }); // 未点名人员摘取 - UnRollCallData.value = JSON.parse(JSON.stringify(listData.value)).filter((item: any) => item.status == 0); + UnRollCallData.value = JSON.parse(JSON.stringify(listData.value)).filter((item: any) => !item.alarmTypes.includes("class_room_call")); // 未识别人员摘取 UnrecognizedD.value = JSON.parse(JSON.stringify(HighlightData.value)).filter((item: any) => !item.personId); // 趴桌子人员摘取 - LieOnTable.value = JSON.parse(JSON.stringify(HighlightData.value)).filter((item: any) => item.alarmType == "lie_on_table"); + LieOnTable.value = JSON.parse(JSON.stringify(listData.value)).filter((item: any) => item.alarmTypes.includes("lie_on_table")); console.log("未识别人员摘取:", UnrecognizedD.value, ",趴桌子人员摘取:", LieOnTable.value, ",未点名人员摘取:", UnRollCallData.value); }); @@ -163,7 +160,8 @@ const checkOut = (item: any, index: number) => { UnrecognizedD.value = UnrecognizedD.value.filter((item1: any) => item1.id !== item.id); listData.value.map((item2: any) => { if (item2.personId === item.personId) { - item2.status = 1; + item2.alarmTypes.push("class_room_call"); + UnRollCallData.value = JSON.parse(JSON.stringify(listData.value)).filter((item: any) => !item.alarmTypes.includes("class_room_call")); } }); });