提交 | 用户 | 时间
|
820397
|
1 |
import request from '@/config/axios' |
H |
2 |
import { ProcessDefinitionVO } from '@/api/bpm/model' |
3e359e
|
3 |
import { NodeType, CandidateStrategy } from '@/components/SimpleProcessDesignerV2/src/consts' |
820397
|
4 |
export type Task = { |
H |
5 |
id: string |
|
6 |
name: string |
|
7 |
} |
|
8 |
|
|
9 |
export type ProcessInstanceVO = { |
|
10 |
id: number |
|
11 |
name: string |
|
12 |
processDefinitionId: string |
|
13 |
category: string |
|
14 |
result: number |
|
15 |
tasks: Task[] |
|
16 |
fields: string[] |
|
17 |
status: number |
|
18 |
remark: string |
|
19 |
businessKey: string |
|
20 |
createTime: string |
|
21 |
endTime: string |
|
22 |
processDefinition?: ProcessDefinitionVO |
3e359e
|
23 |
} |
H |
24 |
|
|
25 |
// 用户信息 |
|
26 |
export type User = { |
|
27 |
id: number |
|
28 |
nickname: string |
|
29 |
avatar: string |
|
30 |
} |
|
31 |
|
|
32 |
// 审批任务信息 |
|
33 |
export type ApprovalTaskInfo = { |
|
34 |
id: number |
|
35 |
ownerUser: User |
|
36 |
assigneeUser: User |
|
37 |
status: number |
|
38 |
reason: string |
|
39 |
} |
|
40 |
|
|
41 |
// 审批节点信息 |
|
42 |
export type ApprovalNodeInfo = { |
|
43 |
id: number |
|
44 |
name: string |
|
45 |
nodeType: NodeType |
|
46 |
candidateStrategy?: CandidateStrategy |
|
47 |
status: number |
|
48 |
startTime?: Date |
|
49 |
endTime?: Date |
|
50 |
candidateUsers?: User[] |
|
51 |
tasks: ApprovalTaskInfo[] |
820397
|
52 |
} |
H |
53 |
|
|
54 |
export const getProcessInstanceMyPage = async (params: any) => { |
|
55 |
return await request.get({ url: '/bpm/process-instance/my-page', params }) |
|
56 |
} |
|
57 |
|
|
58 |
export const getProcessInstanceManagerPage = async (params: any) => { |
|
59 |
return await request.get({ url: '/bpm/process-instance/manager-page', params }) |
|
60 |
} |
|
61 |
|
|
62 |
export const createProcessInstance = async (data) => { |
|
63 |
return await request.post({ url: '/bpm/process-instance/create', data: data }) |
|
64 |
} |
|
65 |
|
|
66 |
export const cancelProcessInstanceByStartUser = async (id: number, reason: string) => { |
|
67 |
const data = { |
|
68 |
id: id, |
|
69 |
reason: reason |
|
70 |
} |
|
71 |
return await request.delete({ url: '/bpm/process-instance/cancel-by-start-user', data: data }) |
|
72 |
} |
|
73 |
|
|
74 |
export const cancelProcessInstanceByAdmin = async (id: number, reason: string) => { |
|
75 |
const data = { |
|
76 |
id: id, |
|
77 |
reason: reason |
|
78 |
} |
|
79 |
return await request.delete({ url: '/bpm/process-instance/cancel-by-admin', data: data }) |
|
80 |
} |
|
81 |
|
|
82 |
export const getProcessInstance = async (id: string) => { |
|
83 |
return await request.get({ url: '/bpm/process-instance/get?id=' + id }) |
|
84 |
} |
|
85 |
|
|
86 |
export const getProcessInstanceCopyPage = async (params: any) => { |
|
87 |
return await request.get({ url: '/bpm/process-instance/copy/page', params }) |
|
88 |
} |
3e359e
|
89 |
|
H |
90 |
// 获取审批详情 |
|
91 |
export const getApprovalDetail = async (params: any) => { |
|
92 |
return await request.get({ url: 'bpm/process-instance/get-approval-detail' , params }) |
|
93 |
} |
|
94 |
|
|
95 |
// 获取表单字段权限 |
|
96 |
export const getFormFieldsPermission = async (params: any) => { |
|
97 |
return await request.get({ url: '/bpm/process-instance/get-form-fields-permission', params }) |
|
98 |
} |
|
99 |
|
|
100 |
// 获取流程实例的 BPMN 模型视图 |
|
101 |
export const getProcessInstanceBpmnModelView = async (id: string) => { |
|
102 |
return await request.get({ url: '/bpm/process-instance/get-bpmn-model-view?id=' + id }) |
|
103 |
} |