Commit 15e1ce8b authored by 皮倩雯's avatar 皮倩雯

fix: '修改用户管理界面样式'

parent 074320cf
Pipeline #45746 skipped with stages
...@@ -71,7 +71,8 @@ const AddUserModal = props => { ...@@ -71,7 +71,8 @@ const AddUserModal = props => {
}; };
const title = ( const title = (
<span> <span>
<span style={{ fontWeight: 'bold', color: 'red' }}>{orgTitle1}</span>下添加机构 <span style={{ fontWeight: 'bold', color: 'rgb(24, 144, 255)' }}>{orgTitle1}</span>
下添加机构
</span> </span>
); );
return ( return (
......
...@@ -95,7 +95,8 @@ const AddUserModal = props => { ...@@ -95,7 +95,8 @@ const AddUserModal = props => {
}; };
const title = ( const title = (
<span> <span>
<span style={{ fontWeight: 'bold', color: 'red' }}>{orgTitle1}</span>下添加用户 <span style={{ fontWeight: 'bold', color: 'rgb(24, 144, 255)' }}>{orgTitle1}</span>
下添加用户
</span> </span>
); );
...@@ -120,13 +121,13 @@ const AddUserModal = props => { ...@@ -120,13 +121,13 @@ const AddUserModal = props => {
label="登录名称" label="登录名称"
rules={[ rules={[
{ {
pattern: new RegExp(/^[^\u4e00-\u9fa5]+$/), pattern: /^[a-zA-Z0-9_]{0,}$/,
message: '不支持中文', message: '不支持中文和特殊字符',
}, },
{ required: true }, { required: true },
]} ]}
> >
<Input placeholder="登录名称不支持中文" /> <Input placeholder="登录名称不支持中文与特殊字符" maxLength="64" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
...@@ -135,15 +136,23 @@ const AddUserModal = props => { ...@@ -135,15 +136,23 @@ const AddUserModal = props => {
rules={[ rules={[
{ {
pattern: /^(?=.*[a-zA-Z\d])(?=.*([a-zA-Z].*))(?=.*[0-9].*)[!-~]{6,16}$/, pattern: /^(?=.*[a-zA-Z\d])(?=.*([a-zA-Z].*))(?=.*[0-9].*)[!-~]{6,16}$/,
message: '密码长度6-16位,且必须包含数字和字母,不能存在空格', message: '密码长度6-16位,且必须包含数字和字母不能存在空格',
}, },
{ required: true }, { required: true },
]} ]}
> >
<Input placeholder="请输入账户密码,至少6位" /> <Input placeholder="请输入账户密码,至少6位" maxlength="16" />
</Form.Item> </Form.Item>
<Form.Item hasFeedback name="userName" label="用户名称" rules={[{ required: true }]}> <Form.Item
<Input placeholder="请输入用户姓名" /> hasFeedback
name="userName"
label="用户姓名"
rules={[
{ required: true },
{ pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, message: '不支持特殊字符' },
]}
>
<Input placeholder="用户姓名不支持特殊字符" maxLength="40" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
...@@ -151,12 +160,12 @@ const AddUserModal = props => { ...@@ -151,12 +160,12 @@ const AddUserModal = props => {
label="手机号码" label="手机号码"
rules={[ rules={[
{ {
pattern: new RegExp(/^1(3|4|5|6|7|8|9)\d{9}$/), pattern: new RegExp(/^1[0-9]{10}$/),
message: '请输入11位手机号码!', message: '手机号码以1开头11位',
}, },
]} ]}
> >
<Input placeholder="请输入11位手机号码" autoComplete="off" /> <Input placeholder="请输入11位手机号码" maxlength="11" autoComplete="off" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
......
...@@ -12,7 +12,7 @@ const ChangePasswordModal = props => { ...@@ -12,7 +12,7 @@ const ChangePasswordModal = props => {
newPassword: '', newPassword: '',
passwordConfirm: '', passwordConfirm: '',
}); });
}, [currentUser]); }, [visible]);
// 提交-修改密码 // 提交-修改密码
const submitChangePassword = () => { const submitChangePassword = () => {
...@@ -75,9 +75,18 @@ const ChangePasswordModal = props => { ...@@ -75,9 +75,18 @@ const ChangePasswordModal = props => {
}); });
} }
}; };
const title = (
<span>
修改用户
<span style={{ fontWeight: 'bold', color: 'rgb(24, 144, 255)' }}>
{currentUser.userName}
</span>
的密码
</span>
);
return ( return (
<Modal <Modal
title="修改密码" title={title}
visible={visible} visible={visible}
onOk={submitChangePassword} onOk={submitChangePassword}
maskClosable={false} maskClosable={false}
...@@ -103,16 +112,28 @@ const ChangePasswordModal = props => { ...@@ -103,16 +112,28 @@ const ChangePasswordModal = props => {
<Form.Item <Form.Item
name="newPassword" name="newPassword"
label="新密码" label="新密码"
rules={[{ required: true, message: '不能为空' }]} rules={[
{
pattern: /^(?=.*[a-zA-Z\d])(?=.*([a-zA-Z].*))(?=.*[0-9].*)[!-~]{6,16}$/,
message: '密码长度6-16位,且必须包含数字和字母,不能存在空格',
},
{ required: true },
]}
> >
<Input placeholder="请输入新密码" type="password" autoComplete="off" /> <Input placeholder="请输入新密码" autoComplete="off" maxLength="16" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="passwordConfirm" name="passwordConfirm"
label="确认密码" label="确认密码"
rules={[{ required: true, message: '不能为空' }]} rules={[
{
pattern: /^(?=.*[a-zA-Z\d])(?=.*([a-zA-Z].*))(?=.*[0-9].*)[!-~]{6,16}$/,
message: '密码长度6-16位,且必须包含数字和字母,不能存在空格',
},
{ required: true },
]}
> >
<Input placeholder="再次确认新密码" type="password" autoComplete="off" /> <Input placeholder="再次确认新密码" autoComplete="off" maxLength="16" />
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 17:26:14 * @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-10 14:46:39 * @LastEditTime: 2022-03-11 15:54:02
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
...@@ -10,24 +10,16 @@ import { Modal, Form, Input, notification, message } from 'antd'; ...@@ -10,24 +10,16 @@ import { Modal, Form, Input, notification, message } from 'antd';
import { editOrgInfo } from '@/services/userManage/api'; import { editOrgInfo } from '@/services/userManage/api';
const EditOrgModal = props => { const EditOrgModal = props => {
const { const { visible, orgID, description, onCancel, updateTrees, onSelect, orgTitle1 } = props;
visible,
orgID,
orgTitle,
description,
onCancel,
updateTrees,
onSelect,
orgTitle1,
} = props;
const [editOrgForm] = Form.useForm(); // 添加用户 const [editOrgForm] = Form.useForm(); // 添加用户
useEffect(() => { useEffect(() => {
console.log(orgTitle1);
editOrgForm.setFieldsValue({ editOrgForm.setFieldsValue({
OUName: orgTitle, OUName: orgTitle1,
description, description,
}); });
}, [orgTitle, description]); }, [visible]);
// 提交-编辑当前机构 // 提交-编辑当前机构
const submitEditOrg = () => const submitEditOrg = () =>
...@@ -60,7 +52,7 @@ const EditOrgModal = props => { ...@@ -60,7 +52,7 @@ const EditOrgModal = props => {
}); });
const title = ( const title = (
<span> <span>
编辑<span style={{ fontWeight: 'bold', color: 'red' }}>{orgTitle1}</span> 编辑<span style={{ fontWeight: 'bold', color: '#1890ff' }}>{orgTitle1}</span>信息
</span> </span>
); );
return ( return (
...@@ -70,9 +62,9 @@ const EditOrgModal = props => { ...@@ -70,9 +62,9 @@ const EditOrgModal = props => {
onCancel={onCancel} onCancel={onCancel}
maskClosable={false} maskClosable={false}
destroyOnClose destroyOnClose
afterClose={() => { // afterClose={() => {
editOrgForm.resetFields(); // editOrgForm.resetFields();
}} // }}
onOk={submitEditOrg} onOk={submitEditOrg}
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
......
...@@ -14,13 +14,14 @@ const EditUserModal = props => { ...@@ -14,13 +14,14 @@ const EditUserModal = props => {
); // 邮箱 ); // 邮箱
useEffect(() => { useEffect(() => {
console.log(currentUser);
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: voca.stripTags(currentUser.phone) || '', phone: voca.stripTags(currentUser.phone) || '',
email: currentUser.email || '', email: currentUser.email || '',
}); });
}, [currentUser]); }, [visible]);
// 提交-编辑用户 // 提交-编辑用户
const submitEditUser = () => { const submitEditUser = () => {
...@@ -92,15 +93,24 @@ const EditUserModal = props => { ...@@ -92,15 +93,24 @@ const EditUserModal = props => {
}); });
} }
}; };
const title = (
<span>
编辑用户
<span style={{ fontWeight: 'bold', color: 'rgb(24, 144, 255)' }}>
{currentUser.userName}
</span>
的信息
</span>
);
return ( return (
<Modal <Modal
title="编辑用户" title={title}
visible={visible} visible={visible}
maskClosable={false} maskClosable={false}
destroyOnClose destroyOnClose
afterClose={() => { // afterClose={() => {
editUserForm.resetFields(); // editUserForm.resetFields();
}} // }}
onOk={submitEditUser} onOk={submitEditUser}
onCancel={() => { onCancel={() => {
onCancel(); onCancel();
...@@ -115,11 +125,30 @@ const EditUserModal = props => { ...@@ -115,11 +125,30 @@ const EditUserModal = props => {
cancelText="取消" cancelText="取消"
> >
<Form form={editUserForm} labelCol={{ span: 4 }}> <Form form={editUserForm} labelCol={{ span: 4 }}>
<Form.Item hasFeedback name="loginName" label="登录名称" rules={[{ message: '不能为空' }]}> <Form.Item
<Input placeholder="请输入登录名称" /> hasFeedback
name="loginName"
label="登录名称"
rules={[
{
pattern: /^[a-zA-Z0-9_]{0,}$/,
message: '不支持中文和特殊字符',
},
{ required: true },
]}
>
<Input placeholder="登录名称不支持中文与特殊字符" maxLength="64" />
</Form.Item> </Form.Item>
<Form.Item hasFeedback name="userName" label="用户姓名" rules={[{ message: '不能为空' }]}> <Form.Item
<Input placeholder="请输入用户姓名" /> hasFeedback
name="userName"
label="用户姓名"
rules={[
{ required: true },
{ pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, message: '不支持特殊字符' },
]}
>
<Input placeholder="用户姓名不支持特殊字符" maxLength="40" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
...@@ -127,12 +156,12 @@ const EditUserModal = props => { ...@@ -127,12 +156,12 @@ const EditUserModal = props => {
label="手机号码" label="手机号码"
rules={[ rules={[
{ {
pattern: new RegExp(/^1(3|4|5|6|7|8|9)\d{9}$/), pattern: new RegExp(/^1[0-9]{10}$/),
message: '请输入11位手机号码!', message: '手机号码以1开头11位',
}, },
]} ]}
> >
<Input placeholder="请输入11位手机号码" autoComplete="off" /> <Input placeholder="请输入11位手机号码" autoComplete="off" maxlength="11" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
hasFeedback hasFeedback
......
...@@ -127,7 +127,10 @@ const RelateRoleModal = props => { ...@@ -127,7 +127,10 @@ const RelateRoleModal = props => {
const title1 = ( const title1 = (
<span> <span>
<span> <span>
关联角色<span style={{ fontWeight: 'bold', color: 'red' }}>{currentUser.userName}</span> 关联角色
<span style={{ fontWeight: 'bold', color: 'rgb(24, 144, 255)' }}>
{currentUser.userName}
</span>
</span> </span>
</span> </span>
); );
......
...@@ -38,6 +38,7 @@ import { ...@@ -38,6 +38,7 @@ import {
EllipsisOutlined, EllipsisOutlined,
PlusOutlined, PlusOutlined,
SyncOutlined, SyncOutlined,
ClusterOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
import voca from 'voca'; import voca from 'voca';
...@@ -389,7 +390,14 @@ const UserManage = () => { ...@@ -389,7 +390,14 @@ const UserManage = () => {
return { return {
title: ( title: (
<div className={styles.title1}> <div className={styles.title1}>
<span className={styles.titleText}>{org.text}</span> <span className={styles.titleText}>
{org.children.length == 0 ? (
<ApartmentOutlined style={{ fontSize: '14px', color: '#1890FF' }} />
) : (
<span />
)}
<span style={{ marginLeft: '5px' }}>{org.text}</span>
</span>
<span <span
className={classnames({ className={classnames({
[styles.tip1]: true, [styles.tip1]: true,
...@@ -405,7 +413,7 @@ const UserManage = () => { ...@@ -405,7 +413,7 @@ const UserManage = () => {
<Tooltip title="" className={styles.fs1}> <Tooltip title="" className={styles.fs1}>
<Dropdown overlay={orgButtonMenu}> <Dropdown overlay={orgButtonMenu}>
<PlusOutlined <PlusOutlined
style={{ marginLeft: 20 }} style={{ marginLeft: 20, lineHeight: '24px' }}
onClick={e => e.stopPropagation()} onClick={e => e.stopPropagation()}
onMouseEnter={e => { onMouseEnter={e => {
setOrgID(org); setOrgID(org);
...@@ -417,7 +425,7 @@ const UserManage = () => { ...@@ -417,7 +425,7 @@ const UserManage = () => {
</Tooltip> </Tooltip>
<Dropdown overlay={orgButtonMenu1}> <Dropdown overlay={orgButtonMenu1}>
<EllipsisOutlined <EllipsisOutlined
style={{ marginLeft: 10, fontSize: '20px' }} style={{ marginLeft: 10, fontSize: '20px', lineHeight: '24px' }}
onClick={e => e.stopPropagation()} onClick={e => e.stopPropagation()}
onMouseEnter={e => { onMouseEnter={e => {
setOrgID(org); setOrgID(org);
...@@ -1332,23 +1340,31 @@ const UserManage = () => { ...@@ -1332,23 +1340,31 @@ const UserManage = () => {
// 机构操作 // 机构操作
const orgButtonMenu = ( const orgButtonMenu = (
<Menu onClick={e => addChange(e)}> <Menu onClick={e => addChange(e)}>
<Menu.Item key="1" onClick={addUser} icon={<UserAddOutlined />}> <Menu.Item key="1" onClick={addUser} icon={<UserAddOutlined style={{ marginTop: '5px' }} />}>
添加用户 添加用户
</Menu.Item> </Menu.Item>
<Menu.Item key="2" onClick={addSubOrg} icon={<UsergroupAddOutlined />}> <Menu.Item
key="2"
onClick={addSubOrg}
icon={<ClusterOutlined style={{ marginTop: '5px' }} />}
>
添加下级机构 添加下级机构
</Menu.Item> </Menu.Item>
</Menu> </Menu>
); );
const orgButtonMenu1 = ( const orgButtonMenu1 = (
<Menu onClick={e => addChange(e)}> <Menu onClick={e => addChange(e)}>
<Menu.Item key="3" onClick={editOrg} icon={<EditOutlined />}> <Menu.Item key="3" onClick={editOrg} icon={<EditOutlined style={{ marginTop: '5px' }} />}>
编辑当前机构 编辑当前机构
</Menu.Item> </Menu.Item>
<Menu.Item key="4" onClick={deleteOrg} icon={<DeleteOutlined />}> <Menu.Item key="4" onClick={deleteOrg} icon={<DeleteOutlined style={{ marginTop: '5px' }} />}>
删除当前机构 删除当前机构
</Menu.Item> </Menu.Item>
<Menu.Item key="5" onClick={EditOrgScope} icon={<BorderlessTableOutlined />}> <Menu.Item
key="5"
onClick={EditOrgScope}
icon={<BorderlessTableOutlined style={{ marginTop: '5px' }} />}
>
编辑机构范围 编辑机构范围
</Menu.Item> </Menu.Item>
</Menu> </Menu>
......
...@@ -101,9 +101,9 @@ ...@@ -101,9 +101,9 @@
width: 90%; width: 90%;
} }
} }
.anticon svg { // .anticon svg {
margin-top: -3px; // margin-top: -3px;
} // }
.ant-popover-message { .ant-popover-message {
position: relative; position: relative;
padding: 0px 0 0px; padding: 0px 0 0px;
...@@ -141,6 +141,9 @@ ...@@ -141,6 +141,9 @@
.ant-table.ant-table-bordered > .ant-table-container { .ant-table.ant-table-bordered > .ant-table-container {
min-width: calc(100vw - 582px); min-width: calc(100vw - 582px);
} }
.ant-tree-switcher_close .ant-tree-switcher-icon svg {
margin: auto;
}
.orgContainer { .orgContainer {
height: calc(100vh - 74px); height: calc(100vh - 74px);
width: 320px; width: 320px;
...@@ -156,7 +159,6 @@ ...@@ -156,7 +159,6 @@
padding-top: 6px; padding-top: 6px;
.ant-tree-switcher { .ant-tree-switcher {
line-height: 1; line-height: 1;
margin-right: 0px !important;
color: #1890ff; color: #1890ff;
.ant-tree-switcher-line-icon { .ant-tree-switcher-line-icon {
margin-left: 5px; margin-left: 5px;
...@@ -200,14 +202,14 @@ ...@@ -200,14 +202,14 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
width: 100%; width: 25%;
} }
.title1:hover { .title1:hover {
.tip1 { .tip1 {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
width: 100%; width: 25%;
} }
} }
.titleText { .titleText {
...@@ -277,7 +279,6 @@ ...@@ -277,7 +279,6 @@
.ant-tree-switcher { .ant-tree-switcher {
line-height: 1; line-height: 1;
color: #1890ff; color: #1890ff;
margin-right: 0px !important;
} }
.ant-checkbox-group .ant-checkbox-group-item { .ant-checkbox-group .ant-checkbox-group-item {
margin-right: 0px !important; margin-right: 0px !important;
......
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