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
d4e36b38
Commit
d4e36b38
authored
Dec 24, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 用户机构树默认不展开
parent
9cd4e60d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
UserManage.js
src/pages/userCenter/userManage/UserManage.js
+6
-4
No files found.
src/pages/userCenter/userManage/UserManage.js
View file @
d4e36b38
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Tree
,
//
Tree,
Table
,
Space
,
message
,
...
...
@@ -15,6 +15,7 @@ import {
Menu
,
}
from
'antd'
;
import
{
UserOutlined
,
UserAddOutlined
,
UsergroupAddOutlined
,
EditOutlined
,
...
...
@@ -42,6 +43,7 @@ import {
setUserState
as
postSetUserState
,
multiDeleteUsers
,
}
from
'@/services/userCenter/userManage/api'
;
import
Tree
from
'@/components/ExpendableTree'
;
import
classnames
from
'classnames'
;
import
AddUserModal
from
'./AddUserModal'
;
import
AddSubOrgModal
from
'./AddSubOrgModal'
;
...
...
@@ -50,7 +52,6 @@ import DeleteOrgModal from './DeleteOrgModal';
import
RelateRoleModal
from
'./RelateRoleModal'
;
import
EditUserModal
from
'./EditUserModal'
;
import
ChangePasswordModal
from
'./ChangePasswordModal'
;
import
styles
from
'./UserManage.less'
;
const
UserManage
=
()
=>
{
...
...
@@ -281,6 +282,7 @@ const UserManage = () => {
return
{
title
:
org
.
text
,
key
:
org
.
id
,
// icon: <UserOutlined style={{ display: 'inline' }} />,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children
:
haveChildren
?
org
.
children
.
map
(
i
=>
mapTree
(
i
))
:
[],
};
...
...
@@ -735,7 +737,7 @@ const UserManage = () => {
blockNode
autoExpandParent
// expandedKeys={[currentSelectOrg]}
defaultExpandAll
//
defaultExpandAll
selectedKeys
=
{[
currentSelectOrg
]}
onSelect
=
{
onSelect
}
treeData
=
{
treeData
.
map
(
t
=>
mapTree
(
t
))}
...
...
@@ -889,7 +891,7 @@ const UserManage = () => {
<
Tree
showIcon
=
"true"
showLine
=
{{
showLeafIcon
:
false
}}
defaultExpandAll
=
"true"
// defaultExpandAll
// 未切换时原先的节点,注意要转字符串
selectedKeys
=
{[
`
${
currentSelectOldOrg
}
`
]}
onSelect
=
{
value
=>
{
...
...
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