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) => { export const getProcessInstanceBpmnModelView = async (id: string) => {
return await request.get({ url: '/bpm/process-instance/get-bpmn-model-view?id=' + id }) 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, 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.MULTI_LEVEL_DEPT_LEADER }, { label: '指定岗位', value: CandidateStrategy.MULTI_LEVEL_DEPT_LEADER },
{ label: '发起人自选', value: CandidateStrategy.START_USER_SELECT }, { label: '发起人自选', value: CandidateStrategy.START_USER_SELECT },
{ label: '审批人自选', value: CandidateStrategy.APPROVE_USER_SELECT },
{ label: '发起人本人', value: CandidateStrategy.START_USER }, { label: '发起人本人', value: CandidateStrategy.START_USER },
{ label: '发起人部门负责人', value: CandidateStrategy.START_USER_DEPT_LEADER }, { label: '发起人部门负责人', value: CandidateStrategy.START_USER_DEPT_LEADER },
{ label: '发起人连续部门负责人', value: CandidateStrategy.START_USER_MULTI_LEVEL_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 initNextAssigneesFormField = async () => {
// , // ,
const variables = getUpdatedProcessInstanceVariables() const variables = getUpdatedProcessInstanceVariables()
const data = await ProcessInstanceApi.getApprovalDetail({ const data = await ProcessInstanceApi.getNextFlowNodes({
processInstanceId: props.processInstance.id, processInstanceId: props.processInstance.id,
taskId: runningTask.value.id,
processVariablesStr: JSON.stringify(variables) processVariablesStr: JSON.stringify(variables)
}) })
if (data && data.length > 0) {
const activityId = data.todoTask?.taskDefinitionKey data.forEach((node: any) => {
if (data.activityNodes && data.activityNodes.length > 0) {
//
const currentNodeIndex = data.activityNodes.findIndex((node: any) => node.id === activityId)
const nextNode = data.activityNodes[currentNodeIndex + 1]
//
if ( if (
nextNode.candidateStrategy === CandidateStrategy.START_USER_SELECT && node.candidateStrategy === CandidateStrategy.START_USER_SELECT &&
!nextNode.tasks && node.candidateUsers && node.task
nextNode.candidateUsers?.length === 0
) { ) {
// nextAssigneesActivityNode.value.push(node)
// TODO @ nextNode }
// TODO @ })
nextAssigneesActivityNode.value = [nextNode] if (nextAssigneesActivityNode.value.length > 0) {
nextAssigneesVisible.value = true nextAssigneesVisible.value = true
} }
// TODO @
// //
// // TODO @ nextNode
// // TODO @
// nextAssigneesActivityNode.value = [nextNode]
// nextAssigneesVisible.value = true
// }
// // TODO @
} }
} }