index.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import request from '@/config/axios'
  2. import { ProcessDefinitionVO } from '@/api/bpm/model'
  3. export type Task = {
  4. id: string
  5. name: string
  6. }
  7. export type ProcessInstanceVO = {
  8. id: number
  9. name: string
  10. processDefinitionId: string
  11. category: string
  12. result: number
  13. tasks: Task[]
  14. fields: string[]
  15. status: number
  16. remark: string
  17. businessKey: string
  18. createTime: string
  19. endTime: string
  20. processDefinition?: ProcessDefinitionVO
  21. }
  22. export const getProcessInstanceMyPage = async (params: any) => {
  23. return await request.get({ url: '/bpm/process-instance/my-page', params })
  24. }
  25. export const getProcessInstanceManagerPage = async (params: any) => {
  26. return await request.get({ url: '/bpm/process-instance/manager-page', params })
  27. }
  28. export const createProcessInstance = async (data) => {
  29. return await request.post({ url: '/bpm/process-instance/create', data: data })
  30. }
  31. export const cancelProcessInstanceByStartUser = async (id: number, reason: string) => {
  32. const data = {
  33. id: id,
  34. reason: reason
  35. }
  36. return await request.delete({ url: '/bpm/process-instance/cancel-by-start-user', data: data })
  37. }
  38. export const cancelProcessInstanceByAdmin = async (id: number, reason: string) => {
  39. const data = {
  40. id: id,
  41. reason: reason
  42. }
  43. return await request.delete({ url: '/bpm/process-instance/cancel-by-admin', data: data })
  44. }
  45. export const getProcessInstance = async (id: string) => {
  46. return await request.get({ url: '/bpm/process-instance/get?id=' + id })
  47. }
  48. export const getProcessInstanceCopyPage = async (params: any) => {
  49. return await request.get({ url: '/bpm/process-instance/copy/page', params })
  50. }