index.ts 1.3 KB

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