diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/hooks/useSubmit.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/hooks/useSubmit.tsx index e3d2a3af8..2d6778fb5 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/hooks/useSubmit.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/hooks/useSubmit.tsx @@ -32,6 +32,7 @@ export function useSubmit() { data: form.values, status: contextApprovalStatus, schemaFormId: workflow.config.applyForm, + summaryConfig: workflow.config.summary, }, }); diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/hooks/useWithdrawAction.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/hooks/useWithdrawAction.tsx index 6c606d6b7..343cd5806 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/hooks/useWithdrawAction.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/hooks/useWithdrawAction.tsx @@ -6,7 +6,7 @@ import { useHandleRefresh } from '../../common/useHandleRefresh'; // 撤回 export function useWithdrawAction() { - const { refreshTable } = useHandleRefresh(100); + const { refreshTable } = useHandleRefresh(); const field = useField(); const approval = useApproval(); diff --git a/packages/plugins/@tachybase/plugin-workflow/src/server/features/approval/actions.ts b/packages/plugins/@tachybase/plugin-workflow/src/server/features/approval/actions.ts index 1aa9e75c3..b54519dcc 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/server/features/approval/actions.ts +++ b/packages/plugins/@tachybase/plugin-workflow/src/server/features/approval/actions.ts @@ -76,8 +76,7 @@ const approvals = { return actions.create(context, next); }, async update(context, next) { - const { collectionName, data, status, schemaFormId } = context.action.params.values ?? {}; - + const { collectionName, data, status, schemaFormId, summaryConfig } = context.action.params.values ?? {}; const [dataSourceName, cName] = parseCollectionName(collectionName); const dataSource = context.app.dataSourceManager.dataSources.get(dataSourceName); const collection = dataSource.collectionManager.getCollection(cName); @@ -98,11 +97,18 @@ const approvals = { values: data, updateAssociationValues, }); + + const summary = getSummary({ + summaryConfig, + data: data, + }); + context.action.mergeParams({ values: { status: status ?? APPROVAL_STATUS.SUBMITTED, data: target.toJSON(), applicantRoleName: context.state.currentRole, + summary, }, }); return actions.update(context, next);