|
|
@@ -33,9 +33,10 @@ import { FormOptEnum } from "@/enums"; |
|
|
|
import { required } from "@/utils/formRules"; |
|
|
|
import { FormInstance } from "element-plus"; |
|
|
|
import Basic from "./form_basic.vue"; |
|
|
|
|
|
|
|
import { checkPhoneNumber } from "@/utils/eleValidate"; |
|
|
|
const visible = ref(false); //是否显示表单 |
|
|
|
const activeName = ref("basic"); |
|
|
|
const sysUserFormRef = ref<FormInstance>(); |
|
|
|
// 表单参数 |
|
|
|
const sysUserProps = reactive<FormProps.Base<SysUserPersonnel.SysUserPerInfo>>({ |
|
|
|
opt: FormOptEnum.ADD, |
|
|
@@ -48,7 +49,10 @@ const rules = reactive({ |
|
|
|
name: [required("请输入姓名")], |
|
|
|
gender: [required("请选择性别")], |
|
|
|
faces: [required("请上传人脸图片")], |
|
|
|
phone: [required("请输入手机号")], |
|
|
|
phone: [ |
|
|
|
{ required: true, message: "请输入手机号", trigger: "blur" }, |
|
|
|
{ validator: checkPhoneNumber, trigger: "blur" } |
|
|
|
], |
|
|
|
// depId: [required("请选择系部")], |
|
|
|
// majorId: [required("请选择专业")], |
|
|
|
personSetId: [required("请选择班级")] |
|
|
@@ -75,9 +79,6 @@ function onOpen(props: FormProps.Base<SysUserPersonnel.SysUserPerInfo>) { |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 提交数据(新增/编辑) |
|
|
|
const sysUserFormRef = ref<FormInstance>(); |
|
|
|
/** 提交表单 */ |
|
|
|
async function handleSubmit() { |
|
|
|
sysUserFormRef.value?.validate(async valid => { |
|
|
|