| | |
| | | <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="手机号码" prop="phonenumber"> |
| | | <el-input |
| | | v-model="queryParams.phonenumber" |
| | | placeholder="请输入手机号码" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="用户状态" clearable > |
| | | <el-select v-model="queryParams.status" placeholder="用户状态" clearable> |
| | | <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | import { UserForm, UserQuery, UserVO } from '@/api/system/user/types'; |
| | | import { DeptVO } from '@/api/system/dept/types'; |
| | | import { RoleVO } from '@/api/system/role/types'; |
| | | import { PostVO } from '@/api/system/post/types'; |
| | | import { PostQuery, PostVO } from '@/api/system/post/types'; |
| | | import { treeselect } from '@/api/system/dept'; |
| | | import { globalHeaders } from '@/utils/request'; |
| | | import { to } from 'await-to-js'; |
| | | import { optionselect } from '@/api/system/post'; |
| | | |
| | | const router = useRouter(); |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | |
| | | message: '用户密码长度必须介于 5 和 20 之间', |
| | | trigger: 'blur' |
| | | }, |
| | | { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" } |
| | | { pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\\ |', trigger: 'blur' } |
| | | ], |
| | | email: [ |
| | | { |
| | |
| | | inputErrorMessage: '用户密码长度必须介于 5 和 20 之间', |
| | | inputValidator: (value) => { |
| | | if (/<|>|"|'|\||\\/.test(value)) { |
| | | return "不能包含非法字符:< > \" ' \\\ |" |
| | | return '不能包含非法字符:< > " \' \\\ |'; |
| | | } |
| | | } |
| | | }) |
| | |
| | | roleOptions.value = data.roles; |
| | | form.value.password = initPassword.value.toString(); |
| | | }; |
| | | |
| | | /** 是否已经更改过岗位 */ |
| | | const updatedPost = ref(true); |
| | | /** 修改按钮操作 */ |
| | | const handleUpdate = async (row?: UserForm) => { |
| | | reset(); |
| | |
| | | form.value.postIds = data.postIds; |
| | | form.value.roleIds = data.roleIds; |
| | | form.value.password = ''; |
| | | /** 编辑 默认未修改过岗位 */ |
| | | updatedPost.value = false; |
| | | }; |
| | | |
| | | /** 提交按钮 */ |
| | |
| | | initPassword.value = response.data; |
| | | }); |
| | | }); |
| | | |
| | | // 监测部门变化加载岗位 |
| | | watch( |
| | | () => form.value.deptId, |
| | | async () => { |
| | | const response = await optionselect(form.value.deptId); |
| | | postOptions.value = response.data; |
| | | /** 判断是否修改过岗位 防止第一次编辑时有岗位信息也被设置为空 */ |
| | | if (updatedPost.value) { |
| | | /** 变化后需要重新选择岗位 */ |
| | | form.value.postIds = []; |
| | | return; |
| | | } |
| | | /** 执行一次后默认设为已经修改过 */ |
| | | updatedPost.value = true; |
| | | } |
| | | ); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |