Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
9acd1f6b
Commit
9acd1f6b
authored
Nov 10, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: userStyle
parent
9ebaced0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
67 deletions
+55
-67
UserManage.js
src/pages/userCenter/UserManage.js
+43
-66
UserManage.less
src/pages/userCenter/UserManage.less
+12
-1
No files found.
src/pages/userCenter/UserManage.js
View file @
9acd1f6b
...
...
@@ -22,16 +22,15 @@ import {
FolderAddTwoTone
,
EditTwoTone
,
DeleteTwoTone
,
PlayCircleOutlined
,
ShareAltOutlined
,
Key
Outlined
,
Unlock
Outlined
,
ApartmentOutlined
,
SearchOutlined
,
StopOutlined
,
}
from
'@ant-design/icons'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
// import classnames from 'classnames';
import
{
get
}
from
'../../services'
;
//
import { get } from '../../services';
import
styles
from
'./UserManage.less'
;
import
ListCardItem
from
'../orgnazation/listCardItem'
;
import
{
...
...
@@ -110,30 +109,39 @@ const UserManage = () => {
title
:
'登录名'
,
dataIndex
:
'loginName'
,
key
:
'loginName'
,
fixed
:
'left'
,
width
:
100
,
},
{
title
:
'用户姓名'
,
dataIndex
:
'userName'
,
key
:
'userName'
,
width
:
100
,
},
{
title
:
'手机号码'
,
dataIndex
:
'phone'
,
key
:
'phone'
,
width
:
150
,
ellipsis
:
true
,
},
{
title
:
'钉钉账户'
,
dataIndex
:
'ddid'
,
key
:
'ddid'
,
width
:
150
,
},
{
title
:
'微信账户'
,
dataIndex
:
'wxid'
,
key
:
'wxid'
,
width
:
150
,
},
{
title
:
'操作'
,
key
:
'action'
,
fixed
:
'right'
,
width
:
300
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<
Space
size
=
"middle"
>
...
...
@@ -150,7 +158,7 @@ const UserManage = () => {
/
>
<
/Tooltip
>
<
Tooltip
title
=
"修改密码"
>
<
Key
Outlined
<
Unlock
Outlined
onClick
=
{()
=>
changePassword
(
record
)}
style
=
{{
fontSize
:
'16px'
,
color
:
'#1890FF'
}}
/
>
...
...
@@ -242,7 +250,7 @@ const UserManage = () => {
<
/
>
),
key
:
org
.
id
,
// icon: <
CaretDow
nOutlined />,
// icon: <
Solutio
nOutlined />,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children
:
haveChildren
?
org
.
children
.
map
(
i
=>
mapTree
(
i
))
:
[],
};
...
...
@@ -252,13 +260,14 @@ const UserManage = () => {
return
{
title
:
`
${
org
.
text
}
`
,
key
:
org
.
id
,
// icon: <
CaretDow
nOutlined />,
// icon: <
Solutio
nOutlined />,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children
:
haveChildren
?
org
.
children
.
map
(
i
=>
mapTree1
(
i
))
:
[],
};
};
const
updateTrees
=
()
=>
const
updateTrees
=
()
=>
{
setTreeLoading
(
true
);
getUserTree
(
-
1
,
-
1
)
.
then
(
res
=>
{
if
(
res
.
length
>
0
)
{
...
...
@@ -276,6 +285,7 @@ const UserManage = () => {
setTreeLoading
(
false
);
message
.
error
(
err
);
});
};
// 获取用户机构树
useEffect
(()
=>
{
...
...
@@ -297,6 +307,7 @@ const UserManage = () => {
setTableLoading
(
false
);
const
table
=
res
.
root
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
item
.
phone
=
item
.
phone
||
'-'
;
item
.
ddid
=
item
.
ddid
?
'已绑定'
:
'未绑定'
;
item
.
wxid
=
item
.
wxid
?
'已绑定'
:
'未绑定'
;
return
item
;
...
...
@@ -337,7 +348,7 @@ const UserManage = () => {
const
deleteOrg
=
(
e
,
title
,
id
)
=>
{
// e.stopPropagation();
setDeleteOrgVisible
(
true
);
setOrgTitle
(
`
在
${
title
}
下添加用户
`
);
setOrgTitle
(
`
删除组织
${
title
}
`
);
setOrgID
(
id
);
// 删除后默认选择第一个组织
setTreeState
(
true
);
...
...
@@ -399,7 +410,6 @@ const UserManage = () => {
if
(
res
.
success
)
{
// setSearchUserVisible(false);
setSearchData
(
res
.
root
);
// setSearchData(res.root);
}
else
{
notification
.
error
({
message
:
'提交失败'
,
...
...
@@ -488,7 +498,7 @@ const UserManage = () => {
message
:
'提交成功'
,
});
// 重新获取机构树与用户表
getUserTree
(
-
1
,
-
1
);
updateTrees
(
);
onSelect
([
orgID
]);
}
else
{
notification
.
error
({
...
...
@@ -703,7 +713,7 @@ const UserManage = () => {
style
=
{{
fontSize
:
'18px'
,
float
:
'right'
,
margin
Left
:
'
12px'
,
margin
:
'4px 4px 0px
12px'
,
color
:
'#1890FF'
,
}}
onClick
=
{
searchUser
}
...
...
@@ -711,16 +721,21 @@ const UserManage = () => {
<
/Tooltip
>
<
Tooltip
title
=
"添加下级机构"
>
<
FolderAddTwoTone
style
=
{{
fontSize
:
'18px'
,
float
:
'right'
}}
style
=
{{
fontSize
:
'18px'
,
float
:
'right'
,
marginTop
:
'4px'
,
}}
onClick
=
{
e
=>
addSubOrg
(
e
,
'根目录'
,
'-1'
)}
/
>
<
/Tooltip
>
<
/span
>
{
treeData
.
length
>
0
&&
(
<
Spin
spinning
=
{
treeLoading
}
tip
=
"loading"
>
<
Spin
spinning
=
{
treeLoading
}
tip
=
"loading
...
"
>
<
Tree
showLine
=
"true"
//
showLine="true"
showIcon
=
"true"
showLine
=
{{
showLeafIcon
:
false
}}
defaultExpandAll
=
"true"
selectedKeys
=
{[
currentSelectOrg
]}
onSelect
=
{
onSelect
}
...
...
@@ -731,10 +746,11 @@ const UserManage = () => {
<
/div
>
<
div
className
=
{
styles
.
userContainer
}
>
<
Table
bordered
columns
=
{
columns
}
dataSource
=
{
tableData
}
loading
=
{
tableLoading
}
scroll
=
{{
scrollToFirstRowOnChange
:
'true'
,
x
:
true
}}
scroll
=
{{
scrollToFirstRowOnChange
:
'true'
,
x
:
'max-content'
}}
/
>
<
/div
>
{
/* 查找用户 */
}
...
...
@@ -756,11 +772,7 @@ const UserManage = () => {
<
Form
.
Item
name
=
"key"
label
=
"关键字搜索"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入登录名称/用户名称/手机号 ,回车键查找"
...
...
@@ -769,6 +781,7 @@ const UserManage = () => {
<
/Form.Item
>
<
/Form
>
<
Table
bordered
columns
=
{
searchColumns
}
dataSource
=
{
searchData
}
onRow
=
{
record
=>
({
...
...
@@ -792,33 +805,21 @@ const UserManage = () => {
<
Form
.
Item
name
=
"loginName"
label
=
"登录名称"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入登录名称"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"password"
label
=
"账户密码"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入账户密码"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"userName"
label
=
"用户名称"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入用户姓名"
/>
<
/Form.Item
>
...
...
@@ -843,11 +844,7 @@ const UserManage = () => {
<
Form
.
Item
name
=
"OUName"
label
=
"机构名称"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入机构名称"
/>
<
/Form.Item
>
...
...
@@ -869,11 +866,7 @@ const UserManage = () => {
<
Form
.
Item
name
=
"OUName"
label
=
"机构名称"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入机构名称"
/>
<
/Form.Item
>
...
...
@@ -942,8 +935,8 @@ const UserManage = () => {
<
span
>
请选择要更改的目标机构:
<
/span
>
{
changeOrgVisible
&&
treeData2
.
length
>
0
&&
(
<
Tree
showLine
=
"true"
showIcon
=
"true"
showLine
=
{{
showLeafIcon
:
false
}}
defaultExpandAll
=
"true"
defaultSelectedKeys
=
{[
currentSelectOrg
]}
onSelect
=
{
props
=>
{
...
...
@@ -969,22 +962,14 @@ const UserManage = () => {
<
Form
.
Item
name
=
"newPassword"
label
=
"新- 密-码"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入新密码"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"passwordConfirm"
label
=
"确认密码"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"再次确认新密码"
/>
<
/Form.Item
>
...
...
@@ -1003,22 +988,14 @@ const UserManage = () => {
<
Form
.
Item
name
=
"loginName"
label
=
"登录名称"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入登录名称"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"userName"
label
=
"用户姓名"
rules
=
{[
{
required
:
true
,
},
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入用户姓名"
/>
<
/Form.Item
>
...
...
src/pages/userCenter/UserManage.less
View file @
9acd1f6b
...
...
@@ -29,7 +29,7 @@
.ant-tree-treenode:hover{
.iconWraper1>span{
margin-left: 12px;
font-size: 1
6
px;
font-size: 1
8
px;
display: inline-block;
}
}
...
...
@@ -45,6 +45,10 @@
background: white;
.ant-tree{
padding-top: 6px;
.ant-tree-switcher{
line-height: 1;
color:#1890FF;
}
}
}
.userContainer{
...
...
@@ -58,3 +62,9 @@
}
}
}
.ant-modal-root{
.ant-tree-switcher{
line-height: 1;
color:#1890FF;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment