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
52a1093c
Commit
52a1093c
authored
Dec 09, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 机构树
parent
585aa752
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
35 deletions
+41
-35
miniMenu.jsx
src/pages/mobileConfig/menuconfig/miniMenu.jsx
+1
-1
UserManage.js
src/pages/userCenter/UserManage.js
+40
-34
No files found.
src/pages/mobileConfig/menuconfig/miniMenu.jsx
View file @
52a1093c
...
...
@@ -154,7 +154,7 @@ const MiniMenu = props => {
icon
:
obj
.
menuType
!==
'MiniAppMenuThree'
&&
obj
.
menuType
!==
'MiniAppMenu'
?
(
<
FolderFilled
/>
<
FolderFilled
/>
)
:
(
<
FileOutlined
/>
),
...
...
src/pages/userCenter/UserManage.js
View file @
52a1093c
...
...
@@ -347,7 +347,7 @@ const UserManage = () => {
// 点击树节点,获取当前机构下所有用户
const
onSelect
=
(
props
,
e
)
=>
{
console
.
log
(
e
);
// console.log(props
);
setTableLoading
(
true
);
if
(
e
)
{
setOrgTitle
(
e
.
node
.
title
);
...
...
@@ -358,39 +358,44 @@ const UserManage = () => {
setCurrentSelectOrg
(
props
[
0
]);
}
setOrgID
(
props
[
0
]
||
currentSelectOrg
);
getOneOUUserListNew
(
props
[
0
]
||
currentSelectOrg
)
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setTableLoading
(
false
);
setSearchWord
(
''
);
// 搜索框置空
setOrgTitle
(
res
.
data
.
GroupName
);
// 返回用户表数据结构处理,扁平化
const
temp
=
flatten
(
getUsers
(
res
.
data
));
// 设置过滤字段
let
arr
=
temp
.
map
(
item
=>
item
.
OUName
);
arr
=
arr
.
filter
((
value
,
index
)
=>
arr
.
indexOf
(
value
)
===
index
);
setOrgFilters
(
arr
.
map
(
item
=>
({
text
:
item
,
value
:
item
})));
console
.
log
(
temp
);
setTableLength
(
temp
.
length
);
const
table
=
temp
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
item
.
phoneCopy
=
item
.
phone
;
item
.
phone
=
item
.
phone
||
'-'
;
return
item
;
});
setTableData
(
table
);
}
else
{
// 树节点变化(即props不为空)时才请求,避免重复请求
if
(
props
[
0
])
{
getOneOUUserListNew
(
props
[
0
]
||
currentSelectOrg
)
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setTableLoading
(
false
);
setSearchWord
(
''
);
// 搜索框置空
setOrgTitle
(
res
.
data
.
GroupName
);
// 返回用户表数据结构处理,扁平化
const
temp
=
flatten
(
getUsers
(
res
.
data
));
// 设置过滤字段
let
arr
=
temp
.
map
(
item
=>
item
.
OUName
);
arr
=
arr
.
filter
((
value
,
index
)
=>
arr
.
indexOf
(
value
)
===
index
);
setOrgFilters
(
arr
.
map
(
item
=>
({
text
:
item
,
value
:
item
})));
console
.
log
(
temp
);
setTableLength
(
temp
.
length
);
const
table
=
temp
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
item
.
phoneCopy
=
item
.
phone
;
item
.
phone
=
item
.
phone
||
'-'
;
return
item
;
});
setTableData
(
table
);
}
else
{
setTableLoading
(
false
);
notification
.
error
({
message
:
'获取失败'
,
description
:
res
.
message
,
});
}
})
.
catch
(
err
=>
{
setTableLoading
(
false
);
notification
.
error
({
message
:
'获取失败'
,
description
:
res
.
message
,
});
}
})
.
catch
(
err
=>
{
setTableLoading
(
false
);
message
.
error
(
err
);
});
message
.
error
(
err
);
});
}
else
{
setTableLoading
(
false
);
}
};
// 返回用户表数据结构处理,扁平化
...
...
@@ -1130,7 +1135,8 @@ const UserManage = () => {
showLine
=
{{
showLeafIcon
:
false
}}
blockNode
autoExpandParent
expandedKeys
=
{[
currentSelectOrg
]}
// expandedKeys={[currentSelectOrg]}
defaultExpandAll
selectedKeys
=
{[
currentSelectOrg
]}
onSelect
=
{
onSelect
}
treeData
=
{
treeData
.
map
(
t
=>
mapTree
(
t
))}
...
...
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