Commit f581f0a1 authored by 陈前坚's avatar 陈前坚

perf: 查找用户编辑修改

parent 57c4eeab
Pipeline #22221 skipped with stages
......@@ -17,16 +17,16 @@ const EditUserModal = props => {
editUserForm.setFieldsValue({
loginName: voca.stripTags(currentUser.loginName),
userName: voca.stripTags(currentUser.userName),
phone: currentUser.phone || '',
phone: voca.stripTags(currentUser.phone) || '',
email: currentUser.email || '',
});
}, [currentUser]);
// 提交-编辑用户
const submitEditUser = () => {
const loginName = editUserForm.getFieldValue('loginName');
const userName = editUserForm.getFieldValue('userName');
const phone = editUserForm.getFieldValue('phone') || '';
const loginName = voca.stripTags(editUserForm.getFieldValue('loginName'));
const userName = voca.stripTags(editUserForm.getFieldValue('userName'));
const phone = voca.stripTags(editUserForm.getFieldValue('phone')) || '';
const email = editUserForm.getFieldValue('email') || '';
// 正则验证
if (loginName === '') {
......@@ -83,8 +83,8 @@ const EditUserModal = props => {
editUserForm.setFieldsValue({
loginName: voca.stripTags(currentUser.loginName),
userName: voca.stripTags(currentUser.userName),
phone: '',
email: '',
phone: voca.stripTags(currentUser.phone) || '',
email: currentUser.email || '',
});
})
.catch(err => {
......@@ -102,8 +102,8 @@ const EditUserModal = props => {
editUserForm.setFieldsValue({
loginName: voca.stripTags(currentUser.loginName),
userName: voca.stripTags(currentUser.userName),
phone: '',
email: '',
phone: voca.stripTags(currentUser.phone) || '',
email: currentUser.email || '',
});
}}
okText="确认"
......
......@@ -17,7 +17,6 @@ const RelateRoleModal = props => {
multiRelateRoles,
onCancel,
onSelect,
submitSearchUser,
loading,
} = props;
const { TabPane } = Tabs;
......@@ -83,9 +82,9 @@ const RelateRoleModal = props => {
if (res.code === 0) {
onCancel();
// 跳转到组织重新请求改机构下用户数据,查找用户时currentSelectOrg为空数组,不需要重新请求
if(currentSelectOrg.length!==0) {
if (currentSelectOrg.length !== 0) {
onSelect([currentSelectOrg]);
};
}
notification.success({
message: '提交成功',
duration: 2,
......
......@@ -230,7 +230,6 @@ const UserManage = () => {
style={{ fontSize: '16px' }}
/>
</Tooltip>
{(record.state === '0' || record.state === null) && (
<>
<Tooltip title="冻结用户">
......@@ -669,8 +668,11 @@ const UserManage = () => {
message: '提交成功',
duration: 2,
});
// 重新获取用户表
onSelect([currentSelectOrg]);
// 重新获取用户表,查找用户时currentSelectOrg为空数组,无需跳转
// eslint-disable-next-line no-unused-expressions
currentSelectOrg.length === 0
? submitSearchUser()
: onSelect([currentSelectOrg]);
} else {
notification.error({
message: '提交失败',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment