From 3b4c01cedfcb2cc909b13d196625b401bdd6f672 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 20 Oct 2025 23:33:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd=E3=80=91bpm=20task?= =?UTF-8?q?=20=E7=9A=84=E9=83=A8=E5=88=86=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/bpm/definition/index.ts | 1 + apps/web-antd/src/api/bpm/task/index.ts | 1 + .../src/views/bpm/task/copy/index.vue | 4 +-- apps/web-antd/src/views/bpm/task/done/data.ts | 21 ++++++++++++--- .../src/views/bpm/task/done/index.vue | 26 +++++++++++++------ .../src/views/bpm/task/manager/index.vue | 5 ++-- apps/web-antd/src/views/bpm/task/todo/data.ts | 21 ++++++++++++--- .../src/views/bpm/task/todo/index.vue | 7 ++--- 8 files changed, 61 insertions(+), 25 deletions(-) diff --git a/apps/web-antd/src/api/bpm/definition/index.ts b/apps/web-antd/src/api/bpm/definition/index.ts index c7facf6ec..502d5e366 100644 --- a/apps/web-antd/src/api/bpm/definition/index.ts +++ b/apps/web-antd/src/api/bpm/definition/index.ts @@ -6,6 +6,7 @@ export namespace BpmProcessDefinitionApi { /** 流程定义 */ export interface ProcessDefinition { id: string; + key?: string; version: number; name: string; description: string; diff --git a/apps/web-antd/src/api/bpm/task/index.ts b/apps/web-antd/src/api/bpm/task/index.ts index 1ab011925..63e1af886 100644 --- a/apps/web-antd/src/api/bpm/task/index.ts +++ b/apps/web-antd/src/api/bpm/task/index.ts @@ -13,6 +13,7 @@ export namespace BpmTaskApi { status: number; // 监听器状态 event: string; // 监听事件 valueType: string; // 监听器值类型 + processInstance?: BpmProcessInstanceApi.ProcessInstance; // 流程实例 } // 流程任务 diff --git a/apps/web-antd/src/views/bpm/task/copy/index.vue b/apps/web-antd/src/views/bpm/task/copy/index.vue index 437f2551d..e13cf923c 100644 --- a/apps/web-antd/src/views/bpm/task/copy/index.vue +++ b/apps/web-antd/src/views/bpm/task/copy/index.vue @@ -46,14 +46,12 @@ const [Grid] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, search: true, }, - cellConfig: { - height: 64, - }, } as VxeTableGridOptions, }); diff --git a/apps/web-antd/src/views/bpm/task/done/data.ts b/apps/web-antd/src/views/bpm/task/done/data.ts index 9491148ec..f15df3548 100644 --- a/apps/web-antd/src/views/bpm/task/done/data.ts +++ b/apps/web-antd/src/views/bpm/task/done/data.ts @@ -19,13 +19,22 @@ export function useGridFormSchema(): VbenFormSchema[] { allowClear: true, }, }, + // TODO @AI:是不是直接 import 下,不要动态; { - fieldName: 'processDefinitionId', + fieldName: 'processDefinitionKey', label: '所属流程', - component: 'Input', + component: 'ApiSelect', componentProps: { - placeholder: '请输入流程定义的编号', + placeholder: '请选择流程定义', allowClear: true, + api: async () => { + const { getSimpleProcessDefinitionList } = await import( + '#/api/bpm/definition' + ); + return await getSimpleProcessDefinitionList(); + }, + labelField: 'name', + valueField: 'key', }, }, { @@ -88,6 +97,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { title: '发起人', minWidth: 120, }, + { + field: 'processInstance.createTime', + title: '发起时间', + minWidth: 180, + formatter: 'formatDateTime', + }, { field: 'name', title: '当前任务', diff --git a/apps/web-antd/src/views/bpm/task/done/index.vue b/apps/web-antd/src/views/bpm/task/done/index.vue index abd6fcbf6..0ea9e6670 100644 --- a/apps/web-antd/src/views/bpm/task/done/index.vue +++ b/apps/web-antd/src/views/bpm/task/done/index.vue @@ -6,6 +6,8 @@ import { DocAlert, Page } from '@vben/common-ui'; import { message } from 'ant-design-vue'; +import { $t } from '#/locales'; + import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { getTaskDonePage, withdrawTask } from '#/api/bpm/task'; import { router } from '#/router'; @@ -27,10 +29,17 @@ function handleHistory(row: BpmTaskApi.TaskManager) { /** 撤回任务 */ async function handleWithdraw(row: BpmTaskApi.TaskManager) { - await withdrawTask(row.id); - message.success('撤回成功'); - // 刷新表格数据 - await gridApi.query(); + const hideLoading = message.loading({ + content: '正在撤回中...', + duration: 0, + }); + try { + await withdrawTask(row.id); + message.success('撤回成功'); + await gridApi.query(); + } finally { + hideLoading(); + } } const [Grid, gridApi] = useVbenVxeGrid({ @@ -54,14 +63,12 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, search: true, }, - cellConfig: { - height: 64, - }, } as VxeTableGridOptions, }); @@ -90,7 +97,10 @@ const [Grid, gridApi] = useVbenVxeGrid({ type: 'link', icon: ACTION_ICON.EDIT, color: 'warning', - onClick: handleWithdraw.bind(null, row), + popConfirm: { + title: '确定要撤回该任务吗?', + confirm: handleWithdraw.bind(null, row), + }, }, { label: '历史', diff --git a/apps/web-antd/src/views/bpm/task/manager/index.vue b/apps/web-antd/src/views/bpm/task/manager/index.vue index dd47e9dcd..47496e1e7 100644 --- a/apps/web-antd/src/views/bpm/task/manager/index.vue +++ b/apps/web-antd/src/views/bpm/task/manager/index.vue @@ -43,14 +43,12 @@ const [Grid] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, search: true, }, - cellConfig: { - height: 64, - }, } as VxeTableGridOptions, }); @@ -60,6 +58,7 @@ const [Grid] = useVbenVxeGrid({ +