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
ad9e7c79
Commit
ad9e7c79
authored
May 13, 2024
by
涂伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '消息推送推送人选择显示bug修复'
parent
9ea6b940
Pipeline
#88439
passed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
RoleModal.jsx
...Manage/projectManage/components/RolseSelect/RoleModal.jsx
+22
-5
No files found.
src/pages/platformCenter/messageManage/projectManage/components/RolseSelect/RoleModal.jsx
View file @
ad9e7c79
...
...
@@ -13,16 +13,33 @@ const RoleModal = porps => {
let
hasCheckList
=
selectValue
?
selectValue
.
split
(
','
)
:
[];
RoleGroupList
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
roleListData
=
res
.
data
.
roleList
;
let
roleListData
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
.
roleList
))
;
// 给子角色分类放到外面来
roleListData
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
child
.
length
>
0
)
{
item
.
child
.
forEach
((
val
,
i
)
=>
{
// roleListData.forEach((item, index) => {
// if (item.child.length > 0) {
// item.child.forEach((val, i) => {
// val.visibleTitle = `${item.visibleTitle}(${val.visibleTitle})`;
// roleListData.splice(index + 1 + i, 0, val);
// });
// }
// });
// 假设 roleListData 是您的原始数组
let
newRoleListData
=
[];
// 创建新数组来存放最终的结果
roleListData
.
forEach
((
item
)
=>
{
newRoleListData
.
push
(
item
);
// 将当前父元素添加到新数组中
if
(
item
.
child
&&
item
.
child
.
length
>
0
)
{
item
.
child
.
forEach
((
val
)
=>
{
val
.
visibleTitle
=
`
${
item
.
visibleTitle
}
(
${
val
.
visibleTitle
}
)`
;
roleListData
.
splice
(
index
+
1
+
i
,
0
,
val
);
newRoleListData
.
push
(
val
);
// 将子元素添加到新数组中,紧跟在父元素之后
});
}
});
// 此时 newRoleListData 就是按照您要求的顺序排列的数组
roleListData
=
newRoleListData
;
console
.
log
(
roleListData
,
'roleListData'
);
let
list
=
roleListData
.
map
(
item
=>
{
let
checkedList
=
[];
// 已选
...
...
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