From 3a9197dfdfd21fe989cba3436cb63e9606d56c76 Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Wed, 16 Oct 2024 22:31:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E3=80=91=20=E6=95=B4=E5=90=88=E5=AE=A1=E6=89=B9=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bpm/processInstance/index.ts | 10 +-- src/utils/formCreate.ts | 1 + .../detail/ProcessInstanceOperationButton.vue | 16 ++-- .../detail/ProcessInstanceTimeline.vue | 66 ++++++++------ .../bpm/processInstance/detail/index_new.vue | 89 +++++++++++-------- 5 files changed, 96 insertions(+), 86 deletions(-) diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts index 96b440bb..e9256407 100644 --- a/src/api/bpm/processInstance/index.ts +++ b/src/api/bpm/processInstance/index.ts @@ -87,14 +87,8 @@ export const getProcessInstanceCopyPage = async (params: any) => { } // 获取审批详情 -export const getApprovalDetail = async ( - processInstanceId?: string, - processDefinitionId?: string -) => { - const param = processInstanceId - ? '?processInstanceId=' + processInstanceId - : '?processDefinitionId=' + processDefinitionId - return await request.get({ url: 'bpm/process-instance/get-approval-detail' + param }) +export const getApprovalDetail = async (params: any) => { + return await request.get({ url: 'bpm/process-instance/get-approval-detail' , params }) } // 获取表单字段权限 diff --git a/src/utils/formCreate.ts b/src/utils/formCreate.ts index 850df8cb..a93d9cdd 100644 --- a/src/utils/formCreate.ts +++ b/src/utils/formCreate.ts @@ -44,6 +44,7 @@ export const setConfAndFields2 = ( value?: object ) => { if (isRef(detailPreview)) { + // @ts-ignore detailPreview = detailPreview.value } // @ts-ignore diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue index 188ac9dc..9518465c 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue @@ -657,7 +657,6 @@ const openChildrenTask = () => { /** 重新加载数据 */ const reload = () => { - getMyTodoTask() emit('success') } @@ -691,26 +690,23 @@ const getButtonDisplayName = (btnType: OperationButtonType) => { return displayName } -/** 获取我的待办任务 */ -const getMyTodoTask = async () => { +const loadTodoTask = (task: any) => { genericForm.value = {} approveForm.value = {} approveFormFApi.value = {} - const data = await TaskApi.myTodoTask(props.processInstanceId) - runningTask.value = data + runningTask.value = task // 处理 approve 表单. - if (data && data.formId && data.formConf) { + if (task && task.formId && task.formConf) { const tempApproveForm = {} - setConfAndFields2(tempApproveForm, data.formConf, data.formFields, data.formVariables) + setConfAndFields2(tempApproveForm, task.formConf, task.formFields, task.formVariables) approveForm.value = tempApproveForm } else { approveForm.value = {} // 占位,避免为空 } } -onMounted(async () => { - await getMyTodoTask() -}) +defineExpose({ loadTodoTask }) +