index.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import request from '@/utils/request';
  2. import { AxiosPromise } from 'axios';
  3. import { CategoryVO, CategoryForm, CategoryQuery } from '@/api/workflow/category/types';
  4. /**
  5. * 查询流程分类列表
  6. * @param query
  7. * @returns {*}
  8. */
  9. export const listCategory = (query?: CategoryQuery): AxiosPromise<CategoryVO[]> => {
  10. return request({
  11. url: '/workflow/category/list',
  12. method: 'get',
  13. params: query
  14. });
  15. };
  16. /**
  17. * 查询流程分类详细
  18. * @param id
  19. */
  20. export const getCategory = (id: string | number): AxiosPromise<CategoryVO> => {
  21. return request({
  22. url: '/workflow/category/' + id,
  23. method: 'get'
  24. });
  25. };
  26. /**
  27. * 新增流程分类
  28. * @param data
  29. */
  30. export const addCategory = (data: CategoryForm) => {
  31. return request({
  32. url: '/workflow/category',
  33. method: 'post',
  34. data: data
  35. });
  36. };
  37. /**
  38. * 修改流程分类
  39. * @param data
  40. */
  41. export const updateCategory = (data: CategoryForm) => {
  42. return request({
  43. url: '/workflow/category',
  44. method: 'put',
  45. data: data
  46. });
  47. };
  48. /**
  49. * 删除流程分类
  50. * @param id
  51. */
  52. export const delCategory = (id: string | number | Array<string | number>) => {
  53. return request({
  54. url: '/workflow/category/' + id,
  55. method: 'delete'
  56. });
  57. };