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

perf: 查找用户编辑修改

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