2023-02-11 00:44:00 +08:00
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
export type Task = {
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
}
|
2023-03-28 08:10:11 +08:00
|
|
|
|
2023-02-11 00:44:00 +08:00
|
|
|
export type ProcessInstanceVO = {
|
|
|
|
id: number
|
|
|
|
name: string
|
|
|
|
processDefinitionId: string
|
|
|
|
category: string
|
|
|
|
result: number
|
|
|
|
tasks: Task[]
|
|
|
|
fields: string[]
|
|
|
|
status: number
|
|
|
|
remark: string
|
|
|
|
businessKey: string
|
|
|
|
createTime: string
|
|
|
|
endTime: string
|
|
|
|
}
|
|
|
|
|
2024-03-17 22:14:28 +08:00
|
|
|
export type ProcessInstanceCopyVO = {
|
|
|
|
type: number
|
|
|
|
taskName: string
|
|
|
|
taskKey: string
|
|
|
|
processInstanceName: string
|
|
|
|
processInstanceKey: string
|
|
|
|
startUserId: string
|
|
|
|
options: string[]
|
2024-01-17 09:40:05 +08:00
|
|
|
reason: string
|
|
|
|
}
|
|
|
|
|
2023-04-05 20:13:35 +08:00
|
|
|
export const getMyProcessInstancePage = async (params) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return await request.get({ url: '/bpm/process-instance/my-page', params })
|
|
|
|
}
|
|
|
|
|
2023-04-05 20:13:35 +08:00
|
|
|
export const createProcessInstance = async (data) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return await request.post({ url: '/bpm/process-instance/create', data: data })
|
|
|
|
}
|
|
|
|
|
2023-04-05 20:13:35 +08:00
|
|
|
export const cancelProcessInstance = async (id: number, reason: string) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
const data = {
|
|
|
|
id: id,
|
|
|
|
reason: reason
|
|
|
|
}
|
|
|
|
return await request.delete({ url: '/bpm/process-instance/cancel', data: data })
|
|
|
|
}
|
|
|
|
|
2023-04-05 20:13:35 +08:00
|
|
|
export const getProcessInstance = async (id: number) => {
|
2023-02-11 00:44:00 +08:00
|
|
|
return await request.get({ url: '/bpm/process-instance/get?id=' + id })
|
|
|
|
}
|
2024-01-17 09:40:05 +08:00
|
|
|
|
2024-03-17 22:14:28 +08:00
|
|
|
export const getProcessInstanceCopyPage = async (params: any) => {
|
|
|
|
return await request.get({ url: '/bpm/process-instance/copy/page', params })
|
2024-01-17 09:40:05 +08:00
|
|
|
}
|