TargetDetection.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import http from '@/api'
  2. import { TargetDetectionVO, TargetDetectionForm, TargetDetectionQuery } from '@/api/interface/demo/TargetDetection'
  3. /**
  4. * @name 查询目标检测列表
  5. * @param query 参数
  6. * @returns 返回列表
  7. */
  8. export const listTargetDetectionApi = (query: TargetDetectionQuery) => {
  9. return http.get<TargetDetectionVO[]>('/demo/TargetDetection/list', query, { loading: true })
  10. }
  11. /**
  12. * @name 查询目标检测详细
  13. * @param id id
  14. * @returns returns
  15. */
  16. export const getTargetDetectionApi = (id: string | number) => {
  17. return http.get<TargetDetectionVO>(`/demo/TargetDetection/${id}`)
  18. }
  19. /**
  20. * @name 新增目标检测
  21. * @param data data
  22. * @returns returns
  23. */
  24. export const addTargetDetectionApi = (data: TargetDetectionForm) => {
  25. return http.post<any>('/demo/TargetDetection', data, { loading: false })
  26. }
  27. /**
  28. * @name 修改目标检测
  29. * @param data data
  30. * @returns returns
  31. */
  32. export const updateTargetDetectionApi = (data: TargetDetectionForm) => {
  33. return http.put<any>('/demo/TargetDetection', data, { loading: false })
  34. }
  35. /**
  36. * @name 删除目标检测
  37. * @param id id
  38. * @returns returns
  39. */
  40. export const delTargetDetectionApi = (id: string | number | Array<string | number>) => {
  41. return http.delete<any>(`/demo/TargetDetection/${id}`)
  42. }
  43. /**
  44. * @name 下载模板
  45. * @returns returns
  46. */
  47. export const importTemplateApi = () => {
  48. return http.downloadPost('/demo/TargetDetection/importTemplate', {})
  49. }
  50. /**
  51. * @name 导入数据
  52. * @returns returns
  53. */
  54. export const importTargetDetectionDataApi = (data: any) => {
  55. return http.post('/demo/TargetDetection/importData', data)
  56. }
  57. /**
  58. * @name 导出数据
  59. * @returns returns
  60. */
  61. export const exportTargetDetectionApi = (data: any) => {
  62. return http.downloadPost('/demo/TargetDetection/export', data)
  63. }
  64. export const startTargetDetectionApi = (id: string | number) => {
  65. return http.get<any>(`/demo/TargetDetection/start/${id}`)
  66. }
  67. export const stopTargetDetectionApi = (id: string | number) => {
  68. return http.get('/demo/TargetDetection/stop/' + id)
  69. }
  70. /**
  71. * @name 下载压缩包
  72. * @returns returns
  73. */
  74. export const dowloadTargetDetectionApi = (id: string | number): Promise<any> => {
  75. return http.downloadGet('/demo/TargetDetection/zip/' + id)
  76. }