feat: 新增获取下一个执行的流程节点接口

This commit is contained in:
smallNorthLee 2025-03-02 22:30:10 +08:00
parent 986d1cdfc2
commit a383363e69
3 changed files with 30 additions and 18 deletions

View File

@ -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 })
}

View File

@ -162,6 +162,10 @@ export enum CandidateStrategy {
*
*/
USER = 30,
/**
*
*/
APPROVE_USER_SELECT = 34,
/**
*
*/
@ -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 },

View File

@ -718,29 +718,31 @@ const closePopover = (type: string, formRef: FormInstance | undefined) => {
const initNextAssigneesFormField = async () => {
// ,
const variables = getUpdatedProcessInstanceVariables()
const data = await ProcessInstanceApi.getApprovalDetail({
const data = await ProcessInstanceApi.getNextFlowNodes({
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 (
nextNode.candidateStrategy === CandidateStrategy.START_USER_SELECT &&
!nextNode.tasks &&
nextNode.candidateUsers?.length === 0
) {
//
// TODO @ nextNode
// TODO @
nextAssigneesActivityNode.value = [nextNode]
if (data && data.length > 0) {
data.forEach((node: any) => {
if (
node.candidateStrategy === CandidateStrategy.START_USER_SELECT &&
node.candidateUsers && node.task
) {
nextAssigneesActivityNode.value.push(node)
}
})
if (nextAssigneesActivityNode.value.length > 0) {
nextAssigneesVisible.value = true
}
// TODO @
// //
// // TODO @ nextNode
// // TODO @
// nextAssigneesActivityNode.value = [nextNode]
// nextAssigneesVisible.value = true
// }
// // TODO @
}
}