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
a383363e
authored
Mar 02, 2025
by
smallNorthLee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增获取下一个执行的流程节点接口
parent
986d1cdf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
16 deletions
+29
-16
src/api/bpm/processInstance/index.ts
+6
-0
src/components/SimpleProcessDesignerV2/src/consts.ts
+5
-0
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+18
-16
No files found.
src/api/bpm/processInstance/index.ts
View file @
a383363e
...
...
@@ -102,3 +102,8 @@ export const getFormFieldsPermission = async (params: any) => {
export
const
getProcessInstanceBpmnModelView
=
async
(
id
:
string
)
=>
{
return
await
request
.
get
({
url
:
'/bpm/process-instance/get-bpmn-model-view?id='
+
id
})
}
// 获取下一个执行的流程节点
export
const
getNextFlowNodes
=
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
'/bpm/process-instance/get-next-flow-nodes'
,
params
})
}
\ No newline at end of file
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
a383363e
...
...
@@ -163,6 +163,10 @@ export enum CandidateStrategy {
*/
USER
=
30
,
/**
* 审批人自选
*/
APPROVE_USER_SELECT
=
34
,
/**
* 发起人自选
*/
START_USER_SELECT
=
35
,
...
...
@@ -542,6 +546,7 @@ export const CANDIDATE_STRATEGY: DictDataVO[] = [
{
label
:
'连续多级部门负责人'
,
value
:
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'指定岗位'
,
value
:
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'发起人自选'
,
value
:
CandidateStrategy
.
START_USER_SELECT
},
{
label
:
'审批人自选'
,
value
:
CandidateStrategy
.
APPROVE_USER_SELECT
},
{
label
:
'发起人本人'
,
value
:
CandidateStrategy
.
START_USER
},
{
label
:
'发起人部门负责人'
,
value
:
CandidateStrategy
.
START_USER_DEPT_LEADER
},
{
label
:
'发起人连续部门负责人'
,
value
:
CandidateStrategy
.
START_USER_MULTI_LEVEL_DEPT_LEADER
},
...
...
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
View file @
a383363e
...
...
@@ -718,29 +718,31 @@ const closePopover = (type: string, formRef: FormInstance | undefined) => {
const
initNextAssigneesFormField
=
async
()
=>
{
// 获取修改的流程变量, 暂时只支持流程表单
const
variables
=
getUpdatedProcessInstanceVariables
()
const
data
=
await
ProcessInstanceApi
.
get
ApprovalDetail
({
const
data
=
await
ProcessInstanceApi
.
get
NextFlowNodes
({
processInstanceId
:
props
.
processInstance
.
id
,
taskId
:
runningTask
.
value
.
id
,
processVariablesStr
:
JSON
.
stringify
(
variables
)
})
const
activityId
=
data
.
todoTask
?.
taskDefinitionKey
if
(
data
.
activityNodes
&&
data
.
activityNodes
.
length
>
0
)
{
// 找到当前节点的索引
const
currentNodeIndex
=
data
.
activityNodes
.
findIndex
((
node
:
any
)
=>
node
.
id
===
activityId
)
const
nextNode
=
data
.
activityNodes
[
currentNodeIndex
+
1
]
// 情况一:发起人选择审批人:此时一般是因为条件发生变化,需要当前审批人补充选择
if
(
data
&&
data
.
length
>
0
)
{
data
.
forEach
((
node
:
any
)
=>
{
if
(
nextNode
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
&&
!
nextNode
.
tasks
&&
nextNode
.
candidateUsers
?.
length
===
0
node
.
candidateStrategy
===
CandidateStrategy
.
START_USER_SELECT
&&
node
.
candidateUsers
&&
node
.
task
)
{
// 自选审批人,则弹出选择审批人弹窗
// TODO @小北:需要考虑下,这里的 nextNode 可能是多个节点,需要怎么处理;类似你在后端的处理哈
// TODO @小北:有点纠结,是不是写个预测下一个节点的接口,更合适?
nextAssigneesActivityNode
.
value
=
[
nextNode
]
nextAssigneesActivityNode
.
value
.
push
(
node
)
}
})
if
(
nextAssigneesActivityNode
.
value
.
length
>
0
)
{
nextAssigneesVisible
.
value
=
true
}
// TODO @小北:情况二:审批人选择的情况
// // 自选审批人,则弹出选择审批人弹窗
// // TODO @小北:需要考虑下,这里的 nextNode 可能是多个节点,需要怎么处理;类似你在后端的处理哈
// // TODO @小北:有点纠结,是不是写个预测下一个节点的接口,更合适?
// nextAssigneesActivityNode.value = [nextNode]
// nextAssigneesVisible.value = true
// }
// // TODO @小北:情况二:审批人选择的情况
}
}
...
...
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