feat:【ele】【bpm】优化 api 的注释
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import type { PageParam, PageResult } from '@vben/request';
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { BpmModelApi } from '#/api/bpm/model';
|
||||||
|
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace BpmProcessDefinitionApi {
|
export namespace BpmProcessDefinitionApi {
|
||||||
@@ -9,16 +11,21 @@ export namespace BpmProcessDefinitionApi {
|
|||||||
key?: string;
|
key?: string;
|
||||||
version: number;
|
version: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
category: string;
|
||||||
description: string;
|
description: string;
|
||||||
deploymentTime: number;
|
deploymentTime: number;
|
||||||
suspensionState: number;
|
suspensionState: number;
|
||||||
modelType: number;
|
modelType: number;
|
||||||
modelId: string;
|
modelId: string;
|
||||||
formType?: number;
|
formType?: number;
|
||||||
|
formId?: number;
|
||||||
|
formName?: string;
|
||||||
|
formCustomCreatePath?: string;
|
||||||
bpmnXml?: string;
|
bpmnXml?: string;
|
||||||
simpleModel?: string;
|
simpleModel?: string;
|
||||||
formFields?: string[];
|
formFields?: string[];
|
||||||
icon?: string;
|
icon?: string;
|
||||||
|
startUsers?: BpmModelApi.UserInfo[];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,6 @@
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace BpmModelApi {
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 流程模型 */
|
/** 流程模型 */
|
||||||
export interface Model {
|
export interface Model {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -42,6 +21,27 @@ export namespace BpmModelApi {
|
|||||||
bpmnXml: string;
|
bpmnXml: string;
|
||||||
startUsers?: UserInfo[];
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 模型分类信息 */
|
/** 模型分类信息 */
|
||||||
|
|||||||
@@ -11,43 +11,6 @@ import type { BpmModelApi } from '#/api/bpm/model';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace BpmProcessInstanceApi {
|
export namespace BpmProcessInstanceApi {
|
||||||
// TODO @芋艿:一些注释缺少或者不对;
|
|
||||||
export interface Task {
|
|
||||||
id: number;
|
|
||||||
name: string;
|
|
||||||
assigneeUser?: User;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface User {
|
|
||||||
avatar: 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 {
|
export interface ProcessInstance {
|
||||||
businessKey: string;
|
businessKey: string;
|
||||||
@@ -73,8 +36,23 @@ export namespace BpmProcessInstanceApi {
|
|||||||
tasks?: BpmProcessInstanceApi.Task[];
|
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[];
|
activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[];
|
||||||
formFieldsPermission: any;
|
formFieldsPermission: any;
|
||||||
processDefinition: BpmModelApi.ProcessDefinition;
|
processDefinition: BpmModelApi.ProcessDefinition;
|
||||||
@@ -83,8 +61,32 @@ export namespace BpmProcessInstanceApi {
|
|||||||
todoTask: BpmTaskApi.Task;
|
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;
|
activityId: string;
|
||||||
activityName: string;
|
activityName: string;
|
||||||
createTime: number;
|
createTime: number;
|
||||||
@@ -101,6 +103,19 @@ export namespace BpmProcessInstanceApi {
|
|||||||
}[];
|
}[];
|
||||||
taskId: string;
|
taskId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 流程实例的打印数据响应 */
|
||||||
|
export interface ProcessPrintDataRespVO {
|
||||||
|
printTemplateEnable: boolean;
|
||||||
|
printTemplateHtml?: string;
|
||||||
|
processInstance: ProcessInstance;
|
||||||
|
tasks: {
|
||||||
|
description: string;
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
signPicUrl?: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询我的流程实例分页 */
|
/** 查询我的流程实例分页 */
|
||||||
@@ -177,7 +192,7 @@ export async function updateProcessInstance(
|
|||||||
|
|
||||||
/** 获取审批详情 */
|
/** 获取审批详情 */
|
||||||
export async function getApprovalDetail(params: any) {
|
export async function getApprovalDetail(params: any) {
|
||||||
return requestClient.get<BpmProcessInstanceApi.ApprovalDetail>(
|
return requestClient.get<BpmProcessInstanceApi.ApprovalDetailRespVO>(
|
||||||
`/bpm/process-instance/get-approval-detail`,
|
`/bpm/process-instance/get-approval-detail`,
|
||||||
{ params },
|
{ params },
|
||||||
);
|
);
|
||||||
@@ -191,17 +206,16 @@ export async function getNextApprovalNodes(params: any) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取表单字段权限 */
|
|
||||||
export async function getFormFieldsPermission(params: any) {
|
|
||||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
|
||||||
`/bpm/process-instance/get-form-fields-permission`,
|
|
||||||
{ params },
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 获取流程实例 BPMN 模型视图 */
|
/** 获取流程实例 BPMN 模型视图 */
|
||||||
export async function getProcessInstanceBpmnModelView(id: string) {
|
export async function getProcessInstanceBpmnModelView(id: string) {
|
||||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||||
`/bpm/process-instance/get-bpmn-model-view?id=${id}`,
|
`/bpm/process-instance/get-bpmn-model-view?id=${id}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 获取流程实例打印数据 */
|
||||||
|
export async function getProcessInstancePrintData(id: string) {
|
||||||
|
return requestClient.get<BpmProcessInstanceApi.ProcessPrintDataRespVO>(
|
||||||
|
`/bpm/process-instance/get-print-data?processInstanceId=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace BpmProcessListenerApi {
|
export namespace BpmProcessListenerApi {
|
||||||
/** BPM 流程监听器 */
|
/** 流程监听器 */
|
||||||
export interface ProcessListener {
|
export interface ProcessListener {
|
||||||
id: number; // 编号
|
id: number; // 编号
|
||||||
name: string; // 监听器名字
|
name: string; // 监听器名字
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { BpmProcessInstanceApi } from '../processInstance';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace BpmTaskApi {
|
export namespace BpmTaskApi {
|
||||||
/** BPM 流程监听器 */
|
/** 流程任务 */
|
||||||
export interface Task {
|
export interface Task {
|
||||||
id: number; // 编号
|
id: number; // 编号
|
||||||
name: string; // 监听器名字
|
name: string; // 监听器名字
|
||||||
@@ -15,33 +15,6 @@ export namespace BpmTaskApi {
|
|||||||
valueType: string; // 监听器值类型
|
valueType: string; // 监听器值类型
|
||||||
processInstance?: BpmProcessInstanceApi.ProcessInstance; // 流程实例
|
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}`);
|
return await requestClient.get(`/bpm/task/list-by-return?id=${id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 退回 */
|
/** 退回任务 */
|
||||||
export const returnTask = async (data: any) => {
|
export const returnTask = async (data: any) => {
|
||||||
return await requestClient.put('/bpm/task/return', data);
|
return await requestClient.put('/bpm/task/return', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 委派
|
/** 委派任务 */
|
||||||
export const delegateTask = async (data: any) => {
|
export const delegateTask = async (data: any) => {
|
||||||
return await requestClient.put('/bpm/task/delegate', data);
|
return await requestClient.put('/bpm/task/delegate', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 转派
|
/** 转派任务 */
|
||||||
export const transferTask = async (data: any) => {
|
export const transferTask = async (data: any) => {
|
||||||
return await requestClient.put('/bpm/task/transfer', data);
|
return await requestClient.put('/bpm/task/transfer', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 加签
|
/** 加签任务 */
|
||||||
export const signCreateTask = async (data: any) => {
|
export const signCreateTask = async (data: any) => {
|
||||||
return await requestClient.put('/bpm/task/create-sign', data);
|
return await requestClient.put('/bpm/task/create-sign', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 减签
|
/** 减签任务 */
|
||||||
export const signDeleteTask = async (data: any) => {
|
export const signDeleteTask = async (data: any) => {
|
||||||
return await requestClient.delete('/bpm/task/delete-sign', data);
|
return await requestClient.delete('/bpm/task/delete-sign', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 抄送
|
/** 抄送任务 */
|
||||||
export const copyTask = async (data: any) => {
|
export const copyTask = async (data: any) => {
|
||||||
return await requestClient.put('/bpm/task/copy', data);
|
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) => {
|
export const getChildrenTaskList = async (id: string) => {
|
||||||
return await requestClient.get(
|
return await requestClient.get(
|
||||||
`/bpm/task/list-by-parent-task-id?parentTaskId=${id}`,
|
`/bpm/task/list-by-parent-task-id?parentTaskId=${id}`,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 撤回任务
|
/** 撤回任务 */
|
||||||
export const withdrawTask = async (taskId: string) => {
|
export const withdrawTask = async (taskId: string) => {
|
||||||
return await requestClient.put('/bpm/task/withdraw', null, {
|
return await requestClient.put('/bpm/task/withdraw', null, {
|
||||||
params: { taskId },
|
params: { taskId },
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace BpmUserGroupApi {
|
export namespace BpmUserGroupApi {
|
||||||
/** BPM 用户组 */
|
/** 用户组 */
|
||||||
export interface UserGroup {
|
export interface UserGroup {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { useGridColumns, useGridFormSchema } from './data';
|
|||||||
defineOptions({ name: 'BpmCopyTask' });
|
defineOptions({ name: 'BpmCopyTask' });
|
||||||
|
|
||||||
/** 任务详情 */
|
/** 任务详情 */
|
||||||
function handleDetail(row: BpmProcessInstanceApi.Copy) {
|
function handleDetail(row: BpmProcessInstanceApi.ProcessInstanceCopyRespVO) {
|
||||||
const query = {
|
const query = {
|
||||||
id: row.processInstanceId,
|
id: row.processInstanceId,
|
||||||
...(row.activityId && { activityId: row.activityId }),
|
...(row.activityId && { activityId: row.activityId }),
|
||||||
@@ -52,7 +52,7 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<BpmProcessInstanceApi.Copy>,
|
} as VxeTableGridOptions<BpmProcessInstanceApi.ProcessInstanceCopyRespVO>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
|
} as VxeTableGridOptions<BpmTaskApi.Task>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user