feat: bpm api

This commit is contained in:
xingyu
2022-07-28 12:18:38 +08:00
parent 88fc7ed39b
commit ee6317e906
20 changed files with 827 additions and 15 deletions

View File

@ -0,0 +1,23 @@
import { useAxios } from '@/hooks/web/useAxios'
import { ProcessInstanceVO } from './types'
const request = useAxios()
export const getMyProcessInstancePage = async (params) => {
return await request.get({ url: '/bpm/process-instance/my-page', params })
}
export const createProcessInstance = async (data: ProcessInstanceVO) => {
return await request.post({ url: '/bpm/process-instance/create', data: data })
}
export const cancelProcessInstance = async (id: number, reason: string) => {
const data = {
id: id,
reason: reason
}
return await request.delete({ url: '/bpm/process-instance/cancel', data: data })
}
export const getProcessInstance = async (id: number) => {
return await request.get({ url: '/bpm/process-instance/get?id=' + id })
}

View File

@ -0,0 +1,18 @@
export type task = {
id: string
name: string
}
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
}