-
+
-
{
})
.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"));
}
});
});