From 29e79448e4affbc5fd1535a48b1f1c8b7434fdde Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Mon, 1 Dec 2025 15:53:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[bpm][antd]=20todo=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?,=20=E4=B8=80=E4=BA=9B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/bpm/task/index.ts | 30 ++++- .../web-antd/src/router/routes/modules/bpm.ts | 18 --- .../src/views/bpm/model/form/index.vue | 13 +- .../bpm/processInstance/create/index.vue | 40 ++---- .../processInstance/create/modules/form.vue | 2 +- .../bpm/processInstance/detail/index.vue | 124 +++++++----------- .../detail/modules/signature.vue | 25 ++-- .../detail/modules/task-list.vue | 25 ++-- .../src/views/bpm/task/done/index.vue | 6 +- .../bpm/processInstance/detail/index.vue | 34 +++-- 10 files changed, 136 insertions(+), 181 deletions(-) diff --git a/apps/web-antd/src/api/bpm/task/index.ts b/apps/web-antd/src/api/bpm/task/index.ts index 8572b7e6e..b396594f7 100644 --- a/apps/web-antd/src/api/bpm/task/index.ts +++ b/apps/web-antd/src/api/bpm/task/index.ts @@ -7,13 +7,29 @@ import { requestClient } from '#/api/request'; export namespace BpmTaskApi { /** 流程任务 */ export interface Task { - id: number; // 编号 - name: string; // 监听器名字 - type: string; // 监听器类型 - status: number; // 监听器状态 - event: string; // 监听事件 - valueType: string; // 监听器值类型 - processInstance?: BpmProcessInstanceApi.ProcessInstance; // 流程实例 + id: string; // 编号 + name: string; // 任务名字 + status: number; // 任务状态 + createTime: number; // 创建时间 + endTime: number; // 结束时间 + durationInMillis: number; // 持续时间 + reason: string; // 审批理由 + ownerUser: any; // 负责人 + assigneeUser: any; // 处理人 + taskDefinitionKey: string; // 任务定义的标识 + processInstanceId: string; // 流程实例id + processInstance: BpmProcessInstanceApi.ProcessInstance; // 流程实例 + parentTaskId: any; // 父任务id + children: any; // 子任务 + formId: any; // 表单id + formName: any; // 表单名称 + formConf: any; // 表单配置 + formFields: any; // 表单字段 + formVariables: any; // 表单变量 + buttonsSetting: any; // 按钮设置 + signEnable: any; // 签名设置 + reasonRequire: any; // 原因设置 + nodeType: any; // 节点类型 } } diff --git a/apps/web-antd/src/router/routes/modules/bpm.ts b/apps/web-antd/src/router/routes/modules/bpm.ts index 05e0e5664..bd4a7a209 100644 --- a/apps/web-antd/src/router/routes/modules/bpm.ts +++ b/apps/web-antd/src/router/routes/modules/bpm.ts @@ -9,24 +9,6 @@ const routes: RouteRecordRaw[] = [ hideInMenu: true, }, children: [ - { - path: 'task', - name: 'BpmTask', - meta: { - title: '审批中心', - icon: 'ant-design:history-outlined', - }, - children: [ - { - path: 'my', - name: 'BpmTaskMy', - component: () => import('#/views/bpm/processInstance/index.vue'), - meta: { - title: '我的流程', - }, - }, - ], - }, { path: 'process-instance/detail', component: () => import('#/views/bpm/processInstance/detail/index.vue'), diff --git a/apps/web-antd/src/views/bpm/model/form/index.vue b/apps/web-antd/src/views/bpm/model/form/index.vue index 8dc2045b7..49e9e8999 100644 --- a/apps/web-antd/src/views/bpm/model/form/index.vue +++ b/apps/web-antd/src/views/bpm/model/form/index.vue @@ -259,9 +259,11 @@ async function validateAllSteps() { return true; } +const saveLoading = ref(false); /** 保存操作 */ async function handleSave() { try { + saveLoading.value = true; // 保存前校验所有步骤的数据 const result = await validateAllSteps(); if (!result) { @@ -309,9 +311,12 @@ async function handleSave() { } } catch (error: any) { console.error('保存失败:', error); + } finally { + saveLoading.value = false; } } - +// 发布加载中状态 +const deployLoading = ref(false); /** 发布操作 */ async function handleDeploy() { try { @@ -319,6 +324,7 @@ async function handleDeploy() { if (!formData.value.id) { await confirm('是否确认发布该流程?'); } + deployLoading.value = true; // 1.2 校验所有步骤 await validateAllSteps(); @@ -342,6 +348,8 @@ async function handleDeploy() { } catch (error: any) { console.error('发布失败:', error); message.warning(error.message || '发布失败'); + } finally { + deployLoading.value = false; } } @@ -448,11 +456,12 @@ onBeforeUnmount(() => { - diff --git a/apps/web-antd/src/views/bpm/processInstance/create/index.vue b/apps/web-antd/src/views/bpm/processInstance/create/index.vue index 691cf0bbb..638fed593 100644 --- a/apps/web-antd/src/views/bpm/processInstance/create/index.vue +++ b/apps/web-antd/src/views/bpm/processInstance/create/index.vue @@ -228,9 +228,10 @@ onMounted(() => { > -
+
{{ definition.name?.slice(0, 2) }} @@ -283,7 +287,6 @@ onMounted(() => { diff --git a/apps/web-antd/src/views/bpm/processInstance/create/modules/form.vue b/apps/web-antd/src/views/bpm/processInstance/create/modules/form.vue index 4973fc4b5..315027d7a 100644 --- a/apps/web-antd/src/views/bpm/processInstance/create/modules/form.vue +++ b/apps/web-antd/src/views/bpm/processInstance/create/modules/form.vue @@ -104,7 +104,7 @@ async function submitForm() { // 关闭并提示 message.success('发起流程成功'); await closeCurrentTab(); - await router.push({ name: 'BpmTaskMy' }); + await router.push({ name: 'BpmProcessInstanceMy' }); } finally { processInstanceStartLoading.value = false; } diff --git a/apps/web-antd/src/views/bpm/processInstance/detail/index.vue b/apps/web-antd/src/views/bpm/processInstance/detail/index.vue index 92a8ea329..7d146a871 100644 --- a/apps/web-antd/src/views/bpm/processInstance/detail/index.vue +++ b/apps/web-antd/src/views/bpm/processInstance/detail/index.vue @@ -212,20 +212,27 @@ watch( } }, ); - +const loading = ref(false); /** 初始化 */ onMounted(async () => { - await getDetail(); - // 获得用户列表 - userOptions.value = await getSimpleUserList(); + try { + loading.value = true; + await getDetail(); + // 获得用户列表 + userOptions.value = await getSimpleUserList(); + } finally { + loading.value = false; + } }); diff --git a/apps/web-antd/src/views/bpm/processInstance/detail/modules/signature.vue b/apps/web-antd/src/views/bpm/processInstance/detail/modules/signature.vue index 4122c1fc0..c3f1a86c9 100644 --- a/apps/web-antd/src/views/bpm/processInstance/detail/modules/signature.vue +++ b/apps/web-antd/src/views/bpm/processInstance/detail/modules/signature.vue @@ -5,7 +5,7 @@ import { useVbenModal } from '@vben/common-ui'; import { IconifyIcon } from '@vben/icons'; import { base64ToFile } from '@vben/utils'; -import { Button, Space, Tooltip } from 'ant-design-vue'; +import { Button, Tooltip } from 'ant-design-vue'; import Vue3Signature from 'vue3-signature'; import { uploadFile } from '#/api/infra/file'; @@ -36,30 +36,29 @@ const [Modal, modalApi] = useVbenModal({ diff --git a/apps/web-antd/src/views/bpm/processInstance/detail/modules/task-list.vue b/apps/web-antd/src/views/bpm/processInstance/detail/modules/task-list.vue index c3fb1050d..0565fcb9b 100644 --- a/apps/web-antd/src/views/bpm/processInstance/detail/modules/task-list.vue +++ b/apps/web-antd/src/views/bpm/processInstance/detail/modules/task-list.vue @@ -44,7 +44,7 @@ function useGridColumns(): VxeTableGridOptions['columns'] { field: 'approver', title: '审批人', slots: { - default: ({ row }: { row: BpmTaskApi.TaskManager }) => { + default: ({ row }: { row: BpmTaskApi.Task }) => { return row.assigneeUser?.nickname || row.ownerUser?.nickname; }, }, @@ -106,7 +106,7 @@ function handleRefresh() { } /** 显示表单详情 */ -async function handleShowFormDetail(row: BpmTaskApi.TaskManager) { +async function handleShowFormDetail(row: BpmTaskApi.Task) { // 设置表单配置和表单字段 taskForm.value = { rule: [], @@ -141,7 +141,6 @@ const [Grid, gridApi] = useVbenVxeGrid({ keepSource: true, showFooter: true, border: true, - height: 'auto', proxyConfig: { ajax: { query: async () => { @@ -159,7 +158,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ toolbarConfig: { enabled: false, }, - } as VxeTableGridOptions, + } as VxeTableGridOptions, }); defineExpose({ @@ -168,7 +167,7 @@ defineExpose({ 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 8dcaa4ed1..33811a2f2 100644 --- a/apps/web-antd/src/views/bpm/task/done/index.vue +++ b/apps/web-antd/src/views/bpm/task/done/index.vue @@ -15,7 +15,7 @@ import { useGridColumns, useGridFormSchema } from './data'; defineOptions({ name: 'BpmDoneTask' }); /** 查看历史 */ -function handleHistory(row: BpmTaskApi.TaskManager) { +function handleHistory(row: BpmTaskApi.Task) { router.push({ name: 'BpmProcessInstanceDetail', query: { @@ -26,7 +26,7 @@ function handleHistory(row: BpmTaskApi.TaskManager) { } /** 撤回任务 */ -async function handleWithdraw(row: BpmTaskApi.TaskManager) { +async function handleWithdraw(row: BpmTaskApi.Task) { const hideLoading = message.loading({ content: '正在撤回中...', duration: 0, @@ -67,7 +67,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ refresh: true, search: true, }, - } as VxeTableGridOptions, + } as VxeTableGridOptions, }); diff --git a/apps/web-ele/src/views/bpm/processInstance/detail/index.vue b/apps/web-ele/src/views/bpm/processInstance/detail/index.vue index 5713fd6fa..ed7e0bccd 100644 --- a/apps/web-ele/src/views/bpm/processInstance/detail/index.vue +++ b/apps/web-ele/src/views/bpm/processInstance/detail/index.vue @@ -344,24 +344,22 @@ onMounted(async () => { -
- - -
+ +