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
f42c6d83
authored
May 20, 2024
by
jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仿钉钉流程设计器- 审批人设置新增发起人自己策略
parent
4f241416
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
11 deletions
+42
-11
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
+2
-2
src/components/SimpleProcessDesignerV2/src/consts.ts
+26
-0
src/components/SimpleProcessDesignerV2/src/nodes-config/CopyTaskNodeConfig.vue
+2
-2
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
+12
-7
No files found.
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
View file @
f42c6d83
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
SimpleFlowNode
,
NodeType
,
NODE_DEFAULT_NAME
,
CandidateStrategy
}
from
'./consts'
import
{
SimpleFlowNode
,
NodeType
,
NODE_DEFAULT_NAME
,
ApproveMethodType
,
CandidateStrategy
}
from
'./consts'
import
{
generateUUID
}
from
'@/utils'
import
{
generateUUID
}
from
'@/utils'
defineOptions
({
defineOptions
({
name
:
'NodeHandler'
name
:
'NodeHandler'
...
@@ -64,7 +64,7 @@ const addNode = (type: number) => {
...
@@ -64,7 +64,7 @@ const addNode = (type: number) => {
type
:
NodeType
.
USER_TASK_NODE
,
type
:
NodeType
.
USER_TASK_NODE
,
// 审批节点配置
// 审批节点配置
attributes
:
{
attributes
:
{
approveMethod
:
1
,
approveMethod
:
ApproveMethodType
.
SINGLE_PERSON_APPROVE
,
candidateStrategy
:
CandidateStrategy
.
USER
,
candidateStrategy
:
CandidateStrategy
.
USER
,
candidateParam
:
undefined
,
candidateParam
:
undefined
,
fieldsPermission
:
undefined
,
fieldsPermission
:
undefined
,
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
f42c6d83
...
@@ -60,6 +60,28 @@ export enum ConditionConfigType {
...
@@ -60,6 +60,28 @@ export enum ConditionConfigType {
*/
*/
RULE
=
2
RULE
=
2
}
}
// 审批方式类型 ( 用于审批节点 )
export
enum
ApproveMethodType
{
/**
* 单人审批
*/
SINGLE_PERSON_APPROVE
=
1
,
/**
* 多人会签(需所有审批人同意)
*/
ALL_APPROVE
=
2
,
/**
* 多人或签(一名审批人同意即可)
*/
ANY_OF_APPROVE
=
3
,
/**
* 多人依次审批
*/
SEQUENTIAL_APPROVE
=
4
}
// 候选人策略 ( 用于审批节点。抄送节点 )
// 候选人策略 ( 用于审批节点。抄送节点 )
export
enum
CandidateStrategy
{
export
enum
CandidateStrategy
{
...
@@ -88,6 +110,10 @@ export enum CandidateStrategy {
...
@@ -88,6 +110,10 @@ export enum CandidateStrategy {
*/
*/
START_USER_SELECT
=
35
,
START_USER_SELECT
=
35
,
/**
/**
* 发起人自己
*/
START_USER
=
36
,
/**
* 指定用户组
* 指定用户组
*/
*/
USER_GROUP
=
40
,
USER_GROUP
=
40
,
...
...
src/components/SimpleProcessDesignerV2/src/nodes-config/CopyTaskNodeConfig.vue
View file @
f42c6d83
...
@@ -218,10 +218,10 @@ const deptTreeOptions = inject('deptTree') // 部门树
...
@@ -218,10 +218,10 @@ const deptTreeOptions = inject('deptTree') // 部门树
const
formType
=
inject
(
'formType'
)
// 表单类型
const
formType
=
inject
(
'formType'
)
// 表单类型
const
formFields
=
inject
<
Ref
<
string
[]
>>
(
'formFields'
)
const
formFields
=
inject
<
Ref
<
string
[]
>>
(
'formFields'
)
// 抄送人策略, 去掉发起人自选
// 抄送人策略, 去掉发起人自选
和 发起人自己
const
copyUserStrategies
=
computed
(
()
=>
{
const
copyUserStrategies
=
computed
(
()
=>
{
return
getIntDictOptions
(
DICT_TYPE
.
BPM_TASK_CANDIDATE_STRATEGY
)
return
getIntDictOptions
(
DICT_TYPE
.
BPM_TASK_CANDIDATE_STRATEGY
)
.
filter
(
item
=>
item
.
value
!==
CandidateStrategy
.
START_USER_SELECT
);
.
filter
(
item
=>
item
.
value
!==
CandidateStrategy
.
START_USER_SELECT
&&
item
.
value
!==
CandidateStrategy
.
START_USER
);
})
})
// 选中的参数
// 选中的参数
...
...
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
View file @
f42c6d83
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
<el-radio
<el-radio
:value=
"item.value"
:value=
"item.value"
:label=
"item.value"
:label=
"item.value"
:disabled=
"item.value !==
1
&& notAllowedMultiApprovers"
:disabled=
"item.value !==
ApproveMethodType.SINGLE_PERSON_APPROVE
&& notAllowedMultiApprovers"
>
>
{{ item.label }}
{{ item.label }}
</el-radio>
</el-radio>
...
@@ -205,7 +205,7 @@
...
@@ -205,7 +205,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
SimpleFlowNode
,
APPROVE_METHODS
,
CandidateStrategy
,
NodeType
,
NODE_DEFAULT_NAME
}
from
'../consts'
import
{
SimpleFlowNode
,
APPROVE_METHODS
,
CandidateStrategy
,
NodeType
,
ApproveMethodType
,
NODE_DEFAULT_NAME
}
from
'../consts'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
getDefaultFieldsPermission
}
from
'../utils'
import
{
getDefaultFieldsPermission
}
from
'../utils'
import
{
defaultProps
}
from
'@/utils/tree'
import
{
defaultProps
}
from
'@/utils/tree'
...
@@ -261,7 +261,7 @@ const getShowText = () : string => {
...
@@ -261,7 +261,7 @@ const getShowText = () : string => {
}
}
}
}
// 指定角色
// 指定角色
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
10
)
{
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
ROLE
)
{
if
(
candidateParamArray
.
value
?.
length
>
0
)
{
if
(
candidateParamArray
.
value
?.
length
>
0
)
{
const
candidateNames
:
string
[]
=
[]
const
candidateNames
:
string
[]
=
[]
roleOptions
?.
value
.
forEach
((
item
)
=>
{
roleOptions
?.
value
.
forEach
((
item
)
=>
{
...
@@ -319,6 +319,10 @@ const getShowText = () : string => {
...
@@ -319,6 +319,10 @@ const getShowText = () : string => {
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
)
{
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
)
{
showText
=
`发起人自选`
showText
=
`发起人自选`
}
}
// 发起人自己
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
START_USER
)
{
showText
=
`发起人自己`
}
// 流程表达式
// 流程表达式
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
EXPRESSION
)
{
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
EXPRESSION
)
{
...
@@ -339,7 +343,7 @@ const setCurrentNode = (node:SimpleFlowNode) => {
...
@@ -339,7 +343,7 @@ const setCurrentNode = (node:SimpleFlowNode) => {
if
(
strCandidateParam
)
{
if
(
strCandidateParam
)
{
candidateParamArray
.
value
=
strCandidateParam
.
split
(
','
).
map
(
item
=>
+
item
)
candidateParamArray
.
value
=
strCandidateParam
.
split
(
','
).
map
(
item
=>
+
item
)
}
}
if
(
currentNode
.
value
.
attributes
?.
candidateStrategy
===
CandidateStrategy
.
USER
&&
candidateParamArray
.
value
?.
length
<=
1
)
{
if
(
currentNode
.
value
.
attributes
?.
candidateStrategy
===
CandidateStrategy
.
START_USER
)
{
notAllowedMultiApprovers
.
value
=
true
notAllowedMultiApprovers
.
value
=
true
}
else
{
}
else
{
notAllowedMultiApprovers
.
value
=
false
notAllowedMultiApprovers
.
value
=
false
...
@@ -350,8 +354,9 @@ defineExpose({ open, setCurrentNode }) // 暴露方法给父组件
...
@@ -350,8 +354,9 @@ defineExpose({ open, setCurrentNode }) // 暴露方法给父组件
const
changeCandidateStrategy
=
()
=>
{
const
changeCandidateStrategy
=
()
=>
{
candidateParamArray
.
value
=
[]
candidateParamArray
.
value
=
[]
currentNode
.
value
.
attributes
.
approveMethod
=
1
currentNode
.
value
.
attributes
.
approveMethod
=
ApproveMethodType
.
SINGLE_PERSON_APPROVE
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
USER
)
{
if
(
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
START_USER
||
currentNode
.
value
.
attributes
.
candidateStrategy
===
CandidateStrategy
.
USER
)
{
notAllowedMultiApprovers
.
value
=
true
notAllowedMultiApprovers
.
value
=
true
}
else
{
}
else
{
notAllowedMultiApprovers
.
value
=
false
notAllowedMultiApprovers
.
value
=
false
...
@@ -360,7 +365,7 @@ const changeCandidateStrategy = () => {
...
@@ -360,7 +365,7 @@ const changeCandidateStrategy = () => {
const
changedCandidateUsers
=
()
=>
{
const
changedCandidateUsers
=
()
=>
{
if
(
candidateParamArray
.
value
?.
length
<=
1
&&
currentNode
.
value
.
attributes
?.
candidateStrategy
===
CandidateStrategy
.
USER
)
{
if
(
candidateParamArray
.
value
?.
length
<=
1
&&
currentNode
.
value
.
attributes
?.
candidateStrategy
===
CandidateStrategy
.
USER
)
{
currentNode
.
value
.
attributes
.
approveMethod
=
1
;
currentNode
.
value
.
attributes
.
approveMethod
=
ApproveMethodType
.
SINGLE_PERSON_APPROVE
notAllowedMultiApprovers
.
value
=
true
notAllowedMultiApprovers
.
value
=
true
}
else
{
}
else
{
notAllowedMultiApprovers
.
value
=
false
notAllowedMultiApprovers
.
value
=
false
...
...
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