Browse Source

教室点名功能完善

master
yxq 2 months ago
parent
commit
2ee8154874
1 changed files with 15 additions and 17 deletions
  1. +15
    -17
      SafeCampus.WEB/src/views/attendance/roolcall/detail.vue

+ 15
- 17
SafeCampus.WEB/src/views/attendance/roolcall/detail.vue View File

@@ -8,7 +8,7 @@
><el-text class="mx-1" type="primary" size="large">应到:{{ listData.length }}人</el-text></el-col ><el-text class="mx-1" type="primary" size="large">应到:{{ listData.length }}人</el-text></el-col
> >
<el-col :span="6" <el-col :span="6"
><el-text class="mx-1" type="success" size="large">实到:{{ HighlightData.length }}人</el-text>
><el-text class="mx-1" type="success" size="large">实到:{{ listData.length - UnRollCallData.length }}人</el-text>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-text class="mx-1" type="warning" size="large">趴桌子:{{ LieOnTable.length }}人</el-text></el-col <el-text class="mx-1" type="warning" size="large">趴桌子:{{ LieOnTable.length }}人</el-text></el-col
@@ -22,7 +22,7 @@
><el-row class="rowbg"> ><el-row class="rowbg">
<el-col :xl="3" :lg="4" :md="6" :sm="8" :xs="12" v-for="(item, index) in listData" :key="index" <el-col :xl="3" :lg="4" :md="6" :sm="8" :xs="12" v-for="(item, index) in listData" :key="index"
><div class="grid-content"> ><div class="grid-content">
<div class="imgBox" :class="{ active: item.status === 1 ? true : false }">
<div class="imgBox" :class="{ active: item.alarmTypes?.includes('class_room_call') }">
<el-image <el-image
v-if="item.faces && item.faces.length > 0" v-if="item.faces && item.faces.length > 0"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
@@ -42,7 +42,7 @@
{{ item.personSetName }} {{ item.personSetName }}
</div> </div>
</div> </div>
<div v-if="item.status !== 1" class="btn btns" style="justify-content: center; border-top: none">
<div v-if="!item.alarmTypes?.includes('class_room_call')" class="btn btns" style="justify-content: center; border-top: none">
<el-button size="small" type="primary" @click="checkOut(item, index)">签到</el-button> <el-button size="small" type="primary" @click="checkOut(item, index)">签到</el-button>
</div> </div>
</div></el-col </div></el-col
@@ -125,24 +125,21 @@ const Highlight = () => {
}) })
.then((res: any) => { .then((res: any) => {
HighlightData.value = res.data.list; 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); 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); 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); UnrecognizedD.value = UnrecognizedD.value.filter((item1: any) => item1.id !== item.id);
listData.value.map((item2: any) => { listData.value.map((item2: any) => {
if (item2.personId === item.personId) { 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"));
} }
}); });
}); });


Loading…
Cancel
Save