From 55cd88080c049256fb04ef25371a9666021b4050 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 19 Nov 2025 22:18:02 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd=E3=80=91=E3=80=90mp?= =?UTF-8?q?=E3=80=91=E4=BC=98=E5=8C=96=20api=20=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/bpm/model/index.ts | 43 ++++--- .../src/api/bpm/processInstance/index.ts | 116 ++++++++---------- .../src/api/bpm/processListener/index.ts | 2 +- apps/web-antd/src/api/bpm/task/index.ts | 52 ++------ apps/web-antd/src/api/bpm/userGroup/index.ts | 2 +- .../detail/modules/process-print.vue | 2 +- .../src/views/bpm/task/copy/index.vue | 4 +- .../src/views/bpm/task/manager/index.vue | 2 +- 8 files changed, 89 insertions(+), 134 deletions(-) diff --git a/apps/web-antd/src/api/bpm/model/index.ts b/apps/web-antd/src/api/bpm/model/index.ts index e16627fa1..545a73c03 100644 --- a/apps/web-antd/src/api/bpm/model/index.ts +++ b/apps/web-antd/src/api/bpm/model/index.ts @@ -1,28 +1,6 @@ import { requestClient } from '#/api/request'; export namespace BpmModelApi { - /** 用户信息 TODO 这个是不是可以抽取出来定义在公共模块 */ - // TODO @芋艿:一起看看。 - export interface UserInfo { - id: number; - nickname: string; - avatar?: string; - deptId?: number; - deptName?: string; - } - - /** 流程定义 */ - export interface ProcessDefinition { - id: string; - key?: string; - version: number; - deploymentTime: number; - suspensionState: number; - formType?: number; - formCustomViewPath?: string; - formFields?: string[]; - } - /** 流程模型 */ export interface Model { id: number; @@ -43,6 +21,27 @@ export namespace BpmModelApi { bpmnXml: string; startUsers?: UserInfo[]; } + + /** 流程定义 */ + export interface ProcessDefinition { + id: string; + key?: string; + version: number; + deploymentTime: number; + suspensionState: number; + formType?: number; + formCustomViewPath?: string; + formFields?: string[]; + } + + /** 用户信息 */ + export interface UserInfo { + id: number; + nickname: string; + avatar?: string; + deptId?: number; + deptName?: string; + } } /** 模型分类信息 */ diff --git a/apps/web-antd/src/api/bpm/processInstance/index.ts b/apps/web-antd/src/api/bpm/processInstance/index.ts index 06fb2fec1..7ee5421f8 100644 --- a/apps/web-antd/src/api/bpm/processInstance/index.ts +++ b/apps/web-antd/src/api/bpm/processInstance/index.ts @@ -11,44 +11,6 @@ import type { BpmModelApi } from '#/api/bpm/model'; import { requestClient } from '#/api/request'; export namespace BpmProcessInstanceApi { - // TODO @芋艿:一些注释缺少或者不对; - export interface Task { - id: number; - name: string; - assigneeUser?: User; - } - - export interface User { - avatar: string; - deptName?: string; - id: number; - nickname: string; - } - - // 审批任务信息 - export interface ApprovalTaskInfo { - assigneeUser: User; - id: number; - ownerUser: User; - reason: string; - signPicUrl: string; - status: number; - } - - // 审批节点信息 - export interface ApprovalNodeInfo { - candidateStrategy?: BpmCandidateStrategyEnum; - candidateUsers?: User[]; - endTime?: Date; - id: string; - name: string; - nodeType: BpmNodeTypeEnum; - startTime?: Date; - status: number; - processInstanceId?: string; - tasks: ApprovalTaskInfo[]; - } - /** 流程实例 */ export interface ProcessInstance { businessKey: string; @@ -74,8 +36,23 @@ export namespace BpmProcessInstanceApi { tasks?: BpmProcessInstanceApi.Task[]; } - // 审批详情 - export interface ApprovalDetail { + /** 流程实例的任务 */ + export interface Task { + id: number; + name: string; + assigneeUser?: User; + } + + /** 流程实例的用户信息 */ + export interface User { + id: number; + nickname: string; + avatar: string; + deptName?: string; + } + + /** 审批详情 */ + export interface ApprovalDetailRespVO { activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[]; formFieldsPermission: any; processDefinition: BpmModelApi.ProcessDefinition; @@ -84,8 +61,32 @@ export namespace BpmProcessInstanceApi { todoTask: BpmTaskApi.Task; } - // 抄送流程实例 - export interface Copy { + /** 审批详情的节点信息 */ + export interface ApprovalNodeInfo { + candidateStrategy?: BpmCandidateStrategyEnum; + candidateUsers?: User[]; + endTime?: Date; + id: string; + name: string; + nodeType: BpmNodeTypeEnum; + startTime?: Date; + status: number; + processInstanceId?: string; + tasks: ApprovalTaskInfo[]; + } + + /** 审批详情的节点的任务 */ + export interface ApprovalTaskInfo { + id: number; + assigneeUser: User; + ownerUser: User; + reason: string; + signPicUrl: string; + status: number; + } + + /** 抄送流程实例 */ + export interface ProcessInstanceCopyRespVO { activityId: string; activityName: string; createTime: number; @@ -103,20 +104,17 @@ export namespace BpmProcessInstanceApi { taskId: string; } - /** 打印数据任务信息 */ - export interface PrintTask { - description: string; - id: number; - name: string; - signPicUrl?: string; - } - - /** 打印数据 */ - export interface PrintData { + /** 流程实例的打印数据响应 */ + export interface ProcessPrintDataRespVO { printTemplateEnable: boolean; printTemplateHtml?: string; processInstance: ProcessInstance; - tasks: PrintTask[]; + tasks: { + description: string; + id: number; + name: string; + signPicUrl?: string; + }[]; } } @@ -194,7 +192,7 @@ export async function updateProcessInstance( /** 获取审批详情 */ export async function getApprovalDetail(params: any) { - return requestClient.get( + return requestClient.get( `/bpm/process-instance/get-approval-detail`, { params }, ); @@ -208,14 +206,6 @@ export async function getNextApprovalNodes(params: any) { ); } -/** 获取表单字段权限 */ -export async function getFormFieldsPermission(params: any) { - return requestClient.get( - `/bpm/process-instance/get-form-fields-permission`, - { params }, - ); -} - /** 获取流程实例 BPMN 模型视图 */ export async function getProcessInstanceBpmnModelView(id: string) { return requestClient.get( @@ -225,7 +215,7 @@ export async function getProcessInstanceBpmnModelView(id: string) { /** 获取流程实例打印数据 */ export async function getProcessInstancePrintData(id: string) { - return requestClient.get( + return requestClient.get( `/bpm/process-instance/get-print-data?processInstanceId=${id}`, ); } diff --git a/apps/web-antd/src/api/bpm/processListener/index.ts b/apps/web-antd/src/api/bpm/processListener/index.ts index df5ba3788..a0262e742 100644 --- a/apps/web-antd/src/api/bpm/processListener/index.ts +++ b/apps/web-antd/src/api/bpm/processListener/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace BpmProcessListenerApi { - /** BPM 流程监听器 */ + /** 流程监听器 */ export interface ProcessListener { id: number; // 编号 name: string; // 监听器名字 diff --git a/apps/web-antd/src/api/bpm/task/index.ts b/apps/web-antd/src/api/bpm/task/index.ts index 63e1af886..8572b7e6e 100644 --- a/apps/web-antd/src/api/bpm/task/index.ts +++ b/apps/web-antd/src/api/bpm/task/index.ts @@ -5,7 +5,7 @@ import type { BpmProcessInstanceApi } from '../processInstance'; import { requestClient } from '#/api/request'; export namespace BpmTaskApi { - /** BPM 流程监听器 */ + /** 流程任务 */ export interface Task { id: number; // 编号 name: string; // 监听器名字 @@ -15,33 +15,6 @@ export namespace BpmTaskApi { valueType: string; // 监听器值类型 processInstance?: BpmProcessInstanceApi.ProcessInstance; // 流程实例 } - - // 流程任务 - export interface TaskManager { - 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.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; // 节点类型 - } } /** 查询待办任务分页 */ @@ -88,51 +61,44 @@ export const getTaskListByReturn = async (id: string) => { return await requestClient.get(`/bpm/task/list-by-return?id=${id}`); }; -/** 退回 */ +/** 退回任务 */ export const returnTask = async (data: any) => { return await requestClient.put('/bpm/task/return', data); }; -// 委派 +/** 委派任务 */ export const delegateTask = async (data: any) => { return await requestClient.put('/bpm/task/delegate', data); }; -// 转派 +/** 转派任务 */ export const transferTask = async (data: any) => { return await requestClient.put('/bpm/task/transfer', data); }; -// 加签 +/** 加签任务 */ export const signCreateTask = async (data: any) => { return await requestClient.put('/bpm/task/create-sign', data); }; -// 减签 +/** 减签任务 */ export const signDeleteTask = async (data: any) => { return await requestClient.delete('/bpm/task/delete-sign', data); }; -// 抄送 +/** 抄送任务 */ export const copyTask = async (data: any) => { return await requestClient.put('/bpm/task/copy', data); }; -// 获取我的待办任务 -export const myTodoTask = async (processInstanceId: string) => { - return await requestClient.get( - `/bpm/task/my-todo?processInstanceId=${processInstanceId}`, - ); -}; - -// 获取加签任务列表 +/** 获取加签任务列表 */ export const getChildrenTaskList = async (id: string) => { return await requestClient.get( `/bpm/task/list-by-parent-task-id?parentTaskId=${id}`, ); }; -// 撤回任务 +/** 撤回任务 */ export const withdrawTask = async (taskId: string) => { return await requestClient.put('/bpm/task/withdraw', null, { params: { taskId }, diff --git a/apps/web-antd/src/api/bpm/userGroup/index.ts b/apps/web-antd/src/api/bpm/userGroup/index.ts index 9e8f9a1bc..6e23410a9 100644 --- a/apps/web-antd/src/api/bpm/userGroup/index.ts +++ b/apps/web-antd/src/api/bpm/userGroup/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace BpmUserGroupApi { - /** BPM 用户组 */ + /** 用户组 */ export interface UserGroup { id: number; name: string; diff --git a/apps/web-antd/src/views/bpm/processInstance/detail/modules/process-print.vue b/apps/web-antd/src/views/bpm/processInstance/detail/modules/process-print.vue index 504db968a..2759edf23 100644 --- a/apps/web-antd/src/views/bpm/processInstance/detail/modules/process-print.vue +++ b/apps/web-antd/src/views/bpm/processInstance/detail/modules/process-print.vue @@ -18,7 +18,7 @@ import { decodeFields } from '#/components/form-create'; const userStore = useUserStore(); -const printData = ref(); +const printData = ref(); const userName = computed(() => userStore.userInfo?.nickname ?? ''); const printTime = ref(formatDate(new Date(), 'YYYY-MM-DD HH:mm')); const formFields = ref([]); 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 e13cf923c..f567452fc 100644 --- a/apps/web-antd/src/views/bpm/task/copy/index.vue +++ b/apps/web-antd/src/views/bpm/task/copy/index.vue @@ -14,7 +14,7 @@ import { useGridColumns, useGridFormSchema } from './data'; defineOptions({ name: 'BpmCopyTask' }); /** 任务详情 */ -function handleDetail(row: BpmProcessInstanceApi.Copy) { +function handleDetail(row: BpmProcessInstanceApi.ProcessInstanceCopyRespVO) { const query = { id: row.processInstanceId, ...(row.activityId && { activityId: row.activityId }), @@ -52,7 +52,7 @@ const [Grid] = useVbenVxeGrid({ refresh: true, search: true, }, - } as VxeTableGridOptions, + } as VxeTableGridOptions, }); 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 47496e1e7..effc1f469 100644 --- a/apps/web-antd/src/views/bpm/task/manager/index.vue +++ b/apps/web-antd/src/views/bpm/task/manager/index.vue @@ -49,7 +49,7 @@ const [Grid] = useVbenVxeGrid({ refresh: true, search: true, }, - } as VxeTableGridOptions, + } as VxeTableGridOptions, });