definition.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. import request from "@/utils/request";
  2. // 查询流程定义列表
  3. export const listDefinition = async (query: any) => {
  4. return await request({
  5. url: '/flowable/definition/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 部署流程实例
  11. export const definitionStart = async (procDefId: string, data: any) => {
  12. return await request({
  13. url: '/flowable/definition/start/' + procDefId,
  14. method: 'post',
  15. data: data
  16. })
  17. }
  18. // 获取流程变量
  19. export const getProcessVariables = async (taskId: string) => {
  20. return await request({
  21. url: "/flowable/task/processVariables/" + taskId,
  22. method: "get",
  23. });
  24. };
  25. // 激活/挂起流程
  26. export const updateState = async (params: any) => {
  27. return await request({
  28. url: '/flowable/definition/updateState',
  29. method: 'put',
  30. params: params
  31. })
  32. }
  33. // 指定流程办理人员列表
  34. export const userList = async (query: any) => {
  35. return await request({
  36. url: "/flowable/definition/userList",
  37. method: "get",
  38. params: query,
  39. });
  40. }
  41. // 指定流程办理组列表
  42. export const roleList = async (query: any) => {
  43. return await request({
  44. url: "/flowable/definition/roleList",
  45. method: "get",
  46. params: query,
  47. });
  48. };
  49. // 指定流程表达式
  50. export const expList = async (query: any) => {
  51. return await request({
  52. url: "/flowable/definition/expList",
  53. method: "get",
  54. params: query,
  55. });
  56. };
  57. // 读取xml文件
  58. export const readXml = async (deployId: string) => {
  59. return await request({
  60. url: "/flowable/definition/readXml/" + deployId,
  61. method: "get",
  62. });
  63. };
  64. // 读取image文件
  65. export const readImage = async (deployId: string) => {
  66. return await request({
  67. url: "/flowable/definition/readImage/" + deployId,
  68. method: "get",
  69. });
  70. };
  71. // 获取流程执行节点
  72. export const getFlowViewer = async (procInsId: string, executionId: string) => {
  73. return await request({
  74. url: "/flowable/task/flowViewer/" + procInsId + "/" + executionId,
  75. method: "get",
  76. });
  77. };
  78. // 流程节点数据
  79. export const flowXmlAndNode = async (query: any) => {
  80. return await request({
  81. url: "/flowable/task/flowXmlAndNode",
  82. method: "get",
  83. params: query,
  84. });
  85. };
  86. // 读取xml文件
  87. export const saveXml = async (data: any) => {
  88. return await request({
  89. url: "/flowable/definition/save",
  90. method: "post",
  91. data: data,
  92. });
  93. };
  94. // 新增流程定义
  95. export const addDeployment = async (data: any) => {
  96. return await request({
  97. url: "/system/deployment",
  98. method: "post",
  99. data: data,
  100. });
  101. };
  102. // 修改流程定义
  103. export const updateDeployment = async (data: any) => {
  104. return await request({
  105. url: "/system/deployment",
  106. method: "put",
  107. data: data,
  108. });
  109. };
  110. // 删除流程定义
  111. export const delDeployment = async (deployId: string) => {
  112. return await request({
  113. url: "/flowable/definition/" + deployId,
  114. method: "delete",
  115. });
  116. };
  117. // 导出流程定义
  118. export const exportDeployment = async (query: any) => {
  119. return await request({
  120. url: "/system/deployment/export",
  121. method: "get",
  122. params: query,
  123. });
  124. };