first commit

This commit is contained in:
zc
2025-06-05 09:55:41 +08:00
commit 935360c185
459 changed files with 61034 additions and 0 deletions

View File

@@ -0,0 +1,484 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="学校名称" prop="xxmc">
<el-input
v-model="queryParams.xxmc"
placeholder="请输入学校名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="班级名称" prop="bjmc">
<el-input
v-model="queryParams.bjmc"
placeholder="请输入班级名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属年级" prop="ssnj">
<el-input
v-model="queryParams.ssnj"
placeholder="请输入所属年级"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="班主任工号" prop="bzrgh">
<el-input
v-model="queryParams.bzrgh"
placeholder="请输入班主任工号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位号" prop="dwh">
<el-input
v-model="queryParams.dwh"
placeholder="请输入单位号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['face:classes:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['face:classes:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['face:classes:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['face:classes:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="classesList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="班级Id" align="center" prop="id" />
<el-table-column label="学校名称" align="center" prop="xxmc" />
<el-table-column label="班级名称" align="center" prop="bjmc" />
<el-table-column label="所属年级" align="center" prop="ssnj" />
<el-table-column label="班主任工号" align="center" prop="bzrgh" />
<el-table-column label="单位号" align="center" prop="dwh" />
<el-table-column label="班级类别名称" align="center" prop="bjlbmc" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['face:classes:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['face:classes:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改班级信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-col :span="8" >
<el-form-item label="学校代码" prop="xxdm">
<el-input v-model="form.xxdm" placeholder="请输入学校代码" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="学校名称" prop="xxmc">
<el-input v-model="form.xxmc" placeholder="请输入学校名称" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班号" prop="bh">
<el-input v-model="form.bh" placeholder="请输入班号" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班级名称" prop="bjmc">
<el-input v-model="form.bjmc" placeholder="请输入班级名称" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班级简称" prop="bjjc">
<el-input v-model="form.bjjc" placeholder="请输入班级简称" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班级英文名称" prop="bjywmc">
<el-input v-model="form.bjywmc" placeholder="请输入班级英文名称" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="建班年月" prop="jbny">
<el-input v-model="form.jbny" placeholder="请输入建班年月" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="所属年级" prop="ssnj">
<el-input v-model="form.ssnj" placeholder="请输入所属年级" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班主任工号" prop="bzrgh">
<el-input v-model="form.bzrgh" placeholder="请输入班主任工号" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班长学号" prop="bzxh">
<el-input v-model="form.bzxh" placeholder="请输入班长学号" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="辅导员号" prop="fdyh">
<el-input v-model="form.fdyh" placeholder="请输入辅导员号" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单位号" prop="dwh">
<el-input v-model="form.dwh" placeholder="请输入单位号" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="专业代码" prop="zydm">
<el-input v-model="form.zydm" placeholder="请输入专业代码" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="学生类别代码" prop="xslbdm">
<el-input v-model="form.xslbdm" placeholder="请输入学生类别代码" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="学生类别名称" prop="xslbmc">
<el-input v-model="form.xslbmc" placeholder="请输入学生类别名称" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="培养类别代码" prop="pylbdm">
<el-input v-model="form.pylbdm" placeholder="请输入培养类别代码" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="培养类别名称" prop="pylbmc">
<el-input v-model="form.pylbmc" placeholder="请输入培养类别名称" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班级计划人数" prop="bjjhrs">
<el-input v-model="form.bjjhrs" placeholder="请输入班级计划人数" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班级类别代码" prop="bjlbdm">
<el-input v-model="form.bjlbdm" placeholder="请输入班级类别代码" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="班级类别名称" prop="bjlbmc">
<el-input v-model="form.bjlbmc" placeholder="请输入班级类别名称" />
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="是否已毕业" prop="sfyby">
<el-input v-model="form.sfyby" placeholder="请输入是否已毕业" />
</el-form-item>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listClasses, getClasses, delClasses, addClasses, updateClasses } from "@/api/face/classes";
export default {
name: "Classes",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 班级信息表格数据
classesList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
xxmc: null,
bjmc: null,
ssnj: null,
bzrgh: null,
dwh: null,
bjlbmc: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
xxdm: [
{ required: true, message: "学校代码不能为空", trigger: "blur" }
],
xxmc: [
{ required: true, message: "学校名称不能为空", trigger: "blur" }
],
bh: [
{ required: true, message: "班号不能为空", trigger: "blur" }
],
bjmc: [
{ required: true, message: "班级名称不能为空", trigger: "blur" }
],
bjjc: [
{ required: true, message: "班级简称不能为空", trigger: "blur" }
],
bjywmc: [
{ required: true, message: "班级英文名称不能为空", trigger: "blur" }
],
jbny: [
{ required: true, message: "建班年月不能为空", trigger: "blur" }
],
ssnj: [
{ required: true, message: "所属年级不能为空", trigger: "blur" }
],
bzrgh: [
{ required: true, message: "班主任工号不能为空", trigger: "blur" }
],
bzxh: [
{ required: true, message: "班长学号不能为空", trigger: "blur" }
],
fdyh: [
{ required: true, message: "辅导员号不能为空", trigger: "blur" }
],
dwh: [
{ required: true, message: "单位号不能为空", trigger: "blur" }
],
zydm: [
{ required: true, message: "专业代码不能为空", trigger: "blur" }
],
xslbdm: [
{ required: true, message: "学生类别代码不能为空", trigger: "blur" }
],
xslbmc: [
{ required: true, message: "学生类别名称不能为空", trigger: "blur" }
],
pylbdm: [
{ required: true, message: "培养类别代码不能为空", trigger: "blur" }
],
pylbmc: [
{ required: true, message: "培养类别名称不能为空", trigger: "blur" }
],
bjjhrs: [
{ required: true, message: "班级计划人数不能为空", trigger: "blur" }
],
bjlbdm: [
{ required: true, message: "班级类别代码不能为空", trigger: "blur" }
],
bjlbmc: [
{ required: true, message: "班级类别名称不能为空", trigger: "blur" }
],
sfyby: [
{ required: true, message: "是否已毕业不能为空", trigger: "blur" }
],
ddqyid: [
{ required: true, message: "钉钉企业 ID不能为空", trigger: "blur" }
],
ddbmid: [
{ required: true, message: "钉钉部门 ID不能为空", trigger: "blur" }
],
ddbmqid: [
{ required: true, message: "钉钉部门群 ID不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询班级信息列表 */
getList() {
this.loading = true;
listClasses(this.queryParams).then(response => {
this.classesList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
xxdm: null,
xxmc: null,
bh: null,
bjmc: null,
bjjc: null,
bjywmc: null,
jbny: null,
ssnj: null,
bzrgh: null,
bzxh: null,
fdyh: null,
dwh: null,
zydm: null,
xslbdm: null,
xslbmc: null,
pylbdm: null,
pylbmc: null,
bjjhrs: null,
bjlbdm: null,
bjlbmc: null,
sfyby: null,
ddqyid: null,
ddbmid: null,
ddbmqid: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加班级信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getClasses(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改班级信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateClasses(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addClasses(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除班级信息编号为"' + ids + '"的数据项?').then(function() {
return delClasses(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('face/classes/export', {
...this.queryParams
}, `classes_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -0,0 +1,425 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="学工号" prop="stuId">
<el-input
v-model="queryParams.stuId"
placeholder="请输入学工号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="studentName">
<el-input
v-model="queryParams.studentName"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标签" prop="label">
<el-select v-model="queryParams.label" placeholder="请选择标签" clearable>
<el-option
v-for="dict in dict.type.face_label_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['face:image:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['face:image:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['face:image:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['face:image:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<div style="margin-left:1%;margin-right:1%">
<el-row>
<el-col :span="4" v-for="(item) in imageList" :key="item.id" :offset="1" >
<div style="margin-top:15px;">
<el-card :body-style="{ padding: '0px'}" shadow="hover">
<div class="published-div">
<el-tag
effect="dark">
<el-checkbox :label="item.id"
:value="ids"
@change="idsList(item.id)">{{ "" }}</el-checkbox>{{ item.labelName }}<span v-if="item.faceStudent.name!=null">({{item.faceStudent.name}})</span>
</el-tag>
</div>
<el-image
style="width: 100%; height:240px"
:src="item.imgs"
:preview-src-list="[item.imgs]" >
</el-image>
<div style="padding: 10px;">
<span>学工号{{item.stuId}}</span>
<div class="bottom clearfix">
<time class="time">{{item.createTime}}</time>
<div style="float: right;">
<el-button
size="mini"
icon="el-icon-edit"
@click="handleUpdate(item)"
v-hasPermi="['face:image:edit']"
>修改</el-button>
<el-button
size="mini"
icon="el-icon-delete"
@click="handleDelete(item)"
v-hasPermi="['face:image:remove']"
>删除</el-button>
</div>
</div>
</div>
</el-card>
</div>
</el-col>
</el-row>
<div style="margin-left:35%">
<div class="block">
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</div>
</div>
<!-- 添加或修改图片信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12" >
<el-form-item label="学工号" prop="stuId">
<el-input v-model="form.stuId" placeholder="请输入学工号" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="标签" prop="label">
<el-select v-model="form.label" placeholder="请选择标签" @change="selectLabel">
<el-option
v-for="dict in dict.type.face_label_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="图片" prop="imgs">
<image-minio-uploads v-if="form.label==0" v-model="form.imgs" :limit="1" :isShowTip="false" :fileName="form.stuId" />
<image-minio-upload1 v-if="form.label!=0" v-model="form.imgs" :limit="1" :isShowTip="false" :fileName="form.stuId" />
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listImage, getImage, delImage, addImage, updateImage } from "@/api/face/image";
import {addRecord} from "@/api/face/record";
export default {
name: "Images",
dicts: ['face_label_type'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 图片信息表格数据
imageList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
stuId: null,
label: null,
studentName:null
},
// 表单参数
form: {},
// 表单校验
rules: {
stuId: [
{ required: true, message: "学工号不能为空", trigger: "blur" }
],
label: [
{ required: true, message: "标签不能为空", trigger: "change" }
],
imgs: [
{ required: true, message: "图片不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询图片信息列表 */
getList() {
this.loading = true;
listImage(this.queryParams).then(response => {
this.imageList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
stuId: null,
label: null,
imgs: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加图片信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getImage(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改图片信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateImage(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addImage(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除图片信息编号为"' + ids + '"的数据项?').then(function () {
return delImage(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/image/export', {
...this.queryParams
}, `image_${new Date().getTime()}.zip`)
},
//获取数组中数值的下标
indexOf(val, ids) {
for (let i = 0; i < ids.length; i++) {
//获取当前值的下标
if (ids[i] === val) {
return i;
}
}
return -1;
},
//多选赋值ids
idsList(val) {
//检索下标,判断当前值(或对象是否在数组中); 在则返回在的对象,不在则返回-1
let index = this.indexOf(val, this.ids);
if (this.ids.length > 0 && index > -1) {
//删除数组中的某个元素(在取消勾选时,删除数组中的值)
this.ids.splice(index, 1);
} else {
//id添加到数组中
this.ids.push(val);
//用逗号隔开
// this.selectionList.join(",");
}
this.single = this.ids.length !== 1
this.multiple = !this.ids.length
// 发射数据给父组件:
//this.$emit("handelSelectionList", this.ids);
},
selectLabel(){
if(this.form.label=='0'){
this.form.imgs="";
}
},
getFeature(val){
this.form.feature=val;
},
saveRecord(result,reason){//保存人员对比评分信息
this.formRecord.stuId=this.form.stuId
this.formRecord.name=this.form.name
this.formRecord.imgs=this.oldImgs
this.formRecord.gatherImgs=this.form.imgs
this.formRecord.score=this.score;
this.formRecord.storage=this.formRule.jyms
this.formRecord.gatherWay=0//采集方式为平台
this.formRecord.result=result;
this.formRecord.reason=reason;
addRecord(this.formRecord).then(response => {
this.$modal.msgSuccess("保存人员对比评分信息成功");
});
},
}
};
</script>
<style>
.el-col-4 {
width: 16%;
}
.el-col-offset-1 {
margin-left: 4%;
}
.button {
padding: 0;
float: right;
}
.published-div {
position: absolute;
z-index: 9;
}
.published-divs {
position: absolute;
z-index: 9;
right: 0px;
}
.time {
font-size: 13px;
color: #999;
}
.bottom {
line-height: 12px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
</style>

View File

@@ -0,0 +1,373 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="学工号" prop="stuId">
<el-input
v-model="queryParams.stuId"
placeholder="请输入学工号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="入库模式" prop="storage">
<el-select v-model="queryParams.storage" placeholder="请输入入库模式" @keyup.enter.native="handleQuery">
<el-option key="1" label="严格模式" value="1"></el-option>
<el-option key="2" label="宽松模式" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="采集方式" prop="gatherWay">
<el-select v-model="queryParams.gatherWay" placeholder="请输入采集方式" clearable @keyup.enter.native="handleQuery">
<el-option key="0" label="平台采集" value="0"></el-option>
<el-option key="1" label="移动端采集" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="比对结果" prop="result">
<el-select v-model="queryParams.result" placeholder="请输入比对结果" clearable @keyup.enter.native="handleQuery">
<el-option key="0" label="核验通过" value="0"></el-option>
<el-option key="1" label="非同一人" value="1"></el-option>
<el-option key="2" label="比对失败" value="2"></el-option>
<el-option key="3" label="服务失败" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['face:record:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="学工号" align="center" prop="stuId" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="证件照" align="center" prop="imgs" >
<template v-slot="scope">
<el-image
style="width: 80px; height: 80px"
:src="scope.row.imgs"
:preview-src-list="[scope.row.imgs]" >
</el-image>
</template>
</el-table-column>
<el-table-column label="采集照" align="center" prop="gatherImgs" >
<template v-slot="scope">
<el-image
style="width: 80px; height: 80px"
:src="scope.row.gatherImgs"
:preview-src-list="[scope.row.gatherImgs]" >
</el-image>
</template>
</el-table-column>
<el-table-column label="相似度" align="center" prop="score" />
<el-table-column label="入库模式" align="center" prop="storage" >
<template v-slot="scope">
<span v-if="scope.row.storage=='1'">严格模式</span>
<span v-if="scope.row.storage=='2'">宽松模式</span>
</template>
</el-table-column>
<el-table-column label="采集方式" align="center" prop="gatherWay" >
<template v-slot="scope">
<span v-if="scope.row.gatherWay=='0'">平台采集</span>
<span v-if="scope.row.gatherWay=='1'">移动端采集</span>
</template>
</el-table-column>
<el-table-column label="比对结果" align="center" prop="result" >
<template v-slot="scope">
<span v-if="scope.row.result=='0'">核验通过</span>
<span v-if="scope.row.result=='1'">非同一人</span>
<span v-if="scope.row.result=='2'">比对失败</span>
<span v-if="scope.row.result=='3'">服务失败</span>
</template>
</el-table-column>
<el-table-column label="原因" align="center" prop="reason" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleUpdate(scope.row)"
>查看</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['face:record:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改评分核验记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="650" append-to-body>
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="12" >
<el-form-item label="学工号" prop="stuId">
<el-input v-model="form.stuId" placeholder="请输入学工号" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="证件照" prop="imgs">
<el-image
style="width: 80px; height: 80px"
:src="form.imgs"
:preview-src-list="[form.imgs]" >
</el-image>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="采集照" prop="gatherImgs">
<el-image
style="width: 80px; height: 80px"
:src="form.gatherImgs"
:preview-src-list="[form.gatherImgs]" >
</el-image>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="相似度" prop="score">
<el-slider v-model="form.score"></el-slider>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="入库模式" prop="storage">
<el-select v-model="form.storage" placeholder="请输入入库模式">
<el-option key="1" label="严格模式" value="1"></el-option>
<el-option key="2" label="宽松模式" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="采集方式" prop="gatherWay">
<el-select v-model="form.gatherWay" placeholder="请输入采集方式">
<el-option key="0" label="平台采集" value="0"></el-option>
<el-option key="1" label="移动端采集" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="比对结果" prop="result">
<el-select v-model="form.result" placeholder="请输入比对结果">
<el-option key="0" label="核验通过" value="0"></el-option>
<el-option key="1" label="非同一人" value="1"></el-option>
<el-option key="2" label="比对失败" value="2"></el-option>
<el-option key="3" label="服务失败" value="3"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="原因" prop="reason">
<el-input v-model="form.reason" placeholder="请输入原因" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<!--
<el-button type="primary" @click="submitForm"> </el-button>
-->
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/face/record";
export default {
name: "Record",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 评分核验记录表格数据
recordList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
stuId: null,
name: null,
storage: null,
gatherWay: null,
result: null,
},
// 表单参数
form: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询评分核验记录列表 */
getList() {
this.loading = true;
listRecord(this.queryParams).then(response => {
this.recordList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
stuId: null,
name: null,
imgs: null,
gatherImgs: null,
score: null,
storage: null,
gatherWay: null,
result: null,
reason: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加评分核验记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getRecord(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "查看评分核验记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateRecord(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRecord(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除评分核验记录编号为"' + ids + '"的数据项?').then(function() {
return delRecord(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('face/record/export', {
...this.queryParams
}, `record_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style>
.el-form-item--medium .el-form-item__content {
line-height: 38px;
}
.el-select {
width: 100%;
}
</style>

View File

@@ -0,0 +1,211 @@
<template>
<div class="app-container">
<!-- 添加或修改rule对话框 -->
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-descriptions title="请设置采集规则">
</el-descriptions>
<el-row :gutter="20">
<el-col :span="12"><div class="grid-main bg-purple">防替入学采集比对</div></el-col>
<el-col :span="12"><div class="grid-main bg-purple">
<el-switch
v-model="form.ftrx"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="200"
inactive-value="0">
</el-switch>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<div class="grid-content bg-purple">重新采集照片时将采集照片和人脸库中的底库照片进行1V1相似度比对确认其身份仅针对主照片</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12"><div class="grid-main bg-purple">身份核验相似度通过分数({{ form.xsfs }})</div></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<div class="grid-main">
<el-slider v-model="form.xsfs"></el-slider>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<div class="grid-content bg-purple">建议阈值80</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12"><div class="grid-main bg-purple">校验模式</div></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<div class="grid-main">
<el-radio v-model="form.jyms" label="1">严格模式</el-radio>
<el-radio v-model="form.jyms" label="2">宽松模式</el-radio>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<div class="grid-content bg-purple">严格模式对比不通过不入库 宽松模式对比不通过仍入库</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12"><div class="grid-main bg-purple">审核模式</div></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<div class="grid-main">
<el-radio v-model="form.shms" label="1">自动审核</el-radio>
<el-radio v-model="form.shms" label="2">人工手动</el-radio>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<div class="grid-content bg-purple">自动审核系统自动审核是否符合标准 人工手动人工审核图片是否符合标准</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12"><div class="grid-main bg-purple">不参与身份认证的人</div></el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<div class="grid-content bg-purple">
<el-select style="width: 50%"
v-model="value1"
multiple
filterable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</div>
</template>
<script>
import { listRule, getRule, delRule, addRule, updateRule } from "@/api/face/rule";
import { option } from "@/api/face/student";
export default {
name: "Rule",
data() {
return {
loading: false,
options: [],
value1: [],
// 表单参数
form: {
sfyzs:{},
},
// 表单校验
rules: {
},
queryFrom:{
name:'',
}
};
},
created() {
this.getList();
},
methods: {
/** 查询rule列表 */
getList() {
this.loading = true;
this.form={};
this.value1=[];
listRule().then(response => {
this.form = response.rows[0];
console.log(this.form)
if(this.form.sfyz.length>0){
this.form.sfyzs =this.form.sfyz.split(",")
this.queryFrom.ids=this.form.sfyzs;
option(this.queryFrom).then(response => {
this.options = response;
for(let i=0;i<this.options.length;i++){
this.value1.push(this.options[i].id)
}
});
}
});
},
// 取消按钮
cancel() {
this.reset();
},
// 表单重置
reset() {
this.getList();
},
/** 提交按钮 */
submitForm() {
this.form.sfyz="";
for(let i=0;i<this.value1.length;i++){
this.form.sfyz+=this.value1[i]+",";
}
if(this.form.sfyz.length>0){
this.form.sfyz=this.form.sfyz.substring(0,this.form.sfyz.length-1)
}
this.$refs["form"].validate(valid => {
addRule(this.form).then(response => {
this.$modal.msgSuccess("设置成功");
this.getList();
});
});
},
remoteMethod(query) {
this.queryFrom.name=query
this.queryFrom.ids=[];
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
option(this.queryFrom).then(response => {
this.options = response;
});
}, 200);
} else {
this.options = [];
}
}
}
};
</script>
<style>
.grid-main {
border-radius: 4px;
min-height: 50px;
padding-left: 50px;
font-size: 18px;
}
.grid-content {
border-radius: 4px;
min-height: 50px;
padding-left: 80px;
font-size: 14px;
}
</style>

View File

@@ -0,0 +1,764 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="学工号" prop="stuId">
<el-input
v-model="queryParams.stuId"
placeholder="请输入学工号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="证件号" prop="idCard">
<el-input
v-model="queryParams.idCard"
placeholder="请输入证件号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['face:student:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['face:student:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['face:student:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['face:student:import']"
>导入图片</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport1"
v-hasPermi="['face:student:import']"
>导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['face:student:export']"
>导出</el-button>
<el-button
type="success"
plain
size="mini"
icon="el-icon-edit"
@click="handleExamine"
:disabled="multiple"
v-hasPermi="['face:student:edit']"
>审核</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="studentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="学工号" align="center" prop="stuId" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="phone" />
<el-table-column label="证件号" align="center" prop="idCard" show-overflow-tooltip width="170" />
<el-table-column label="图片" align="center" prop="imgs" >
<template v-slot="scope">
<el-image
style="width: 80px; height: 80px"
:src="scope.row.imgs"
:preview-src-list="[scope.row.imgs]" >
</el-image>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
<el-table-column label="核验" align="center" prop="imgs" >
<template v-slot="scope">
<span v-if="scope.row.erification=='0'">未核验</span>
<span v-if="scope.row.erification=='1'">核验通过</span>
<span v-if="scope.row.erification=='2'">核验不通过</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.erification=='0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleExamine(scope.row)"
v-hasPermi="['face:student:edit']"
>审核</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['face:student:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['face:student:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改学生信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="650px" append-to-body>
<el-radio-group v-model="tabPosition" style="margin-bottom: 30px;">
<el-radio-button label="base">基本信息</el-radio-button>
<el-radio-button v-if="form.id!= null" label="image">照片信息</el-radio-button>
</el-radio-group>
<el-form v-if="tabPosition=='base'" ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="12" >
<el-form-item label="学工号" prop="stuId">
<el-input v-model="form.stuId" placeholder="请输入学工号" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="证件号" prop="idCard">
<el-input v-model="form.idCard" placeholder="请输入证件号" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="院系" prop="speciality">
<el-input v-model="form.speciality" placeholder="请输入院系" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="部门" prop="department">
<el-input v-model="form.department" placeholder="请输入部门" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="性别" prop="gender">
<el-select v-model="form.gender" placeholder="请选择性别">
<el-option
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="状态" prop="state">
<el-select v-model="form.state" placeholder="请选择状态">
<el-option key="0" label="在校" value="0"></el-option>
<el-option key="1" label="离校" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="身份" prop="identity">
<el-select v-model="form.identity" placeholder="请选择身份类型">
<el-option
v-for="dict in dict.type.face_identity_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="核验" prop="erification" >
<el-select v-model="form.erification" placeholder="请选择状态">
<el-option key="0" label="未核验" value="0"></el-option>
<el-option key="1" label="核验通过" value="1"></el-option>
<el-option key="2" label="核验不通过" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="图片" prop="imgs">
<image-minio-upload v-model="form.imgs" :limit="1" :isShowTip="false" :fileName="form.stuId" @getFeature="getFeature" v-if="rule" />
<image-minio-uploads v-model="form.imgs" :limit="1" :isShowTip="false" :fileName="form.stuId" v-if="!rule" />
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-form>
<el-tabs v-if="tabPosition=='image'" style="height: 600px;">
<el-tab-pane label="考试">
<template v-for="url in imageList" >
<el-image v-if="url.label=='1'" :key="url.id" :src="url.imgs" lazy></el-image>
</template>
</el-tab-pane>
<el-tab-pane label="生活照">
<el-row>
<el-col :span="10" v-for="(item) in imageList" :key="item.id" :offset="1" >
<el-card :body-style="{ padding: '0px'}" shadow="hover" v-if="item.label=='2'">
<el-image
style="width: 100%; height:240px"
:src="item.imgs"
:preview-src-list="[item.imgs]" >
</el-image>
<div style="padding: 10px;">
<div class="bottom clearfix">
<time class="time">{{item.createTime}}</time>
</div>
</div>
</el-card>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer" v-if="tabPosition=='base' ">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".zip"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否核验人脸算法
</div>
<span>仅允许导入zip格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" ><el-popover
placement="top-start"
title="上传压缩包示例"
width="500"
trigger="hover">
<div class="txt">上传图片要求</div>
<el-image
:src="logo"
:preview-src-list="[logo]" >
</el-image>
<el-button slot="reference" type="text" class="button">查看示例</el-button>
</el-popover></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload1.title" :visible.sync="upload1.open" width="400px" append-to-body>
<el-upload
ref="upload1"
:limit="1"
accept=".xlsx, .xls"
:headers="upload1.headers"
:action="upload1.url + '?updateSupport=' + upload1.updateSupport"
:disabled="upload1.isUploading"
:on-progress="handleFileUploadProgress1"
:on-success="handleFileSuccess1"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload1.updateSupport" /> 是否更新已经存在的人员数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm1"> </el-button>
<el-button @click="upload1.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listStudent,
getStudent,
delStudent,
addStudent,
updateStudent,
compareTwoPic,
examineStudent,
option
} from "@/api/face/student";
import {getToken} from "@/utils/auth";
//import logoImg from '@/assets/images/xgh.png'
import {listImage} from "@/api/face/image";
import {listRule} from "@/api/face/rule";
import {addRecord} from "@/api/face/record";
export default {
name: "Student",
dicts: ['face_identity_type','sys_user_sex'],
data() {
return {
tabPosition:'base',
logo: logoImg,
// 遮罩层
loading: true,
// 选中数组
ids: [],
names: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 学生信息表格数据
studentList: [],
imageList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
stuId: null,
name: null,
phone: null,
idCard: null,
imgs: null,
feature: null,
flag:'jzg',
},
// 查询参数
queryParams1: {
pageNum: 1,
pageSize: 10,
stuId: null,
},
// 表单参数
form: {
flag:'jzg',
},
formRule:{},
formRecord:{},
oldImgs:"",
// 表单校验
rules: {
stuId: [
{ required: true, message: "学工号不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
phone: [
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,message: "请输入正确的手机号码",trigger: "blur"}
],
},
// 导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/student/import"
},
// 导入参数
upload1: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/student/importData"
},
rule:false,
score:0,//比对分数
};
},
created() {
this.getList();
this.getRuleList();
},
methods: {
/** 查询学生信息列表 */
getList() {
this.loading = true;
listStudent(this.queryParams).then(response => {
this.studentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getRuleList() {
listRule().then(response => {
this.formRule = response.rows[0];
if(this.formRule.ftrx=='200'){//防替打开
if(this.formRule.jyms=='1'){//严格模式打开
this.rule=true;
}
}
//不在参与身份认证人之中
if(this.formRule.sfyz.length>0){
let sfyzs =this.formRule.sfyz.split(",")
for(let i=0;i<sfyzs.length;i++){
if(sfyzs[i]==this.form.id ){
this.rule=false
}
}
}
if(this.formRule.shms=='2'){//人工审核
this.rule=false
}
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
stuId: null,
name: null,
phone: null,
idCard: null,
imgs: null,
feature: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
flag:'jzg',
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.names = selection.map(item => item.name)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加教职工信息";
this.tabPosition='base';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getStudent(id).then(response => {
this.form = response.data;
this.oldImgs=response.data.imgs;
//查询照片信息
this.queryParams1.stuId=this.form.stuId
listImage(this.queryParams1).then(response => {
this.imageList = response.rows;
});
this.open = true;
this.title = "修改教职工信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
//进行人脸1v1比对之前进行采集规则判断是否防替入学采集开启和校验模式以及是否不参与身份认证的人
if(this.rule){
if(this.oldImgs!=null){
//两次图片不一致进行人脸1v1核验
if(this.form.imgs!=this.oldImgs){
compareTwoPic(this.oldImgs,this.form.imgs).then(response => {
if(response.code==200){
console.log("进行人脸1v1比对,判断是否本人,不是本人就将老照片放回去,并给出核验结果")
console.log(data)
this.score=response.data;
//保存人脸比对记录
if(this.score>this.formRule.xsfs){//说明核验通过
this.saveRecord('0',"");
updateStudent(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}else{
this.$modal.msgError("人脸库中的底库照片与此次上传非同一人,请联系管理员重新设置")
this.saveRecord('1',"人脸库中的底库照片与此次上传非同一人");
this.open = false;
return;
}
}else{
this.$modal.msgError("人脸库比对失败")
this.saveRecord('2',"人脸库比对失败");
this.open = false;
return;
}
}).catch(error => {
this.$modal.msgError("人脸库比对失败")
this.saveRecord('2',"人脸库比对服务失败");
this.open = false;
return;
});
}else{
updateStudent(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}
}else{
updateStudent(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}
}else{
updateStudent(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}
} else {
/* if(this.form.imgs!=""){
compareTwoPic(this.form.imgs).then(response => {
console.log("保存特征值====")
console.log(response)
});
}*/
addStudent(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除教职工信息编号为"' + ids + '"的数据项?').then(function() {
return delStudent(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/student/export', {
...this.queryParams
}, `image_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "学工图片导入";
this.upload.open = true;
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
handleImport1() {
this.upload1.title = "学工图片导入";
this.upload1.open = true;
},
// 文件上传中处理
handleFileUploadProgress1(event, file, fileList) {
this.upload1.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess1(response, file, fileList) {
this.upload1.open = false;
this.upload1.isUploading = false;
this.$refs.upload1.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm1() {
this.$refs.upload1.submit();
},
getFeature(val){
this.form.feature=val;
},
/** 下载模板操作 */
importTemplate() {
this.download('system/student/importTemplate', {
}, `image_template_${new Date().getTime()}.xlsx`)
},
saveRecord(result,reason){//保存人员对比评分信息
this.formRecord.stuId=this.form.stuId
this.formRecord.name=this.form.name
this.formRecord.imgs=this.oldImgs
this.formRecord.gatherImgs=this.form.imgs
this.formRecord.score=this.score;
this.formRecord.storage=this.formRule.jyms
this.formRecord.gatherWay=0//采集方式为平台
this.formRecord.result=result;
this.formRecord.reason=reason;
addRecord(this.formRecord).then(response => {
this.$modal.msgSuccess("保存人员对比评分信息成功");
});
},
/** 审核按钮操作 */
handleExamine(row) {
const ids = row.id || this.ids;
const names = row.name || this.names;
this.$modal.examine('核验教职工姓名为"' + names + '"的数据项是否通过?').then(function() {
return examineStudent(ids,'1');
}).catch(() => {
//不通过
return examineStudent(ids,'2');
}).then(() => {
this.getList();
this.$modal.msgSuccess("核验成功");
});
},
}
};
</script>

View File

@@ -0,0 +1,764 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="学工号" prop="stuId">
<el-input
v-model="queryParams.stuId"
placeholder="请输入学工号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="证件号" prop="idCard">
<el-input
v-model="queryParams.idCard"
placeholder="请输入证件号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['face:student:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['face:student:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['face:student:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['face:student:import']"
>导入图片</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport1"
v-hasPermi="['face:student:import']"
>导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['face:student:export']"
>导出</el-button>
<el-button
type="success"
plain
size="mini"
icon="el-icon-edit"
@click="handleExamine"
:disabled="multiple"
v-hasPermi="['face:student:edit']"
>审核</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="studentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="学工号" align="center" prop="stuId" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="phone" />
<el-table-column label="证件号" align="center" prop="idCard" show-overflow-tooltip width="170" />
<el-table-column label="图片" align="center" prop="imgs" >
<template v-slot="scope">
<el-image
style="width: 80px; height: 80px"
:src="scope.row.imgs"
:preview-src-list="[scope.row.imgs]" >
</el-image>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
<el-table-column label="核验" align="center" prop="imgs" >
<template v-slot="scope">
<span v-if="scope.row.erification=='0'">未核验</span>
<span v-if="scope.row.erification=='1'">核验通过</span>
<span v-if="scope.row.erification=='2'">核验不通过</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.erification=='0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleExamine(scope.row)"
v-hasPermi="['face:student:edit']"
>审核</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['face:student:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['face:student:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改学生信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="650px" append-to-body>
<el-radio-group v-model="tabPosition" style="margin-bottom: 30px;">
<el-radio-button label="base">基本信息</el-radio-button>
<el-radio-button v-if="form.id!= null" label="image">照片信息</el-radio-button>
</el-radio-group>
<el-form v-if="tabPosition=='base'" ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="12" >
<el-form-item label="学工号" prop="stuId">
<el-input v-model="form.stuId" placeholder="请输入学工号" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="证件号" prop="idCard" >
<el-input v-model="form.idCard" placeholder="请输入证件号" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="院系" prop="speciality">
<el-input v-model="form.speciality" placeholder="请输入院系" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="部门" prop="department">
<el-input v-model="form.department" placeholder="请输入部门" />
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="性别" prop="gender">
<el-select v-model="form.gender" placeholder="请选择性别">
<el-option
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="状态" prop="state">
<el-select v-model="form.state" placeholder="请选择状态">
<el-option key="0" label="在校" value="0"></el-option>
<el-option key="1" label="离校" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="身份" prop="identity">
<el-select v-model="form.identity" placeholder="请选择身份类型">
<el-option
v-for="dict in dict.type.face_identity_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="核验" prop="erification" >
<el-select v-model="form.erification" placeholder="请选择状态">
<el-option key="0" label="未核验" value="0"></el-option>
<el-option key="1" label="核验通过" value="1"></el-option>
<el-option key="2" label="核验不通过" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="图片" prop="imgs">
<image-minio-upload v-model="form.imgs" :limit="1" :isShowTip="false" :fileName="form.stuId" @getFeature="getFeature" v-if="rule" />
<image-minio-uploads v-model="form.imgs" :limit="1" :isShowTip="false" :fileName="form.stuId" v-if="!rule" />
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-form>
<el-tabs v-if="tabPosition=='image'" style="height: 600px;">
<el-tab-pane label="考试">
<template v-for="url in imageList" >
<el-image v-if="url.label=='1'" :key="url.id" :src="url.imgs" lazy></el-image>
</template>
</el-tab-pane>
<el-tab-pane label="生活照">
<el-row>
<el-col :span="10" v-for="(item) in imageList" :key="item.id" :offset="1" >
<el-card :body-style="{ padding: '0px'}" shadow="hover" v-if="item.label=='2'">
<el-image
style="width: 100%; height:240px"
:src="item.imgs"
:preview-src-list="[item.imgs]" >
</el-image>
<div style="padding: 10px;">
<div class="bottom clearfix">
<time class="time">{{item.createTime}}</time>
</div>
</div>
</el-card>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer" v-if="tabPosition=='base' ">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".zip"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否核验人脸算法
</div>
<span>仅允许导入zip格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" ><el-popover
placement="top-start"
title="上传压缩包示例"
width="500"
trigger="hover">
<div class="txt">上传图片要求</div>
<el-image
:src="logo"
:preview-src-list="[logo]" >
</el-image>
<el-button slot="reference" type="text" class="button">查看示例</el-button>
</el-popover></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload1.title" :visible.sync="upload1.open" width="400px" append-to-body>
<el-upload
ref="upload1"
:limit="1"
accept=".xlsx, .xls"
:headers="upload1.headers"
:action="upload1.url + '?updateSupport=' + upload1.updateSupport"
:disabled="upload1.isUploading"
:on-progress="handleFileUploadProgress1"
:on-success="handleFileSuccess1"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload1.updateSupport" /> 是否更新已经存在的人员数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm1"> </el-button>
<el-button @click="upload1.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listStudent,
getStudent,
delStudent,
addStudent,
updateStudent,
compareTwoPic,
examineStudent,
option
} from "@/api/face/student";
import {getToken} from "@/utils/auth";
//import logoImg from '@/assets/images/xgh.png'
import {listImage} from "@/api/face/image";
import {listRule} from "@/api/face/rule";
import {addRecord} from "@/api/face/record";
export default {
name: "Student",
dicts: ['face_identity_type','sys_user_sex'],
data() {
return {
tabPosition:'base',
logo: logoImg,
// 遮罩层
loading: true,
// 选中数组
ids: [],
names: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 学生信息表格数据
studentList: [],
imageList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
stuId: null,
name: null,
phone: null,
idCard: null,
imgs: null,
feature: null,
flag:'xs',
},
// 查询参数
queryParams1: {
pageNum: 1,
pageSize: 10,
stuId: null,
},
// 表单参数
form: {
flag:'xs',
},
formRule:{},
formRecord:{},
oldImgs:"",
// 表单校验
rules: {
stuId: [
{ required: true, message: "学工号不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
phone: [
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,message: "请输入正确的手机号码",trigger: "blur"}
],
},
// 导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/student/import"
},
// 导入参数
upload1: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/student/importData"
},
rule:false,
score:0,//比对分数
};
},
created() {
this.getList();
this.getRuleList();
},
methods: {
/** 查询学生信息列表 */
getList() {
this.loading = true;
listStudent(this.queryParams).then(response => {
this.studentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getRuleList() {
listRule().then(response => {
this.formRule = response.rows[0];
if(this.formRule.ftrx=='200'){//防替打开
if(this.formRule.jyms=='1'){//严格模式打开
this.rule=true;
}
}
//不在参与身份认证人之中
if(this.formRule.sfyz.length>0){
let sfyzs =this.formRule.sfyz.split(",")
for(let i=0;i<sfyzs.length;i++){
if(sfyzs[i]==this.form.id ){
this.rule=false
}
}
}
if(this.formRule.shms=='2'){//人工审核
this.rule=false
}
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
stuId: null,
name: null,
phone: null,
idCard: null,
imgs: null,
feature: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
flag:'xs',
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.names = selection.map(item => item.name)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加学生信息";
this.tabPosition='base';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getStudent(id).then(response => {
this.form = response.data;
this.oldImgs=response.data.imgs;
//查询照片信息
this.queryParams1.stuId=this.form.stuId
listImage(this.queryParams1).then(response => {
this.imageList = response.rows;
});
this.open = true;
this.title = "修改学生信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
//进行人脸1v1比对之前进行采集规则判断是否防替入学采集开启和校验模式以及是否不参与身份认证的人
if(this.rule){
if(this.oldImgs!=null){
//两次图片不一致进行人脸1v1核验
if(this.form.imgs!=this.oldImgs){
compareTwoPic(this.oldImgs,this.form.imgs).then(response => {
if(response.code==200){
console.log("进行人脸1v1比对,判断是否本人,不是本人就将老照片放回去,并给出核验结果")
console.log(data)
this.score=response.data;
//保存人脸比对记录
if(this.score>this.formRule.xsfs){//说明核验通过
this.saveRecord('0',"");
updateStudent(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}else{
this.$modal.msgError("人脸库中的底库照片与此次上传非同一人,请联系管理员重新设置")
this.saveRecord('1',"人脸库中的底库照片与此次上传非同一人");
this.open = false;
return;
}
}else{
this.$modal.msgError("人脸库比对失败")
this.saveRecord('2',"人脸库比对失败");
this.open = false;
return;
}
}).catch(error => {
this.$modal.msgError("人脸库比对失败")
this.saveRecord('2',"人脸库比对服务失败");
this.open = false;
return;
});
}else{
updateStudent(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}
}else{
updateStudent(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}
}else{
updateStudent(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}
} else {
/* if(this.form.imgs!=""){
compareTwoPic(this.form.imgs).then(response => {
console.log("保存特征值====")
console.log(response)
});
}*/
addStudent(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除学生信息编号为"' + ids + '"的数据项?').then(function() {
return delStudent(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/student/export', {
...this.queryParams
}, `image_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "学工图片导入";
this.upload.open = true;
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
handleImport1() {
this.upload1.title = "学工图片导入";
this.upload1.open = true;
},
// 文件上传中处理
handleFileUploadProgress1(event, file, fileList) {
this.upload1.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess1(response, file, fileList) {
this.upload1.open = false;
this.upload1.isUploading = false;
this.$refs.upload1.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm1() {
this.$refs.upload1.submit();
},
getFeature(val){
this.form.feature=val;
},
/** 下载模板操作 */
importTemplate() {
this.download('system/student/importTemplate', {
}, `image_template_${new Date().getTime()}.xlsx`)
},
saveRecord(result,reason){//保存人员对比评分信息
this.formRecord.stuId=this.form.stuId
this.formRecord.name=this.form.name
this.formRecord.imgs=this.oldImgs
this.formRecord.gatherImgs=this.form.imgs
this.formRecord.score=this.score;
this.formRecord.storage=this.formRule.jyms
this.formRecord.gatherWay=0//采集方式为平台
this.formRecord.result=result;
this.formRecord.reason=reason;
addRecord(this.formRecord).then(response => {
this.$modal.msgSuccess("保存人员对比评分信息成功");
});
},
/** 审核按钮操作 */
handleExamine(row) {
const ids = row.id || this.ids;
const names = row.name || this.names;
this.$modal.examine('核验学生姓名为"' + names + '"的数据项是否通过?').then(function() {
return examineStudent(ids,'1');
}).catch(() => {
//不通过
return examineStudent(ids,'2');
}).then(() => {
this.getList();
this.$modal.msgSuccess("核验成功");
});
},
}
};
</script>