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
6f3ea24c
Commit
6f3ea24c
authored
Oct 09, 2021
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 工作流角色选择模块添加机构选择
parent
db9cad40
Pipeline
#35692
skipped with stages
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
28 deletions
+84
-28
Workflow.jsx
src/pages/platformCenter/bsmanager/workflowEdit/Workflow.jsx
+1
-0
NodeModal.jsx
...Edit/workFlowComponents/flowChartComponents/NodeModal.jsx
+9
-1
RoalChoose.jsx
...ts/flowChartComponents/nodeModalComponents/RoalChoose.jsx
+69
-26
workflow.less
...pages/platformCenter/bsmanager/workflowEdit/workflow.less
+5
-1
No files found.
src/pages/platformCenter/bsmanager/workflowEdit/Workflow.jsx
View file @
6f3ea24c
...
...
@@ -147,6 +147,7 @@ const Workflow = () => {
if
(
res
.
code
===
0
)
{
setFlowData
(
res
.
data
);
}
else
{
setFlowData
({
Nodes
:
[],
Lines
:
[]
});
notification
.
error
({
title
:
'提示'
,
duration
:
3
,
...
...
src/pages/platformCenter/bsmanager/workflowEdit/workFlowComponents/flowChartComponents/NodeModal.jsx
View file @
6f3ea24c
...
...
@@ -95,7 +95,6 @@ const NodeModal = props => {
// 修改表格
setNodeMsg
({
...
nodeMsg
,
roleList
:
[...
newList
]
});
}
console
.
log
(
chooseIndex
,
obj
,
'选中人'
);
setShowRoal
(
false
);
};
// 编辑默认承办人
...
...
@@ -110,6 +109,14 @@ const NodeModal = props => {
title
:
'机构(角色)名称'
,
dataIndex
:
'roleName'
,
align
:
'center'
,
ellipsis
:
{
showTitle
:
false
,
},
render
:
text
=>
(
<
Tooltip
placement=
"topLeft"
title=
{
text
}
>
{
text
}
</
Tooltip
>
),
},
{
title
:
'默认承办人'
,
...
...
@@ -228,6 +235,7 @@ const NodeModal = props => {
setShowRoal
(
true
);
setIsEdit
(
'add'
);
}
}
type=
"primary"
>
添加
</
Button
>
...
...
src/pages/platformCenter/bsmanager/workflowEdit/workFlowComponents/flowChartComponents/nodeModalComponents/RoalChoose.jsx
View file @
6f3ea24c
...
...
@@ -11,12 +11,14 @@ import {
Divider
,
notification
,
Empty
,
Tabs
,
}
from
'antd'
;
import
Tree
from
'@/components/ExpendableTree'
;
import
{
UserOutlined
}
from
'@ant-design/icons'
;
import
styles
from
'../../../workflow.less'
;
const
CheckboxGroup
=
Checkbox
.
Group
;
const
{
TabPane
}
=
Tabs
;
const
RoalChoose
=
props
=>
{
const
{
onSubumit
,
handleCancel
,
visible
,
modalType
,
chooseUser
}
=
props
;
...
...
@@ -32,17 +34,22 @@ const RoalChoose = props => {
const
[
loading
,
setLoading
]
=
useState
(
false
);
// 加载时的loading
const
[
userList
,
setUserList
]
=
useState
([]);
// 编辑选中的用户信息
const
[
currentPage
,
setCurrentPage
]
=
useState
(
1
);
const
[
pageSize
,
setPageSize
]
=
useState
(
10
);
const
[
roleType
,
setRoleType
]
=
useState
(
'2'
);
// 角色类型
// 初始化
useEffect
(()
=>
{
form
.
resetFields
();
if
(
visible
)
{
setCurrentPage
(
1
);
if
(
modalType
===
'edit'
)
{
console
.
log
(
chooseUser
);
setRoleType
(
chooseUser
.
type
.
toString
());
form
.
setFieldsValue
({
roleName
:
chooseUser
.
roleName
});
setUserList
(
chooseUser
.
defaultUserId
);
getData
(
''
,
1
,
10
,
chooseUser
.
roleId
);
getData
(
''
,
1
,
pageSize
,
chooseUser
.
roleId
,
chooseUser
.
type
);
}
else
{
getData
(
''
,
1
,
10
);
getData
(
''
,
1
,
pageSize
,
0
,
2
);
setRoleType
(
'2'
);
}
}
else
{
setUserList
([]);
...
...
@@ -75,11 +82,18 @@ const RoalChoose = props => {
setCheckAll
(
false
);
}
},
[
plainOptions
]);
// 获取左侧树回显
const
getData
=
(
roleName
,
pageIndex
,
pageSize
,
roleId
)
=>
{
const
getData
=
(
roleName
,
pageIndex
,
pageSize
s
,
roleId
,
Type
)
=>
{
roleName
=
roleName
||
''
;
setLoading
(
true
);
GetRoleUser
({
roleName
,
pageIndex
,
pageSize
,
roleId
}).
then
(
res
=>
{
GetRoleUser
({
roleName
,
pageIndex
,
pageSize
:
pageSizes
,
roleId
,
Type
:
Number
(
Type
),
}).
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
code
===
0
)
{
setTreeData
(
res
.
data
.
data
);
...
...
@@ -93,7 +107,7 @@ const RoalChoose = props => {
}
});
};
//
保存
角色
//
查询
角色
const
onFinish
=
()
=>
{
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
...
...
@@ -103,7 +117,7 @@ const RoalChoose = props => {
setIndeterminate
(
false
);
setCheckAll
(
false
);
setCurrentPage
(
1
);
getData
(
validate
.
roleName
,
1
,
10
);
getData
(
validate
.
roleName
,
1
,
pageSize
,
0
,
roleType
);
}
});
};
...
...
@@ -132,7 +146,7 @@ const RoalChoose = props => {
}
};
// 监听分页
const
paginationChange
=
(
page
,
pageSize
)
=>
{
const
paginationChange
=
(
page
,
pageSize
s
)
=>
{
// 分页时清空复选框
setCurrentSelectId
(
''
);
setPlainOptions
([]);
...
...
@@ -140,8 +154,9 @@ const RoalChoose = props => {
setIndeterminate
(
false
);
setCheckAll
(
false
);
setCurrentPage
(
page
);
setPageSize
(
pageSizes
);
let
roleName
=
form
.
getFieldValue
(
'roleName'
);
getData
(
roleName
,
page
,
pageSize
);
getData
(
roleName
,
page
,
pageSize
s
,
0
,
roleType
);
};
// 复选框全选监听
const
onCheckAllChange
=
e
=>
{
...
...
@@ -156,6 +171,19 @@ const RoalChoose = props => {
setIndeterminate
(
!!
list
.
length
&&
list
.
length
<
plainOptions
.
length
);
setCheckAll
(
list
.
length
===
plainOptions
.
length
);
};
// tab栏切换回调
const
tabCallback
=
val
=>
{
if
(
val
===
roleType
)
{
return
;
}
setRoleType
(
val
);
setPlainOptions
([]);
setCheckedList
([]);
setIndeterminate
(
false
);
setCheckAll
(
false
);
setCurrentPage
(
1
);
getData
(
form
.
getFieldValue
(
'roleName'
),
1
,
pageSize
,
0
,
val
);
};
// 保存选择的角色列表
const
onSave
=
()
=>
{
// 默认承办人字符串拼接
...
...
@@ -177,9 +205,26 @@ const RoalChoose = props => {
roleId
:
currentSelectId
,
defaultUserId
:
checkedList
,
defauletUserName
:
DeafaultUserName
,
type
:
Number
(
roleType
),
};
onSubumit
(
obj
,
treeData
.
length
);
};
// 角色列表样式
const
roleDom
=
()
=>
treeData
.
length
>
0
?
(
<
Tree
blockNode
autoExpandParent
onSelect=
{
onSelect
}
selectedKeys=
{
[
currentSelectId
]
}
treeData=
{
treeData
.
map
(
item
=>
mapTree
(
item
))
}
/>
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
"未有查找到角色"
/>
);
return
(
<
Modal
title=
"角色用户列表"
...
...
@@ -218,24 +263,22 @@ const RoalChoose = props => {
{
/* 角色树 */
}
<
Spin
spinning=
{
loading
}
>
<
div
className=
{
styles
.
treeContent
}
>
<
span
style=
{
{
marginLeft
:
'28px'
,
fontWeight
:
700
}
}
>
角色列表
</
span
>
<
Divider
style=
{
{
margin
:
'10px 0'
}
}
/>
{
treeData
.
length
>
0
?
(
<
Tree
blockNode
autoExpandParent
onSelect=
{
onSelect
}
selectedKeys=
{
[
currentSelectId
]
}
treeData=
{
treeData
.
map
(
item
=>
mapTree
(
item
))
}
/>
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
"未有查找到角色"
/>
)
}
<
Tabs
activeKey=
{
roleType
}
onChange=
{
tabCallback
}
>
<
TabPane
tab=
"角色列表"
key=
"2"
disabled=
{
modalType
===
'edit'
&&
chooseUser
.
type
===
1
}
>
{
roleDom
()
}
</
TabPane
>
<
TabPane
tab=
"机构列表"
key=
"1"
disabled=
{
modalType
===
'edit'
&&
chooseUser
.
type
===
2
}
>
{
roleDom
()
}
</
TabPane
>
</
Tabs
>
</
div
>
</
Spin
>
{
/* 分页 */
}
...
...
src/pages/platformCenter/bsmanager/workflowEdit/workflow.less
View file @
6f3ea24c
...
...
@@ -109,13 +109,17 @@
width: 100%;
height: 370px;
margin: 10px 0 10px 0;
padding:
20
px 20px 20px 20px;
padding:
8
px 20px 20px 20px;
box-sizing: border-box;
border: 1px solid #ccc;
.ant-tree-list-holder {
height: 285px;
}
}
.footer {
position: relative;
z-index: 999;
}
}
.userContent {
width: 50%;
...
...
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