@@ -107,10 +107,6 @@ const refresh = (fn = () => {}, time = 5000) => { | |||||
}; | }; | ||||
// 性别 | // 性别 | ||||
const genderOptions = ref([ | const genderOptions = ref([ | ||||
{ | |||||
label: "未知", | |||||
value: "GENDER_UNKNOWN" | |||||
}, | |||||
{ | { | ||||
label: "男", | label: "男", | ||||
value: "GENDER_MALE" | value: "GENDER_MALE" | ||||
@@ -121,10 +121,6 @@ const handleAvatarError: UploadProps["onError"] = (error, uploadFile, uploadFile | |||||
}; | }; | ||||
// 通用状态选项 | // 通用状态选项 | ||||
const genderOptions = ref([ | const genderOptions = ref([ | ||||
{ | |||||
label: "未知", | |||||
value: "GENDER_UNKNOWN" | |||||
}, | |||||
{ | { | ||||
label: "男", | label: "男", | ||||
value: "GENDER_MALE" | value: "GENDER_MALE" | ||||
@@ -33,7 +33,7 @@ import { FormOptEnum } from "@/enums"; | |||||
import { required } from "@/utils/formRules"; | import { required } from "@/utils/formRules"; | ||||
import { FormInstance } from "element-plus"; | import { FormInstance } from "element-plus"; | ||||
import Basic from "./form_basic.vue"; | import Basic from "./form_basic.vue"; | ||||
import { checkPhoneNumber } from "@/utils/eleValidate"; | |||||
const visible = ref(false); //是否显示表单 | const visible = ref(false); //是否显示表单 | ||||
const activeName = ref("basic"); | const activeName = ref("basic"); | ||||
// 表单参数 | // 表单参数 | ||||
@@ -48,7 +48,10 @@ const rules = reactive({ | |||||
name: [required("请输入姓名")], | name: [required("请输入姓名")], | ||||
gender: [required("请选择性别")], | gender: [required("请选择性别")], | ||||
faces: [required("请上传人脸图片")], | faces: [required("请上传人脸图片")], | ||||
phone: [required("请输入手机号")] | |||||
phone: [ | |||||
{ required: true, message: "请输入手机号", trigger: "blur" }, | |||||
{ validator: checkPhoneNumber, trigger: "blur" } | |||||
] | |||||
}); | }); | ||||
/** | /** | ||||
@@ -68,10 +68,7 @@ const columns: ColumnProps<SysUserPersonnel.SysUserPerInfo>[] = [ | |||||
{ | { | ||||
prop: "gender", | prop: "gender", | ||||
label: "性别", | label: "性别", | ||||
enum: [{ | |||||
label: "未知", | |||||
value: "GENDER_UNKNOWN" | |||||
}, | |||||
enum: [ | |||||
{ | { | ||||
label: "男", | label: "男", | ||||
value: "GENDER_MALE" | value: "GENDER_MALE" | ||||
@@ -147,10 +147,6 @@ const handleAvatarError: UploadProps["onError"] = (error, uploadFile, uploadFile | |||||
}; | }; | ||||
// 通用状态选项 | // 通用状态选项 | ||||
const genderOptions = ref([ | const genderOptions = ref([ | ||||
{ | |||||
label: "未知", | |||||
value: "GENDER_UNKNOWN" | |||||
}, | |||||
{ | { | ||||
label: "男", | label: "男", | ||||
value: "GENDER_MALE" | value: "GENDER_MALE" | ||||
@@ -33,9 +33,10 @@ import { FormOptEnum } from "@/enums"; | |||||
import { required } from "@/utils/formRules"; | import { required } from "@/utils/formRules"; | ||||
import { FormInstance } from "element-plus"; | import { FormInstance } from "element-plus"; | ||||
import Basic from "./form_basic.vue"; | import Basic from "./form_basic.vue"; | ||||
import { checkPhoneNumber } from "@/utils/eleValidate"; | |||||
const visible = ref(false); //是否显示表单 | const visible = ref(false); //是否显示表单 | ||||
const activeName = ref("basic"); | const activeName = ref("basic"); | ||||
const sysUserFormRef = ref<FormInstance>(); | |||||
// 表单参数 | // 表单参数 | ||||
const sysUserProps = reactive<FormProps.Base<SysUserPersonnel.SysUserPerInfo>>({ | const sysUserProps = reactive<FormProps.Base<SysUserPersonnel.SysUserPerInfo>>({ | ||||
opt: FormOptEnum.ADD, | opt: FormOptEnum.ADD, | ||||
@@ -48,7 +49,10 @@ const rules = reactive({ | |||||
name: [required("请输入姓名")], | name: [required("请输入姓名")], | ||||
gender: [required("请选择性别")], | gender: [required("请选择性别")], | ||||
faces: [required("请上传人脸图片")], | faces: [required("请上传人脸图片")], | ||||
phone: [required("请输入手机号")], | |||||
phone: [ | |||||
{ required: true, message: "请输入手机号", trigger: "blur" }, | |||||
{ validator: checkPhoneNumber, trigger: "blur" } | |||||
], | |||||
// depId: [required("请选择系部")], | // depId: [required("请选择系部")], | ||||
// majorId: [required("请选择专业")], | // majorId: [required("请选择专业")], | ||||
personSetId: [required("请选择班级")] | personSetId: [required("请选择班级")] | ||||
@@ -75,9 +79,6 @@ function onOpen(props: FormProps.Base<SysUserPersonnel.SysUserPerInfo>) { | |||||
}); | }); | ||||
} | } | ||||
} | } | ||||
// 提交数据(新增/编辑) | |||||
const sysUserFormRef = ref<FormInstance>(); | |||||
/** 提交表单 */ | /** 提交表单 */ | ||||
async function handleSubmit() { | async function handleSubmit() { | ||||
sysUserFormRef.value?.validate(async valid => { | sysUserFormRef.value?.validate(async valid => { | ||||
@@ -86,7 +86,8 @@ const columns: ColumnProps<SysUserPersonnel.SysUserPerInfo>[] = [ | |||||
el: "select", | el: "select", | ||||
span:1, | span:1, | ||||
props: { | props: { | ||||
clearable: false, | |||||
filterable: true, | |||||
clearable: true, | |||||
placeholder: "请选择所属班级", | placeholder: "请选择所属班级", | ||||
}, | }, | ||||
}, | }, | ||||
@@ -95,11 +96,7 @@ const columns: ColumnProps<SysUserPersonnel.SysUserPerInfo>[] = [ | |||||
{ | { | ||||
prop: "gender", | prop: "gender", | ||||
label: "性别", | label: "性别", | ||||
enum: [{ | |||||
label: "未知", | |||||
value: "GENDER_UNKNOWN" | |||||
}, | |||||
enum: [ | |||||
{ | { | ||||
label: "男", | label: "男", | ||||
value: "GENDER_MALE" | value: "GENDER_MALE" | ||||
@@ -164,6 +161,7 @@ function onOpen(opt: FormOptEnum, record: {} | SysUserPersonnel.SysUserPerInfo = | |||||
// 刷新表格 | // 刷新表格 | ||||
const RefreshTable = () => { | const RefreshTable = () => { | ||||
proTable.value!.pageable.pageNum = 1; | |||||
proTable.value?.refresh(); | proTable.value?.refresh(); | ||||
// treeFilter.value?.refresh(); //刷新树形筛选器 | // treeFilter.value?.refresh(); //刷新树形筛选器 | ||||
} | } | ||||
@@ -270,7 +270,6 @@ const state: any = reactive({ | |||||
oneCard: {} //一卡通消费情况 | oneCard: {} //一卡通消费情况 | ||||
}); | }); | ||||
const genderOptions = ref<any>({ | const genderOptions = ref<any>({ | ||||
GENDER_UNKNOWN: "未知", | |||||
GENDER_MALE: "男", | GENDER_MALE: "男", | ||||
GENDER_FEMALE: "女" | GENDER_FEMALE: "女" | ||||
}); | }); | ||||