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
275a8c80
Commit
275a8c80
authored
Dec 09, 2021
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改事件权限交互
parent
f12f5277
Pipeline
#39826
passed with stages
in 29 minutes 12 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
8 deletions
+83
-8
AddFlowsModal.jsx
...ages/platformCenter/bsmanager/workOrder/AddFlowsModal.jsx
+1
-1
AddModal.jsx
src/pages/platformCenter/bsmanager/workOrder/AddModal.jsx
+1
-1
changeAdd.jsx
src/pages/platformCenter/bsmanager/workOrder/changeAdd.jsx
+81
-6
No files found.
src/pages/platformCenter/bsmanager/workOrder/AddFlowsModal.jsx
View file @
275a8c80
...
...
@@ -130,7 +130,7 @@ const AddFlowsModal = props => {
let
a1
=
[];
let
a2
;
let
a3
=
[];
initialArr
.
data
.
map
(
i
=>
{
initialArr
.
map
(
i
=>
{
// console.log(i.groupType)
a2
=
i
.
groupType
;
// console.log(a2)
...
...
src/pages/platformCenter/bsmanager/workOrder/AddModal.jsx
View file @
275a8c80
...
...
@@ -796,7 +796,7 @@ const AddModal = props => {
let
a1
=
[];
let
a2
;
let
a3
=
[];
initialArr
.
data
.
map
(
i
=>
{
initialArr
.
map
(
i
=>
{
// console.log(i.groupType)
a2
=
i
.
groupType
;
// console.log(a2)
...
...
src/pages/platformCenter/bsmanager/workOrder/changeAdd.jsx
View file @
275a8c80
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
/* eslint-disable camelcase */
/* eslint-disable react/jsx-no-undef */
/* eslint-disable valid-typeof */
/* eslint-disable no-unused-vars */
...
...
@@ -20,6 +23,7 @@ import {
Pagination
,
}
from
'antd'
;
import
DragTable
from
'@/components/DragTable/DragTable'
;
import
{
CM_Event_LoadDepartmentAndRoles
}
from
'@/services/standingBook/api'
;
import
Sortable
from
'sortablejs'
;
import
{
add
}
from
'lodash-es'
;
...
...
@@ -61,6 +65,7 @@ const AddModal = props => {
const
[
total
,
setTotal
]
=
useState
();
const
[
pageSize
,
setPageSize
]
=
useState
(
10
);
const
[
currentPage
,
setCurrentPage
]
=
useState
(
1
);
const
[
roleValue
,
setRoleValue
]
=
useState
([]);
let
objArr
=
[];
const
onChangeList
=
(
list
,
index
,
title
)
=>
{
...
...
@@ -400,6 +405,8 @@ const AddModal = props => {
};
useEffect
(()
=>
{
// getRoles();
setRoleValue
(
filed1
);
if
(
visible
)
{
setFlagg
(
1
);
if
(
isType
!=
''
&&
isType
===
'add'
)
{
...
...
@@ -508,6 +515,74 @@ const AddModal = props => {
// getData(username, page, pageSizes);
};
const
getRoles
=
()
=>
{
CM_Event_LoadDepartmentAndRoles
().
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
// setRoleValue(formateArrDataA1(res.data, 'groupType'));
console
.
log
(
formateArrDataA1
(
res
.
data
,
'groupType'
));
}
});
};
const
formateArrDataA1
=
(
initialArr
,
name
)
=>
{
console
.
log
(
initialArr
);
let
aa
=
[];
let
a1
=
[];
let
a2
;
let
a3
=
[];
initialArr
.
data
.
map
(
i
=>
{
a2
=
i
.
groupType
;
a1
=
i
.
root
;
a1
.
map
(
j
=>
{
j
.
group
=
a2
;
});
aa
.
push
(
i
.
root
);
});
aa
.
map
(
p
=>
{
p
.
map
(
o
=>
{
a3
.
push
(
o
);
});
});
console
.
log
(
a3
);
// 判定传参是否符合规则
if
(
!
(
a3
instanceof
Array
))
{
return
'请传入正确格式的数组'
;
}
if
(
!
name
)
{
return
'请传入对象属性'
;
}
// 先获取一下这个数组中有多少个"name"
let
nameArr
=
[];
a3
.
map
(
i
=>
{
if
(
nameArr
.
indexOf
(
i
.
group
)
===
-
1
)
{
nameArr
.
push
(
i
.
group
);
}
});
console
.
log
(
nameArr
);
// 新建一个包含多个list的结果对象
let
tempObj
=
{};
// 根据不同的"name"生成多个数组
for
(
let
k
in
nameArr
)
{
for
(
let
j
in
a3
)
{
if
(
a3
[
j
].
group
==
nameArr
[
k
])
{
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj
[
nameArr
[
k
]]
=
tempObj
[
nameArr
[
k
]]
||
[];
tempObj
[
nameArr
[
k
]].
push
(
a3
[
j
]);
}
}
}
console
.
log
(
tempObj
);
for
(
let
key
in
tempObj
)
{
let
arr
=
[];
tempObj
[
key
].
map
(
item
=>
{
tempObj
[
key
]
=
arr
;
arr
.
push
(
item
.
Name
);
});
}
return
tempObj
;
};
const
columns
=
[
{
title
:
'已选列表'
,
...
...
@@ -655,7 +730,7 @@ const AddModal = props => {
forceRender
getContainer=
{
false
}
>
<
Search
{
/*
<Search
style={{
width: 260,
marginRight: '20px',
...
...
@@ -677,7 +752,7 @@ const AddModal = props => {
// }}
>
重置
</
Button
>
</Button>
*/
}
{
visible
&&
(
<
div
className=
{
styles
.
listCard1
}
>
<
div
className=
{
styles
.
cardItem1
}
>
...
...
@@ -698,14 +773,14 @@ const AddModal = props => {
indeterminate=
{
indeterminate
[
index
]
}
onChange=
{
onCheckAllChange
}
index=
{
index
}
checkvalue=
{
filed1
[
item
]
}
checkvalue=
{
roleValue
[
item
]
}
checked=
{
checkAll
[
index
]
}
style=
{
{
marginRight
:
'7px'
}
}
/>
{
item
}
</
Divider
>
<
CheckboxGroup
options=
{
filed1
[
item
]
}
options=
{
roleValue
[
item
]
}
value=
{
checkedList
[
index
]
}
onChange=
{
e
=>
onChangeList1
(
e
,
index
,
item
)
}
/>
...
...
@@ -730,7 +805,7 @@ const AddModal = props => {
</
div
>
</
div
>
)
}
<
Pagination
{
/*
<Pagination
total={total}
showTotal={item => `共 ${item} 条`}
defaultPageSize={pageSize}
...
...
@@ -740,7 +815,7 @@ const AddModal = props => {
style={{ marginBottom: '10px' }}
size="small"
showQuickJumper
/>
/>
*/
}
</
Modal
>
);
}
...
...
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