Commit 385cda55 authored by 邓超's avatar 邓超

fix: 修改用户管理样式问题及保存交互优化

parent f4a9dc56
Pipeline #65373 passed with stages
/* eslint-disable import/no-unresolved */
import React, { useEffect, useState } from 'react';
import { Modal, Form, Input, notification, message } from 'antd';
import { Modal, Form, Input, notification, message, Divider } from 'antd';
import voca from 'voca';
import classNames from 'classnames';
import { editUser, updateUserPassword } from '@/services/userManage/api';
......@@ -86,13 +86,13 @@ const EditUserModal = props => {
});
return;
}
if (newPassword === '' || passwordConfirm === '') {
notification.error({
message: '提交失败',
description: '带*号为必填项,不能为空',
});
return;
}
// if ((newPassword && passwordConfirm === '') || (passwordConfirm && newPassword === '')) {
// notification.error({
// message: '提交失败',
// description: '请填写密码',
// });
// return;
// }
if ((newPassword && newPassword.length < 6) || (passwordConfirm && passwordConfirm < 6)) {
notification.error({
message: '提交失败',
......@@ -120,8 +120,11 @@ const EditUserModal = props => {
if (res.msg === '') {
onCancel();
// 重新获取用户表
// eslint-disable-next-line no-unused-expressions
// currentSelectOrg === '-1' ? submitSearchUser() : onSelect([currentSelectOrg]);
if (!newPassword) {
// eslint-disable-next-line no-unused-expressions
currentSelectOrg === '-1' ? submitSearchUser() : onSelect([currentSelectOrg]);
}
notification.success({
message: '提交成功',
duration: 2,
......@@ -313,6 +316,16 @@ const EditUserModal = props => {
<Input placeholder="请输入电子邮箱" autoComplete="off" />
</Form.Item>
</Form>
<Divider
orientation="left"
style={{
borderTopColor: '#99bbe8',
color: '#15428b',
fontWeight: 700,
}}
>
重置密码
</Divider>
<div className={styles.modalContent}>
<Form form={passwordForm} labelCol={{ span: 4 }} onFieldsChange={changeValue}>
<Form.Item name="oldPassword" label="原始密码">
......@@ -327,7 +340,7 @@ const EditUserModal = props => {
pattern: /^[a-zA-Z0-9_]{6,16}$/,
message: '长度6-16位,支持字母与数字,允许下划线',
},
{ required: true },
// { required: true },
]}
>
<Input.Password
......@@ -362,7 +375,7 @@ const EditUserModal = props => {
pattern: /^[a-zA-Z0-9_]{6,16}$/,
message: '长度6-16位,支持字母与数字,允许下划线',
},
{ required: true },
// { required: true },
]}
>
<Input.Password
......
......@@ -1069,6 +1069,11 @@ const UserManage = () => {
// 查找用户
const submitSearchUser = () => {
if (!searchWord || searchWord.trim(' ').length == 0) {
message.warning('请输入搜索内容');
return;
}
GetUserByKeyNew({ key: searchWord })
.then(res => {
if (res.code === 0) {
......@@ -1644,7 +1649,7 @@ const UserManage = () => {
</span>
<span style={{ float: 'right', margin: '10px' }}>
<Search
style={{ width: 260 }}
style={{ width: 260, marginRight: '15px' }}
placeholder="搜索登录名/用户姓名/手机号"
onSearch={submitSearchUser}
onChange={e => handleSearch(e)}
......@@ -1652,7 +1657,7 @@ const UserManage = () => {
value={searchWord}
/>
<Button icon={<SyncOutlined />} onClick={handleReset}>
<Button style={{ marginRight: '15px' }} icon={<SyncOutlined />} onClick={handleReset}>
重置
</Button>
......
......@@ -290,8 +290,7 @@
}
.ant-btn {
margin: 0px 10px;
// margin: 0px 10px;
.ant-btn-primary {
background: #50aefc;
}
......
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