examine.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * @Author: tengmingxue 1473375109@qq.com
  3. * @Date: 2023-09-11 19:36:34
  4. * @LastEditors: tengmingxue 1473375109@qq.com
  5. * @LastEditTime: 2023-09-20 15:34:53
  6. * @FilePath: \xld-gis-admin\src\api\resource\examine.ts
  7. * @Description: 流程配置信息api
  8. */
  9. import { defHttp } from '/@/utils/http/axios';
  10. enum Api {
  11. SelectFlowInfo = '/base-center/flow/selectFlowInfo', //查询流程信息
  12. SaveFlowInfo = '/base-center/flow/saveFlowInfo', //新增、更新流程信息
  13. SaveFlowInfoAll = '/base-center/flow/insertFlowInfoAll', //新增流程、节点、节点人员信息
  14. DelFLowInfo = '/base-center/flow/deleteFlowInfo', //删除流程
  15. SelectLowConfig = '/base-center/flow/selectFlowInfoAll', //查询流程、节点、节点人员信息
  16. }
  17. /**
  18. * @description: 查询流程信息
  19. * @param: page:页数 must
  20. * @param: rows:每页数据条数 must
  21. * @param: keyStr:模糊查询关键字
  22. * @param: id:流程id
  23. */
  24. export const queryFlowInfo = (params) => {
  25. params['row'] = params?.pageSize ? params?.pageSize : 10
  26. return new Promise<void>((resolve) => {
  27. defHttp.post({ url: Api.SelectFlowInfo, params: params }).then((res) => {
  28. const result = res.resp_code === 0 ? res.datas : []
  29. result.forEach(item => {
  30. item['status'] = true
  31. });
  32. resolve(result)
  33. })
  34. })
  35. };
  36. /**
  37. * @description:根据流程业务id查询流程配置所有信息
  38. * @param: ids:字符串数组
  39. */
  40. export const queryFlowInfoById = (param) => {
  41. const data = param.toString()
  42. // const dataFrom = new FormData()
  43. // dataFrom.append('',data)
  44. return new Promise<void>((resolve) => {
  45. defHttp.post({
  46. url: Api.SelectLowConfig,
  47. data,
  48. headers: {
  49. 'Content-Type': 'application/json;charset=UTF-8'
  50. },
  51. }).then((res) => {
  52. const result = (res.resp_code === 0 && res.datas.length > 0) ? res.datas[0] : null
  53. resolve(result)
  54. })
  55. })
  56. }
  57. /**
  58. * @description: 一次提交流程配置信息
  59. * @param: flowInfo:流程信息 must
  60. * @param: flowNode:流程步骤结点信息 must
  61. * @param: flowNodePerson:流程审核人信息 must
  62. *
  63. */
  64. export const addFlowInfoAll = (params) => {
  65. return new Promise<void>((resolve) => {
  66. defHttp.post({ url: Api.SaveFlowInfoAll, params }).then((res) => {
  67. resolve(res)
  68. })
  69. })
  70. };
  71. /**
  72. * @description: 批量删除流程信息
  73. * @param: ids:流程信息id must
  74. *
  75. */
  76. export const delFlowInfo = (params) => {
  77. const data = params.toString()
  78. return new Promise<void>((resolve) => {
  79. defHttp.post({
  80. url: Api.DelFLowInfo, data, headers: {
  81. 'Content-Type': 'application/json;charset=UTF-8'
  82. },
  83. }).then((res) => {
  84. resolve(res)
  85. })
  86. })
  87. };