diff --git a/SafeCampus.WEB/src/api/interface/sys/usermanage/personnel.ts b/SafeCampus.WEB/src/api/interface/sys/usermanage/personnel.ts index 628085c..691834d 100644 --- a/SafeCampus.WEB/src/api/interface/sys/usermanage/personnel.ts +++ b/SafeCampus.WEB/src/api/interface/sys/usermanage/personnel.ts @@ -24,6 +24,8 @@ export namespace SysUserPersonnel { /** 底库信息 */ export interface ClassPage { + personSetId?: string | undefined; + personSetName?: string | undefined; id?: string | undefined; name?: string | undefined; } @@ -31,9 +33,14 @@ export namespace SysUserPersonnel { export interface SysUserAvatar { /** 人脸 */ personId?: string | undefined; - faceId: string; + faceId?: string | number; faceUrl: string; - tag: string; + uid?: string | number; + } + // 人脸删除 + export interface SysUserFace { + personId: string | undefined; + faceIds: Array; } /** 用户信息 */ diff --git a/SafeCampus.WEB/src/api/modules/usermanage/personnel.ts b/SafeCampus.WEB/src/api/modules/usermanage/personnel.ts index 39f7455..ccae5a6 100644 --- a/SafeCampus.WEB/src/api/modules/usermanage/personnel.ts +++ b/SafeCampus.WEB/src/api/modules/usermanage/personnel.ts @@ -13,7 +13,7 @@ * @see https://gitee.com/dotnetmoyu/SimpleAdmin */ import { moduleRequest } from "@/api/request"; -import { ResPage, ReqPersonId, SysUserPersonnel } from "@/api/interface"; +import { ReqId, ResPage, ReqPersonId, SysUserPersonnel } from "@/api/interface"; const http = moduleRequest("/business/personApi/"); /** @@ -27,18 +27,18 @@ const userManagePersonnelApi = { return http.post("pageQuery", params); }, /** 获取单页详情 */ - detail(params: ReqPersonId) { + detail(params: ReqId) { return http.get("getPersionById", params); }, - /** 删除机构 */ - delete(params: ReqPersonId) { - return http.post("deletePersonD", params); + /** 删除人员 */ + delete(params: ReqId) { + return http.delete("deletePersonD", params); }, - /** 新增机构 */ + /** 新增人员 */ add(params: SysUserPersonnel.SysUserPerInfo) { return http.post("createPersonA", params); }, - /** 修改机构 */ + /** 修改人员 */ update(params: SysUserPersonnel.SysUserPerInfo) { return http.put("updatePersionU", params); }, @@ -47,8 +47,8 @@ const userManagePersonnelApi = { return http.post("addFaceA", params); }, /** 删除人脸 */ - deleteFace(params: SysUserPersonnel.SysUserAvatar) { - return http.delete("deleteFaceD", params); + deleteFace(params: SysUserPersonnel.SysUserFace) { + return http.post("deleteFaceD", params); }, /**底库绑定 */ personBindDfie(params: SysUserPersonnel.ClassPage) { diff --git a/SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue b/SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue index c85f356..97b7411 100644 --- a/SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue +++ b/SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue @@ -4,15 +4,46 @@ * @Date: 2023-12-15 15:45:50 --> @@ -86,4 +182,12 @@ onMounted(() => { :deep(.el-date-editor.el-input) { width: 92% !important; } +:deep(.el-upload-list--picture-card .el-upload-list__item) { + width: 100px !important; + height: 100px !important; +} +:deep(.el-upload--picture-card) { + width: 100px !important; + height: 100px !important; +} diff --git a/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue b/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue index 2c3643e..4c53baa 100644 --- a/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue +++ b/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue @@ -49,7 +49,7 @@ const rules = reactive({ // personId: [required("请输入人员ID")], name: [required("请输入姓名")], gender: [required("请选择性别")], - // age: [required("请输入年龄")] + faces: [required("请上传人脸图片")], phone: [required("请输入手机号")] // extData: [required("请输入扩展数据")] }); @@ -67,7 +67,7 @@ function onOpen(props: FormProps.Base) { visible.value = true; //显示表单 if (props.record.personId) { //如果传了id,就去请求api获取record - userManagePersonnelApi.detail({ personId: props.record.personId }).then(res => { + userManagePersonnelApi.detail({ id: props.record.personId }).then(res => { sysUserProps.record = res.data; }); } @@ -80,8 +80,9 @@ async function handleSubmit() { sysUserFormRef.value?.validate(async valid => { if (!valid) return; //表单验证失败 //提交表单 - console.log(sysUserProps); - debugger; + if (sysUserProps.record.faces.length === 0) { + return ElMessage.error("请上传人脸图片"); + } if (sysUserProps.record.personId) { await userManagePersonnelApi .update(sysUserProps.record) diff --git a/SafeCampus.WEB/src/views/userManage/personnel/components/formClass/index.vue b/SafeCampus.WEB/src/views/userManage/personnel/components/formClass/index.vue index 59517ab..1519d3b 100644 --- a/SafeCampus.WEB/src/views/userManage/personnel/components/formClass/index.vue +++ b/SafeCampus.WEB/src/views/userManage/personnel/components/formClass/index.vue @@ -15,7 +15,7 @@ label-width="auto" label-suffix=" :" > -
+
@@ -41,7 +41,6 @@ import { required } from "@/utils/formRules"; import { FormInstance } from "element-plus"; const visibleClass = ref(false); //是否显示表单 - // 表单参数 const sysUserProps = reactive>({ opt: FormOptEnum.ADD, diff --git a/SafeCampus.WEB/src/views/userManage/personnel/index.vue b/SafeCampus.WEB/src/views/userManage/personnel/index.vue index ad6ba4d..f5bfbbd 100644 --- a/SafeCampus.WEB/src/views/userManage/personnel/index.vue +++ b/SafeCampus.WEB/src/views/userManage/personnel/index.vue @@ -35,7 +35,7 @@
- +