|
|
@@ -1,21 +1,30 @@ |
|
|
|
<!-- |
|
|
|
* @Description: 人脸识别失败表格 |
|
|
|
* @Description: 未归寝 |
|
|
|
* @Author: yxq |
|
|
|
* @Date: 2023-12-15 15:45:59 |
|
|
|
--> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<form-container v-model="visible" row-key="id" :title="`${propsInfo.record.qinshibianhao}归寝确认`" form-size="800px" @close="onClose"> |
|
|
|
<ProTable ref="noFaceTableRef" title="归寝确认" height="500px" :data="tableData" :columns="columns"> |
|
|
|
<form-container v-model="visible" row-key="id" :title="`寝室${propsInfo.record.name}归寝确认`" form-size="800px" @close="onClose"> |
|
|
|
<ProTable |
|
|
|
ref="noReturnTableRef" |
|
|
|
:request-auto="false" |
|
|
|
title="归寝确认" |
|
|
|
height="500px" |
|
|
|
:pagination="false" |
|
|
|
:columns="columns" |
|
|
|
:request-api="userManageDormitoryApi.returnDetail" |
|
|
|
:data-callback="dataCallback" |
|
|
|
> |
|
|
|
<!-- 表格 header 按钮 --> |
|
|
|
<template #tableHeader="scope"> |
|
|
|
<s-button |
|
|
|
type="primary" |
|
|
|
:disabled="!scope.isSelected" |
|
|
|
icon="check" |
|
|
|
prefix="人工" |
|
|
|
suffix="确认" |
|
|
|
@click="personConfirm(scope.selectedListIds, '确认已归寝')" |
|
|
|
prefix="确认" |
|
|
|
suffix="归寝" |
|
|
|
@click="personConfirm(scope.selectedList, '确认已归寝')" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</ProTable> |
|
|
@@ -26,118 +35,39 @@ |
|
|
|
<!-- 预览头像 --> |
|
|
|
<el-dialog v-model="imgVisible" title="查看头像" width="830px"> |
|
|
|
<div style="display: flex; align-items: center; justify-content: center"> |
|
|
|
<img class="detailpic" :src="faceUrl" alt="" /> |
|
|
|
<img class="detailpic" :src="'/api/' + faceUrl" alt="" /> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="tsx" name="attendanceStudentsReturn"> |
|
|
|
import { AttendanceStudentsReturn, attendanceStudentsReturn } from "@/api"; |
|
|
|
import { ColumnProps, noFaceTableInstance } from "@/components/noFaceTableRef/interface"; |
|
|
|
import { userManageDormitoryApi,attendanceApi } from "@/api"; |
|
|
|
import { ColumnProps,ProTableInstance } from "@/components/ProTable/interface"; |
|
|
|
import { FormOptEnum } from "@/enums"; |
|
|
|
import { useHandleData } from "@/hooks"; |
|
|
|
import { formatDate } from "@/utils"; |
|
|
|
|
|
|
|
const visible = ref(false); //是否显示 |
|
|
|
// 弹框参数 |
|
|
|
const propsInfo = reactive<FormProps.Base<AttendanceStudentsReturn.PassengerInfo>>({ |
|
|
|
const propsInfo = reactive<FormProps.Base<{}>>({ |
|
|
|
opt: FormOptEnum.VIEW, //操作类型 |
|
|
|
record: {}, //弹框数据 |
|
|
|
disabled: false |
|
|
|
}); |
|
|
|
/** |
|
|
|
* 打开弹框 |
|
|
|
* @param props 弹框参数 |
|
|
|
*/ |
|
|
|
function onOpen(props: FormProps.Base<AttendanceStudentsReturn.PassengerInfo>) { |
|
|
|
Object.assign(propsInfo, props); //合并参数 |
|
|
|
visible.value = true; //显示弹框 |
|
|
|
if (props.record.id) { |
|
|
|
//如果传了id,就去请求api获取record |
|
|
|
attendanceStudentsReturn.detail({ id: props.record.id }).then(res => { |
|
|
|
propsInfo.record = res.data; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const tableData = ref([ |
|
|
|
{ |
|
|
|
id:'1', |
|
|
|
studentname: "张三", |
|
|
|
faces: [ |
|
|
|
{ |
|
|
|
faceUrl: |
|
|
|
"http://deepvision.oss-cn-zhangjiakou.aliyuncs.com/dfield-cruising/online/person-set/quanjiang/DEMO00001/8746a847ecd64c1696b37f4cdf617a18/5dc35e4c7af84b3fb5aab70156574873.jpg?Expires=1721375257&OSSAccessKeyId=STS.NTfeBHwzU7kivsSS2EypREace&Signature=c1aTbDc1hNISq%2BV05o0slEfoCTI%3D&security-token=CAIS0wN1q6Ft5B2yfSjIr5fTLvj8mqV0gKmCdFXitzIQdf9%2BqqTIhzz2IHFMf3huCeodsv8%2BlGxS5%2FgelrpqVpZDR03Na8RHwrly1lv5O9KY4x49TRng0s%2FLI3OaLjKm9hi7AYygPgK0GJqEb1TDiVUto9%2FTfimjWFqIKICAjYUdAP0cQgi%2Fa0gwZrJRPRAwh8IGEnHTOP2xUHvtmXGCNFd0nQB%2BhGhjk7TdpPeR8R3Dllb35%2FYIroDqWPieYtJrIY10XqWBvqx%2FfbGT1zVLuVoYtvV6gaFc5zbcv9abRFVf4hiCP6%2Ff6MBuNw5%2Fae94efZNp%2BOukuZj6K6B1db7xhtVI%2BBOUiPZA4mr2IzdBeqvNNcwc7m8F1no9YjXbsGs9EEGGStLaVgVI4F8dyAhWEd9FWjgR%2FX5qAyQUGCKULOY1aw6651xwmjz8MCCT1r1GOTBindGasVnMxh5Z0JMjDK9aNkKfgFUbVJ8BrGTCIh%2FYx0bsq7yowDIEyp71TRMo%2Bbu%2FDBhIifKpO4VN7AxMup1DPwu2wNCxORK3yyybb5sa3aTR6942p%2F%2FF5VxFNPqOx1rmCMf4znuW4yrvNkAVvNcuIqdR8aLhaLIEbHzoKxuEKRnrfsIeBqAAUB%2FCKIuI1UaCj4LYX8DyIYOI8tUKFsMguPHpPENaK9Lcz5ZhB%2BrX6BcQfNWOLhDx7KyRE28vtEs2uolAhLTRaZsZFjbAZE5Ngt09%2FbSXdD%2FR%2BOlGMpQdp752x5lOlvPsJp1skuFLbramyqY4oj4tVwv1OLWpcsEc3AEosPalpAuIAA%3D" |
|
|
|
}, |
|
|
|
], |
|
|
|
louceng:'3', |
|
|
|
qinshi:'301', |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:'2', |
|
|
|
studentname: "李四", |
|
|
|
faces: [ |
|
|
|
{ |
|
|
|
faceUrl: |
|
|
|
"http://deepvision.oss-cn-zhangjiakou.aliyuncs.com/dfield-cruising/online/person-set/quanjiang/DEMO00001/8746a847ecd64c1696b37f4cdf617a18/5dc35e4c7af84b3fb5aab70156574873.jpg?Expires=1721375257&OSSAccessKeyId=STS.NTfeBHwzU7kivsSS2EypREace&Signature=c1aTbDc1hNISq%2BV05o0slEfoCTI%3D&security-token=CAIS0wN1q6Ft5B2yfSjIr5fTLvj8mqV0gKmCdFXitzIQdf9%2BqqTIhzz2IHFMf3huCeodsv8%2BlGxS5%2FgelrpqVpZDR03Na8RHwrly1lv5O9KY4x49TRng0s%2FLI3OaLjKm9hi7AYygPgK0GJqEb1TDiVUto9%2FTfimjWFqIKICAjYUdAP0cQgi%2Fa0gwZrJRPRAwh8IGEnHTOP2xUHvtmXGCNFd0nQB%2BhGhjk7TdpPeR8R3Dllb35%2FYIroDqWPieYtJrIY10XqWBvqx%2FfbGT1zVLuVoYtvV6gaFc5zbcv9abRFVf4hiCP6%2Ff6MBuNw5%2Fae94efZNp%2BOukuZj6K6B1db7xhtVI%2BBOUiPZA4mr2IzdBeqvNNcwc7m8F1no9YjXbsGs9EEGGStLaVgVI4F8dyAhWEd9FWjgR%2FX5qAyQUGCKULOY1aw6651xwmjz8MCCT1r1GOTBindGasVnMxh5Z0JMjDK9aNkKfgFUbVJ8BrGTCIh%2FYx0bsq7yowDIEyp71TRMo%2Bbu%2FDBhIifKpO4VN7AxMup1DPwu2wNCxORK3yyybb5sa3aTR6942p%2F%2FF5VxFNPqOx1rmCMf4znuW4yrvNkAVvNcuIqdR8aLhaLIEbHzoKxuEKRnrfsIeBqAAUB%2FCKIuI1UaCj4LYX8DyIYOI8tUKFsMguPHpPENaK9Lcz5ZhB%2BrX6BcQfNWOLhDx7KyRE28vtEs2uolAhLTRaZsZFjbAZE5Ngt09%2FbSXdD%2FR%2BOlGMpQdp752x5lOlvPsJp1skuFLbramyqY4oj4tVwv1OLWpcsEc3AEosPalpAuIAA%3D" |
|
|
|
}, |
|
|
|
], |
|
|
|
louceng:'3', |
|
|
|
qinshi:'302', |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:'3', |
|
|
|
studentname: "张三", |
|
|
|
faces: [ |
|
|
|
{ |
|
|
|
faceUrl: |
|
|
|
"http://deepvision.oss-cn-zhangjiakou.aliyuncs.com/dfield-cruising/online/person-set/quanjiang/DEMO00001/8746a847ecd64c1696b37f4cdf617a18/5dc35e4c7af84b3fb5aab70156574873.jpg?Expires=1721375257&OSSAccessKeyId=STS.NTfeBHwzU7kivsSS2EypREace&Signature=c1aTbDc1hNISq%2BV05o0slEfoCTI%3D&security-token=CAIS0wN1q6Ft5B2yfSjIr5fTLvj8mqV0gKmCdFXitzIQdf9%2BqqTIhzz2IHFMf3huCeodsv8%2BlGxS5%2FgelrpqVpZDR03Na8RHwrly1lv5O9KY4x49TRng0s%2FLI3OaLjKm9hi7AYygPgK0GJqEb1TDiVUto9%2FTfimjWFqIKICAjYUdAP0cQgi%2Fa0gwZrJRPRAwh8IGEnHTOP2xUHvtmXGCNFd0nQB%2BhGhjk7TdpPeR8R3Dllb35%2FYIroDqWPieYtJrIY10XqWBvqx%2FfbGT1zVLuVoYtvV6gaFc5zbcv9abRFVf4hiCP6%2Ff6MBuNw5%2Fae94efZNp%2BOukuZj6K6B1db7xhtVI%2BBOUiPZA4mr2IzdBeqvNNcwc7m8F1no9YjXbsGs9EEGGStLaVgVI4F8dyAhWEd9FWjgR%2FX5qAyQUGCKULOY1aw6651xwmjz8MCCT1r1GOTBindGasVnMxh5Z0JMjDK9aNkKfgFUbVJ8BrGTCIh%2FYx0bsq7yowDIEyp71TRMo%2Bbu%2FDBhIifKpO4VN7AxMup1DPwu2wNCxORK3yyybb5sa3aTR6942p%2F%2FF5VxFNPqOx1rmCMf4znuW4yrvNkAVvNcuIqdR8aLhaLIEbHzoKxuEKRnrfsIeBqAAUB%2FCKIuI1UaCj4LYX8DyIYOI8tUKFsMguPHpPENaK9Lcz5ZhB%2BrX6BcQfNWOLhDx7KyRE28vtEs2uolAhLTRaZsZFjbAZE5Ngt09%2FbSXdD%2FR%2BOlGMpQdp752x5lOlvPsJp1skuFLbramyqY4oj4tVwv1OLWpcsEc3AEosPalpAuIAA%3D" |
|
|
|
}, |
|
|
|
], |
|
|
|
louceng:'4', |
|
|
|
qinshi:'401', |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:'4', |
|
|
|
studentname: "李四", |
|
|
|
faces: [ |
|
|
|
{ |
|
|
|
faceUrl: |
|
|
|
"http://deepvision.oss-cn-zhangjiakou.aliyuncs.com/dfield-cruising/online/person-set/quanjiang/DEMO00001/8746a847ecd64c1696b37f4cdf617a18/5dc35e4c7af84b3fb5aab70156574873.jpg?Expires=1721375257&OSSAccessKeyId=STS.NTfeBHwzU7kivsSS2EypREace&Signature=c1aTbDc1hNISq%2BV05o0slEfoCTI%3D&security-token=CAIS0wN1q6Ft5B2yfSjIr5fTLvj8mqV0gKmCdFXitzIQdf9%2BqqTIhzz2IHFMf3huCeodsv8%2BlGxS5%2FgelrpqVpZDR03Na8RHwrly1lv5O9KY4x49TRng0s%2FLI3OaLjKm9hi7AYygPgK0GJqEb1TDiVUto9%2FTfimjWFqIKICAjYUdAP0cQgi%2Fa0gwZrJRPRAwh8IGEnHTOP2xUHvtmXGCNFd0nQB%2BhGhjk7TdpPeR8R3Dllb35%2FYIroDqWPieYtJrIY10XqWBvqx%2FfbGT1zVLuVoYtvV6gaFc5zbcv9abRFVf4hiCP6%2Ff6MBuNw5%2Fae94efZNp%2BOukuZj6K6B1db7xhtVI%2BBOUiPZA4mr2IzdBeqvNNcwc7m8F1no9YjXbsGs9EEGGStLaVgVI4F8dyAhWEd9FWjgR%2FX5qAyQUGCKULOY1aw6651xwmjz8MCCT1r1GOTBindGasVnMxh5Z0JMjDK9aNkKfgFUbVJ8BrGTCIh%2FYx0bsq7yowDIEyp71TRMo%2Bbu%2FDBhIifKpO4VN7AxMup1DPwu2wNCxORK3yyybb5sa3aTR6942p%2F%2FF5VxFNPqOx1rmCMf4znuW4yrvNkAVvNcuIqdR8aLhaLIEbHzoKxuEKRnrfsIeBqAAUB%2FCKIuI1UaCj4LYX8DyIYOI8tUKFsMguPHpPENaK9Lcz5ZhB%2BrX6BcQfNWOLhDx7KyRE28vtEs2uolAhLTRaZsZFjbAZE5Ngt09%2FbSXdD%2FR%2BOlGMpQdp752x5lOlvPsJp1skuFLbramyqY4oj4tVwv1OLWpcsEc3AEosPalpAuIAA%3D" |
|
|
|
}, |
|
|
|
], |
|
|
|
louceng:'3', |
|
|
|
qinshi:'301', |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:'5', |
|
|
|
studentname: "张三", |
|
|
|
faces: [ |
|
|
|
{ |
|
|
|
faceUrl: |
|
|
|
"http://deepvision.oss-cn-zhangjiakou.aliyuncs.com/dfield-cruising/online/person-set/quanjiang/DEMO00001/8746a847ecd64c1696b37f4cdf617a18/5dc35e4c7af84b3fb5aab70156574873.jpg?Expires=1721375257&OSSAccessKeyId=STS.NTfeBHwzU7kivsSS2EypREace&Signature=c1aTbDc1hNISq%2BV05o0slEfoCTI%3D&security-token=CAIS0wN1q6Ft5B2yfSjIr5fTLvj8mqV0gKmCdFXitzIQdf9%2BqqTIhzz2IHFMf3huCeodsv8%2BlGxS5%2FgelrpqVpZDR03Na8RHwrly1lv5O9KY4x49TRng0s%2FLI3OaLjKm9hi7AYygPgK0GJqEb1TDiVUto9%2FTfimjWFqIKICAjYUdAP0cQgi%2Fa0gwZrJRPRAwh8IGEnHTOP2xUHvtmXGCNFd0nQB%2BhGhjk7TdpPeR8R3Dllb35%2FYIroDqWPieYtJrIY10XqWBvqx%2FfbGT1zVLuVoYtvV6gaFc5zbcv9abRFVf4hiCP6%2Ff6MBuNw5%2Fae94efZNp%2BOukuZj6K6B1db7xhtVI%2BBOUiPZA4mr2IzdBeqvNNcwc7m8F1no9YjXbsGs9EEGGStLaVgVI4F8dyAhWEd9FWjgR%2FX5qAyQUGCKULOY1aw6651xwmjz8MCCT1r1GOTBindGasVnMxh5Z0JMjDK9aNkKfgFUbVJ8BrGTCIh%2FYx0bsq7yowDIEyp71TRMo%2Bbu%2FDBhIifKpO4VN7AxMup1DPwu2wNCxORK3yyybb5sa3aTR6942p%2F%2FF5VxFNPqOx1rmCMf4znuW4yrvNkAVvNcuIqdR8aLhaLIEbHzoKxuEKRnrfsIeBqAAUB%2FCKIuI1UaCj4LYX8DyIYOI8tUKFsMguPHpPENaK9Lcz5ZhB%2BrX6BcQfNWOLhDx7KyRE28vtEs2uolAhLTRaZsZFjbAZE5Ngt09%2FbSXdD%2FR%2BOlGMpQdp752x5lOlvPsJp1skuFLbramyqY4oj4tVwv1OLWpcsEc3AEosPalpAuIAA%3D" |
|
|
|
}, |
|
|
|
], |
|
|
|
louceng:'5', |
|
|
|
qinshi:'502', |
|
|
|
} |
|
|
|
]); |
|
|
|
// 获取 noFaceTableRef 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数) |
|
|
|
const noFaceTableRef = ref<noFaceTableInstance>(); |
|
|
|
// 获取 noReturnTableRef 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数) |
|
|
|
const noReturnTableRef = ref<ProTableInstance>(); |
|
|
|
// 表格配置项 |
|
|
|
const columns: ColumnProps[] = [ |
|
|
|
{ type: "selection" }, |
|
|
|
{ |
|
|
|
prop: "louceng", |
|
|
|
label: "楼层" |
|
|
|
}, |
|
|
|
{ |
|
|
|
prop: "qinshi", |
|
|
|
label: "寝室编号" |
|
|
|
prop: "name", |
|
|
|
label: "学生姓名" |
|
|
|
}, |
|
|
|
{ |
|
|
|
prop: "studentname", |
|
|
|
label: "学生姓名" |
|
|
|
prop: "personSetName", |
|
|
|
label: "班级" |
|
|
|
}, |
|
|
|
{ |
|
|
|
prop: "faces", |
|
|
@@ -145,7 +75,7 @@ const columns: ColumnProps[] = [ |
|
|
|
render: scope => { |
|
|
|
return ( |
|
|
|
<img |
|
|
|
src={scope.row.faces.length > 0 ? scope.row.faces[0].faceUrl : ""} |
|
|
|
src={scope.row.faces.length > 0 ? '/api/'+scope.row.faces[0].faceUrl : ""} |
|
|
|
onClick={() => viewHeadImage(scope)} |
|
|
|
style="width:50px;height:50px;cursor:pointer" |
|
|
|
alt="" |
|
|
@@ -154,6 +84,25 @@ const columns: ColumnProps[] = [ |
|
|
|
} |
|
|
|
} |
|
|
|
]; |
|
|
|
/** |
|
|
|
* 打开弹框 |
|
|
|
* @param props 弹框参数 |
|
|
|
*/ |
|
|
|
function onOpen(props: FormProps.Base<{}>) { |
|
|
|
Object.assign(propsInfo, props); //合并参数 |
|
|
|
visible.value = true; //显示弹框 |
|
|
|
nextTick(()=>{ |
|
|
|
noReturnTableRef.value!.searchParam.id = props.record.id; |
|
|
|
noReturnTableRef.value!.searchParam.returnTime = props.record.ReturnTime; |
|
|
|
noReturnTableRef.value.search() |
|
|
|
}) |
|
|
|
} |
|
|
|
const dataCallback = (res:any)=>{ |
|
|
|
if(!res.attendanceDtos)return res.personInfos |
|
|
|
return res.personInfos.filter(e=>{ |
|
|
|
return !res.attendanceDtos.find(e1=>e1.personId == e.personId) |
|
|
|
}) |
|
|
|
} |
|
|
|
// 图片预览 |
|
|
|
const imgVisible = ref(false); |
|
|
|
const faceUrl = ref(''); |
|
|
@@ -162,8 +111,15 @@ const viewHeadImage = (scope: any) => { |
|
|
|
imgVisible.value = true |
|
|
|
}; |
|
|
|
/** 人工确认 */ |
|
|
|
async function personConfirm(ids: string[], msg: string) { |
|
|
|
await useHandleData(attendanceStudentsReturn.delete, {id: ids.toString() }, msg); |
|
|
|
async function personConfirm(list:any, msg: string) { |
|
|
|
list = list.map(e=>{ |
|
|
|
return { |
|
|
|
personSetId:e.personSetId, |
|
|
|
personId:e.personId, |
|
|
|
tick:formatDate(new Date().valueOf()) |
|
|
|
} |
|
|
|
}) |
|
|
|
await useHandleData(attendanceApi.add, list, msg); |
|
|
|
RefreshTable(); //刷新表格 |
|
|
|
} |
|
|
|
/** 关闭表单*/ |
|
|
@@ -172,7 +128,7 @@ function onClose() { |
|
|
|
} |
|
|
|
// 刷新表格 |
|
|
|
const RefreshTable = () => { |
|
|
|
noFaceTableRef.value?.refresh(); |
|
|
|
noReturnTableRef.value?.refresh(); |
|
|
|
}; |
|
|
|
// 暴露给父组件的方法 |
|
|
|
defineExpose({ |
|
|
|