index.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 getProcessInstanceMyPage = async (params: any) => {
  31. return await request.get({ url: '/bpm/process-instance/my-page', params })
  32. }
  33. export const getProcessInstanceManagerPage = async (params: any) => {
  34. return await request.get({ url: '/bpm/process-instance/manager-page', params })
  35. }
  36. export const createProcessInstance = async (data) => {
  37. return await request.post({ url: '/bpm/process-instance/create', data: data })
  38. }
  39. export const cancelProcessInstanceByStartUser = async (id: number, reason: string) => {
  40. const data = {
  41. id: id,
  42. reason: reason
  43. }
  44. return await request.delete({ url: '/bpm/process-instance/cancel-by-start-user', data: data })
  45. }
  46. export const cancelProcessInstanceByAdmin = async (id: number, reason: string) => {
  47. const data = {
  48. id: id,
  49. reason: reason
  50. }
  51. return await request.delete({ url: '/bpm/process-instance/cancel-by-admin', data: data })
  52. }
  53. export const getProcessInstance = async (id: string) => {
  54. return await request.get({ url: '/bpm/process-instance/get?id=' + id })
  55. }
  56. export const getProcessInstanceCopyPage = async (params: any) => {
  57. return await request.get({ url: '/bpm/process-instance/copy/page', params })
  58. }