fix: 修复pure问题
This commit is contained in:
@@ -9,7 +9,7 @@ const props = withDefaults(defineProps<FormProps>(), {
|
||||
formInline: () => ({
|
||||
title: "新增",
|
||||
higherDeptOptions: [],
|
||||
deptId: "",
|
||||
deptId: null,
|
||||
nick: "",
|
||||
userName: "",
|
||||
password: "",
|
||||
@@ -31,6 +31,10 @@ const sexOptions = [
|
||||
{
|
||||
value: "Woman",
|
||||
label: "女"
|
||||
},
|
||||
{
|
||||
value: "Unknown",
|
||||
label: "未知"
|
||||
}
|
||||
];
|
||||
const ruleFormRef = ref();
|
||||
|
||||
@@ -303,13 +303,13 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
||||
const resetForm = formEl => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
form.deptId = "";
|
||||
form.deptId = null;
|
||||
treeRef.value.onTreeReset();
|
||||
onSearch();
|
||||
};
|
||||
|
||||
function onTreeSelect({ id, selected }) {
|
||||
form.deptId = selected ? id : "";
|
||||
form.deptId = selected ? id : null;
|
||||
onSearch();
|
||||
}
|
||||
|
||||
@@ -338,13 +338,13 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
||||
formInline: {
|
||||
title,
|
||||
higherDeptOptions: formatHigherDeptOptions(higherDeptOptions.value),
|
||||
deptId: data?.deptId ?? 0,
|
||||
deptId: data?.deptId ?? null,
|
||||
nick: data?.nick ?? "",
|
||||
userName: data?.userName ?? "",
|
||||
password: data?.password ?? "",
|
||||
phone: data?.phone ?? "",
|
||||
phone: data?.phone ?? null,
|
||||
email: data?.email ?? "",
|
||||
sex: data?.sex ?? "",
|
||||
sex: data?.sex ?? "Unknown",
|
||||
state: data?.state ?? true,
|
||||
remark: data?.remark ?? "",
|
||||
roleIds: data?.roles?.map(r => r.id),
|
||||
@@ -362,7 +362,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
||||
const curData = options.props.formInline as FormItemProps;
|
||||
|
||||
function chores() {
|
||||
message(`您${title}了用户名称为${curData.userName}的这条数据`, {
|
||||
message(`您${title}了用户名称为${curData.userName}的用户`, {
|
||||
type: "success"
|
||||
});
|
||||
done(); // 关闭弹框
|
||||
|
||||
@@ -8,6 +8,7 @@ export const formRules = reactive(<FormRules>{
|
||||
userName: [{ required: true, message: "用户名称为必填项", trigger: "blur" }],
|
||||
password: [{ required: true, message: "用户密码为必填项", trigger: "blur" }],
|
||||
phone: [
|
||||
{ required: true, message: "手机号为必填项", trigger: "blur" },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value === "") {
|
||||
|
||||
Reference in New Issue
Block a user