diff --git a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/form_basic.vue b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/form_basic.vue
index a0320f6..380eace 100644
--- a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/form_basic.vue
+++ b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/form_basic.vue
@@ -51,7 +51,7 @@
-
+
diff --git a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue
index 407bd69..1c9cb8f 100644
--- a/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue
+++ b/SafeCampus.WEB/src/views/userManage/keyPersonnel/components/form/index.vue
@@ -42,6 +42,14 @@ const sysUserProps = reactive>({
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({
@@ -51,7 +59,8 @@ const rules = reactive({
phone: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ validator: checkPhoneNumber, trigger: "blur" }
- ]
+ ],
+ age: [{ validator: checkAgeNumber, trigger: "blur" }]
});
/**
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 119a694..f38cb8e 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
@@ -73,7 +73,7 @@
-
+
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 cb438b1..8271add 100644
--- a/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue
+++ b/SafeCampus.WEB/src/views/userManage/personnel/components/form/index.vue
@@ -43,7 +43,14 @@ const sysUserProps = reactive>({
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" }]
});
/**