Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d5a7ae18
authored
Jun 14, 2024
by
jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仿钉钉流程设计器- 简化多人审批方式
parent
cab95532
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
33 deletions
+20
-33
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
+1
-1
src/components/SimpleProcessDesignerV2/src/consts.ts
+9
-19
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
+10
-13
No files found.
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
View file @
d5a7ae18
...
@@ -75,7 +75,7 @@ const addNode = (type: number) => {
...
@@ -75,7 +75,7 @@ const addNode = (type: number) => {
type
:
NodeType
.
USER_TASK_NODE
,
type
:
NodeType
.
USER_TASK_NODE
,
// 审批节点配置
// 审批节点配置
attributes
:
{
attributes
:
{
approveMethod
:
ApproveMethodType
.
SINGLE_PERSON
_APPROVE
,
approveMethod
:
ApproveMethodType
.
RRANDOM_SELECT_ONE
_APPROVE
,
candidateStrategy
:
CandidateStrategy
.
USER
,
candidateStrategy
:
CandidateStrategy
.
USER
,
candidateParam
:
undefined
,
candidateParam
:
undefined
,
fieldsPermission
:
undefined
,
fieldsPermission
:
undefined
,
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
d5a7ae18
...
@@ -95,35 +95,27 @@ export enum ConditionConfigType {
...
@@ -95,35 +95,27 @@ export enum ConditionConfigType {
*/
*/
RULE
=
2
RULE
=
2
}
}
// 审批方式类型 ( 用于审批节点 )
//
多人
审批方式类型 ( 用于审批节点 )
export
enum
ApproveMethodType
{
export
enum
ApproveMethodType
{
/**
/**
*
单
人审批
*
随机挑选一
人审批
*/
*/
SINGLE_PERSON
_APPROVE
=
1
,
RRANDOM_SELECT_ONE
_APPROVE
=
1
,
/**
/**
* 多人会签(需所有审批人同意)
*/
ALL_APPROVE
=
2
,
/**
* 多人会签(按通过比例)
* 多人会签(按通过比例)
*/
*/
APPROVE_BY_RATIO
=
3
,
APPROVE_BY_RATIO
=
2
,
/**
* 多人会签(通过只需一人,拒绝需要全员)
*/
ANY_APPROVE_ALL_REJECT
=
4
,
/**
/**
* 多人或签(
一名审批人通过即可
)
* 多人或签(
通过只需一人,拒绝只需一人
)
*/
*/
ANY_APPROVE
=
5
,
ANY_APPROVE
=
3
,
/**
/**
* 多人依次审批
* 多人依次审批
*/
*/
SEQUENTIAL_APPROVE
=
6
SEQUENTIAL_APPROVE
=
4
}
}
...
@@ -216,11 +208,9 @@ NODE_DEFAULT_NAME.set(NodeType.COPY_TASK_NODE, '抄送人')
...
@@ -216,11 +208,9 @@ NODE_DEFAULT_NAME.set(NodeType.COPY_TASK_NODE, '抄送人')
NODE_DEFAULT_NAME
.
set
(
NodeType
.
CONDITION_NODE
,
'条件'
)
NODE_DEFAULT_NAME
.
set
(
NodeType
.
CONDITION_NODE
,
'条件'
)
export
const
APPROVE_METHODS
:
DictDataVO
[]
=
[
export
const
APPROVE_METHODS
:
DictDataVO
[]
=
[
{
label
:
'单人审批'
,
value
:
ApproveMethodType
.
SINGLE_PERSON_APPROVE
},
{
label
:
'随机挑选一人审批'
,
value
:
ApproveMethodType
.
RRANDOM_SELECT_ONE_APPROVE
},
{
label
:
'多人会签(需所有审批人同意)'
,
value
:
ApproveMethodType
.
ALL_APPROVE
},
{
label
:
'多人会签(按通过比例%)'
,
value
:
ApproveMethodType
.
APPROVE_BY_RATIO
},
{
label
:
'多人会签(按通过比例%)'
,
value
:
ApproveMethodType
.
APPROVE_BY_RATIO
},
{
label
:
'多人会签(通过只需一人,拒绝需要全员)'
,
value
:
ApproveMethodType
.
ANY_APPROVE_ALL_REJECT
},
{
label
:
'多人或签(一人通过或拒绝)'
,
value
:
ApproveMethodType
.
ANY_APPROVE
},
{
label
:
'多人或签(一名审批人通过即可)'
,
value
:
ApproveMethodType
.
ANY_APPROVE
},
{
label
:
'依次审批(按顺序依次审批)'
,
value
:
ApproveMethodType
.
SEQUENTIAL_APPROVE
}
{
label
:
'依次审批(按顺序依次审批)'
,
value
:
ApproveMethodType
.
SEQUENTIAL_APPROVE
}
]
]
...
...
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
View file @
d5a7ae18
...
@@ -143,7 +143,7 @@
...
@@ -143,7 +143,7 @@
style=
"width: 100%"
style=
"width: 100%"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"审批方式"
prop=
"approveMethod"
>
<el-form-item
label=
"
多人
审批方式"
prop=
"approveMethod"
>
<el-radio-group
<el-radio-group
v-model=
"currentNode.attributes.approveMethod"
v-model=
"currentNode.attributes.approveMethod"
@
change=
"approveMethodChanged"
@
change=
"approveMethodChanged"
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
:value=
"item.value"
:value=
"item.value"
:label=
"item.value"
:label=
"item.value"
:disabled=
"
:disabled=
"
item.value !== ApproveMethodType.
SINGLE_PERSON
_APPROVE &&
item.value !== ApproveMethodType.
RRANDOM_SELECT_ONE
_APPROVE &&
notAllowedMultiApprovers
notAllowedMultiApprovers
"
"
>
>
...
@@ -163,7 +163,7 @@
...
@@ -163,7 +163,7 @@
<el-input-number
<el-input-number
v-model=
"currentNode.attributes.approveRatio"
v-model=
"currentNode.attributes.approveRatio"
:min=
"10"
:min=
"10"
:max=
"
99
"
:max=
"
100
"
:step=
"10"
:step=
"10"
size=
"small"
size=
"small"
v-if=
"item.value === ApproveMethodType.APPROVE_BY_RATIO && currentNode.attributes.approveMethod === ApproveMethodType.APPROVE_BY_RATIO"
v-if=
"item.value === ApproveMethodType.APPROVE_BY_RATIO && currentNode.attributes.approveMethod === ApproveMethodType.APPROVE_BY_RATIO"
...
@@ -504,7 +504,7 @@ defineExpose({ open, setCurrentNode }) // 暴露方法给父组件
...
@@ -504,7 +504,7 @@ defineExpose({ open, setCurrentNode }) // 暴露方法给父组件
const
changeCandidateStrategy
=
()
=>
{
const
changeCandidateStrategy
=
()
=>
{
candidateParamArray
.
value
=
[]
candidateParamArray
.
value
=
[]
currentNode
.
value
.
attributes
.
approveMethod
=
ApproveMethodType
.
SINGLE_PERSON
_APPROVE
currentNode
.
value
.
attributes
.
approveMethod
=
ApproveMethodType
.
RRANDOM_SELECT_ONE
_APPROVE
if
(
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
START_USER
||
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
START_USER
||
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
USER
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
USER
...
@@ -520,7 +520,7 @@ const changedCandidateUsers = () => {
...
@@ -520,7 +520,7 @@ const changedCandidateUsers = () => {
candidateParamArray
.
value
?.
length
<=
1
&&
candidateParamArray
.
value
?.
length
<=
1
&&
currentNode
.
value
.
attributes
?.
candidateStrategy
===
CandidateStrategy
.
USER
currentNode
.
value
.
attributes
?.
candidateStrategy
===
CandidateStrategy
.
USER
)
{
)
{
currentNode
.
value
.
attributes
.
approveMethod
=
ApproveMethodType
.
SINGLE_PERSON
_APPROVE
currentNode
.
value
.
attributes
.
approveMethod
=
ApproveMethodType
.
RRANDOM_SELECT_ONE
_APPROVE
currentNode
.
value
.
attributes
.
rejectHandler
.
type
=
RejectHandlerType
.
FINISH_PROCESS
currentNode
.
value
.
attributes
.
rejectHandler
.
type
=
RejectHandlerType
.
FINISH_PROCESS
notAllowedMultiApprovers
.
value
=
true
notAllowedMultiApprovers
.
value
=
true
}
else
{
}
else
{
...
@@ -541,7 +541,7 @@ const blurEvent = () => {
...
@@ -541,7 +541,7 @@ const blurEvent = () => {
}
}
const
approveMethodChanged
=
()
=>
{
const
approveMethodChanged
=
()
=>
{
const
approveMethod
=
currentNode
.
value
.
attributes
?.
approveMethod
const
approveMethod
=
currentNode
.
value
.
attributes
?.
approveMethod
if
(
approveMethod
===
ApproveMethodType
.
A
NY_APPROVE_ALL_REJECT
||
approveMethod
===
ApproveMethodType
.
A
PPROVE_BY_RATIO
)
{
if
(
approveMethod
===
ApproveMethodType
.
APPROVE_BY_RATIO
)
{
currentNode
.
value
.
attributes
.
rejectHandler
.
type
=
currentNode
.
value
.
attributes
.
rejectHandler
.
type
=
RejectHandlerType
.
FINISH_PROCESS_BY_REJECT_RATIO
RejectHandlerType
.
FINISH_PROCESS_BY_REJECT_RATIO
}
else
{
}
else
{
...
@@ -549,7 +549,7 @@ const approveMethodChanged = () => {
...
@@ -549,7 +549,7 @@ const approveMethodChanged = () => {
}
}
if
(
approveMethod
===
ApproveMethodType
.
APPROVE_BY_RATIO
)
{
if
(
approveMethod
===
ApproveMethodType
.
APPROVE_BY_RATIO
)
{
currentNode
.
value
.
attributes
.
approveRatio
=
5
0
;
currentNode
.
value
.
attributes
.
approveRatio
=
10
0
;
}
}
}
}
const
rejectHandlerOptionDisabled
=
computed
(()
=>
{
const
rejectHandlerOptionDisabled
=
computed
(()
=>
{
...
@@ -557,15 +557,12 @@ const rejectHandlerOptionDisabled = computed(() => {
...
@@ -557,15 +557,12 @@ const rejectHandlerOptionDisabled = computed(() => {
const
approveMethod
=
currentNode
.
value
.
attributes
?.
approveMethod
const
approveMethod
=
currentNode
.
value
.
attributes
?.
approveMethod
if
(
if
(
val
===
RejectHandlerType
.
FINISH_PROCESS_BY_REJECT_RATIO
&&
val
===
RejectHandlerType
.
FINISH_PROCESS_BY_REJECT_RATIO
&&
approveMethod
!==
ApproveMethodType
.
APPROVE_BY_RATIO
&&
approveMethod
!==
ApproveMethodType
.
APPROVE_BY_RATIO
approveMethod
!==
ApproveMethodType
.
ANY_APPROVE_ALL_REJECT
)
{
)
{
return
true
return
true
}
}
if
(
if
(
approveMethod
===
ApproveMethodType
.
APPROVE_BY_RATIO
approveMethod
===
ApproveMethodType
.
ANY_APPROVE_ALL_REJECT
&&
&&
val
!==
RejectHandlerType
.
FINISH_PROCESS_BY_REJECT_RATIO
)
{
val
===
RejectHandlerType
.
FINISH_PROCESS
)
{
return
true
return
true
}
}
...
...
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