From a4839416fea4f4d1413575a839398ad9a4bb1a4d Mon Sep 17 00:00:00 2001 From: ziye <278898052@qq.com> Date: Wed, 21 May 2025 01:29:03 +0800 Subject: [PATCH 1/9] =?UTF-8?q?refactor:=E3=80=90BPM=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E3=80=91=20=E9=92=88=E5=AF=B9TODO=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=B5=81=E7=A8=8B=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=92=8C=E7=BB=84=E4=BB=B6=EF=BC=8C=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=8F=90=E7=A4=BA=EF=BC=8C=E8=B0=83=E6=95=B4=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= 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/form/index.ts | 6 +-- .../src/api/bpm/processInstance/index.ts | 21 +++++++++ apps/web-antd/src/api/bpm/task/index.ts | 30 +++++++++++- .../web-antd/src/router/routes/modules/bpm.ts | 2 +- apps/web-antd/src/utils/formCreate.ts | 2 +- .../web-antd/src/views/bpm/category/index.vue | 6 +++ .../form/{editor.vue => designer/index.vue} | 20 ++++---- apps/web-antd/src/views/bpm/form/index.vue | 37 ++++----------- .../src/views/bpm/form/modules/form.vue | 24 +++++----- apps/web-antd/src/views/bpm/group/data.ts | 5 +- apps/web-antd/src/views/bpm/group/index.vue | 33 ++++++------- .../src/views/bpm/processExpression/index.vue | 8 +++- .../bpm/processInstance/manager/index.vue | 4 +- .../src/views/bpm/processListener/index.vue | 10 ++-- .../src/views/bpm/task/copy/index.vue | 16 +++---- apps/web-antd/src/views/bpm/task/done/data.ts | 13 ++--- .../src/views/bpm/task/done/index.vue | 23 ++++----- .../src/views/bpm/task/manager/data.ts | 12 +---- .../src/views/bpm/task/manager/index.vue | 47 +++++-------------- apps/web-antd/src/views/bpm/task/todo/data.ts | 14 +++--- .../src/views/bpm/task/todo/index.vue | 24 +++++----- 22 files changed, 182 insertions(+), 176 deletions(-) rename apps/web-antd/src/views/bpm/form/{editor.vue => designer/index.vue} (90%) diff --git a/apps/web-antd/src/api/bpm/definition/index.ts b/apps/web-antd/src/api/bpm/definition/index.ts index 562b0009c..2dc9f625b 100644 --- a/apps/web-antd/src/api/bpm/definition/index.ts +++ b/apps/web-antd/src/api/bpm/definition/index.ts @@ -4,6 +4,7 @@ import { requestClient } from '#/api/request'; /** 流程定义 */ export namespace BpmProcessDefinitionApi { + // 流程定义 export interface ProcessDefinitionVO { id: string; version: number; diff --git a/apps/web-antd/src/api/bpm/form/index.ts b/apps/web-antd/src/api/bpm/form/index.ts index 581178c5d..78ce4d6d3 100644 --- a/apps/web-antd/src/api/bpm/form/index.ts +++ b/apps/web-antd/src/api/bpm/form/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace BpmFormApi { - // TODO @siye:注释加一个。。嘿嘿 + // 流程表单 export interface FormVO { id?: number | undefined; name: string; @@ -11,7 +11,7 @@ export namespace BpmFormApi { fields: string[]; status: number; remark: string; - createTime: string; + createTime: number; } } @@ -23,7 +23,7 @@ export async function getFormPage(params: PageParam) { } /** 获取表单详情 */ -export async function getFormDetail(id: number) { +export async function getFormDetail(id: number | string) { return requestClient.get(`/bpm/form/get?id=${id}`); } diff --git a/apps/web-antd/src/api/bpm/processInstance/index.ts b/apps/web-antd/src/api/bpm/processInstance/index.ts index 23afa8c30..70d218469 100644 --- a/apps/web-antd/src/api/bpm/processInstance/index.ts +++ b/apps/web-antd/src/api/bpm/processInstance/index.ts @@ -40,6 +40,7 @@ export namespace BpmProcessInstanceApi { tasks: ApprovalTaskInfo[]; }; + // 流程实例 export type ProcessInstanceVO = { businessKey: string; category: string; @@ -59,6 +60,7 @@ export namespace BpmProcessInstanceApi { tasks?: BpmProcessInstanceApi.Task[]; }; + // 审批详情 export type ApprovalDetail = { activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[]; formFieldsPermission: any; @@ -66,6 +68,25 @@ export namespace BpmProcessInstanceApi { processInstance: BpmProcessInstanceApi.ProcessInstanceVO; status: number; }; + + // 抄送流程实例 VO + export type CopyVO = { + id: number; + startUser: User; + processInstanceId: string; + processInstanceName: string; + processInstanceStartTime: number; + activityId: string; + activityName: string; + taskId: string; + reason: string; + createUser: User; + createTime: number; + summary: { + key: string; + value: string; + }[]; + }; } /** 查询我的流程实例分页 */ diff --git a/apps/web-antd/src/api/bpm/task/index.ts b/apps/web-antd/src/api/bpm/task/index.ts index 4054b8f6a..629f25ebb 100644 --- a/apps/web-antd/src/api/bpm/task/index.ts +++ b/apps/web-antd/src/api/bpm/task/index.ts @@ -1,5 +1,7 @@ import type { PageParam, PageResult } from '@vben/request'; +import type { BpmProcessInstanceApi } from '../processInstance'; + import { requestClient } from '#/api/request'; export namespace BpmTaskApi { @@ -11,7 +13,33 @@ export namespace BpmTaskApi { status: number; // 监听器状态 event: string; // 监听事件 valueType: string; // 监听器值类型 - value: string; // 监听器值 + } + + // 流程任务 VO + export interface TaskManagerVO { + id: string; // 编号 + name: string; // 任务名称 + createTime: number; // 创建时间 + endTime: number; // 结束时间 + durationInMillis: number; // 持续时间 + status: number; // 状态 + reason: string; // 原因 + ownerUser: any; // 负责人 + assigneeUser: any; // 处理人 + taskDefinitionKey: string; // 任务定义key + processInstanceId: string; // 流程实例id + processInstance: BpmProcessInstanceApi.ProcessInstanceVO; // 流程实例 + 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 215ab26ac..8773271bc 100644 --- a/apps/web-antd/src/router/routes/modules/bpm.ts +++ b/apps/web-antd/src/router/routes/modules/bpm.ts @@ -49,7 +49,7 @@ const routes: RouteRecordRaw[] = [ { path: '/bpm/manager/form/edit', name: 'BpmFormEditor', - component: () => import('#/views/bpm/form/editor.vue'), + component: () => import('#/views/bpm/form/designer/index.vue'), meta: { title: '编辑流程表单', activePath: '/bpm/manager/form', diff --git a/apps/web-antd/src/utils/formCreate.ts b/apps/web-antd/src/utils/formCreate.ts index 1129f63fb..602649345 100644 --- a/apps/web-antd/src/utils/formCreate.ts +++ b/apps/web-antd/src/utils/formCreate.ts @@ -34,7 +34,7 @@ export const decodeFields = (fields: string[]) => { export const setConfAndFields = ( designerRef: object, conf: string, - fields: string, + fields: string | string[], ) => { // @ts-ignore designerRef.value is dynamically added by form-create-designer designerRef.value.setOption(JSON.parse(conf)); diff --git a/apps/web-antd/src/views/bpm/category/index.vue b/apps/web-antd/src/views/bpm/category/index.vue index da7d694ec..8dd26b7c3 100644 --- a/apps/web-antd/src/views/bpm/category/index.vue +++ b/apps/web-antd/src/views/bpm/category/index.vue @@ -6,11 +6,13 @@ import type { import type { BpmCategoryApi } from '#/api/bpm/category'; import { Page, useVbenModal } from '@vben/common-ui'; +import { Plus } from '@vben/icons'; import { Button, message } from 'ant-design-vue'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { deleteCategory, getCategoryPage } from '#/api/bpm/category'; +import { DocAlert } from '#/components/doc-alert'; import { $t } from '#/locales'; import { useGridColumns, useGridFormSchema } from './data'; @@ -100,6 +102,10 @@ async function onDelete(row: BpmCategoryApi.CategoryVO) {