index.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import request from '@/utils/request';
  2. import { AxiosPromise } from 'axios';
  3. import { JudgeVO, JudgeForm, JudgeQuery } from '@/api/system/physical/judge/types';
  4. import { LeagueTournamentVO } from '@/api/system/physical/leagueTournament/types';
  5. /**
  6. * 查询裁判管理列表
  7. * @param query
  8. * @returns {*}
  9. */
  10. export const listJudge = (query?: JudgeQuery): AxiosPromise<JudgeVO[]> => {
  11. return request({
  12. url: '/physical/judge/list',
  13. method: 'get',
  14. params: query
  15. });
  16. };
  17. /**
  18. * 查询裁判管理详细
  19. * @param id
  20. */
  21. export const getJudge = (id: string | number): AxiosPromise<JudgeVO> => {
  22. return request({
  23. url: '/physical/judge/' + id,
  24. method: 'get'
  25. });
  26. };
  27. /**
  28. * 新增裁判管理
  29. * @param data
  30. */
  31. export const addJudge = (data: JudgeForm) => {
  32. return request({
  33. url: '/physical/judge',
  34. method: 'post',
  35. data: data
  36. });
  37. };
  38. /**
  39. * 修改裁判管理
  40. * @param data
  41. */
  42. export const updateJudge = (data: JudgeForm) => {
  43. return request({
  44. url: '/physical/judge',
  45. method: 'put',
  46. data: data
  47. });
  48. };
  49. /**
  50. * 删除裁判管理
  51. * @param id
  52. */
  53. export const delJudge = (id: string | number | Array<string | number>) => {
  54. return request({
  55. url: '/physical/judge/' + id,
  56. method: 'delete'
  57. });
  58. };
  59. /**
  60. * 下载盲注级别导入模板
  61. */
  62. export const downloadImportTemplates = async () => {
  63. const res = await request({
  64. url: '/physical/judge/importTemplate',
  65. method: 'POST',
  66. responseType: 'blob'
  67. });
  68. return res;
  69. };
  70. export const uploadJudgeFileImport = (data: FormData) => {
  71. return request({
  72. url: '/physical/judge/uploadJudgeFileImport',
  73. method: 'post',
  74. data: data,
  75. headers: {
  76. 'Content-Type': 'multipart/form-data'
  77. }
  78. });
  79. };
  80. export const selectPhysicalJudgeSelList = (): AxiosPromise<JudgeVO> => {
  81. return request({
  82. url: '/physical/judge/selectPhysicalJudgeSelList',
  83. method: 'get'
  84. });
  85. };