|
|
@@ -43,7 +43,14 @@ const sysUserProps = reactive<FormProps.Base<SysUserPersonnel.SysUserPerInfo>>({ |
|
|
|
record: {}, |
|
|
|
disabled: false |
|
|
|
}); |
|
|
|
|
|
|
|
const checkAgeNumber = (rule: any, value: any, callback: any) => { |
|
|
|
if (value === "") callback("请输入年龄"); |
|
|
|
if (value > 100 || value < 0) { |
|
|
|
callback(new Error("请输入正确的年龄(年龄范围1-100岁)")); |
|
|
|
} else { |
|
|
|
return callback(); |
|
|
|
} |
|
|
|
}; |
|
|
|
// 表单验证规则 |
|
|
|
const rules = reactive({ |
|
|
|
name: [required("请输入姓名")], |
|
|
@@ -53,9 +60,8 @@ const rules = reactive({ |
|
|
|
{ required: true, message: "请输入手机号", trigger: "blur" }, |
|
|
|
{ validator: checkPhoneNumber, trigger: "blur" } |
|
|
|
], |
|
|
|
// depId: [required("请选择系部")], |
|
|
|
// majorId: [required("请选择专业")], |
|
|
|
personSetId: [required("请选择班级")] |
|
|
|
personSetId: [required("请选择班级")], |
|
|
|
age: [{ validator: checkAgeNumber, trigger: "blur" }] |
|
|
|
}); |
|
|
|
|
|
|
|
/** |
|
|
|