toInfrared.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import http from '@/api'
  2. import { ToInfraredVO, ToInfraredForm, ToInfraredQuery } from '@/api/interface/demo/toInfrared'
  3. /**
  4. * @name 查询可见光转红外列表
  5. * @param query 参数
  6. * @returns 返回列表
  7. */
  8. export const listToInfraredApi = (query: ToInfraredQuery) => {
  9. return http.get<ToInfraredVO[]>('/demo/toInfrared/list', query, { loading: true })
  10. }
  11. /**
  12. * @name 查询可见光转红外详细
  13. * @param id id
  14. * @returns returns
  15. */
  16. export const getToInfraredApi = (id: string | number) => {
  17. return http.get<ToInfraredVO>(`/demo/toInfrared/${id}`)
  18. }
  19. /**
  20. * @name 新增可见光转红外
  21. * @param data data
  22. * @returns returns
  23. */
  24. export const addToInfraredApi = (data: ToInfraredForm) => {
  25. return http.post<any>('/demo/toInfrared', data, { loading: true })
  26. }
  27. /**
  28. * @name 修改可见光转红外
  29. * @param data data
  30. * @returns returns
  31. */
  32. export const updateToInfraredApi = (data: ToInfraredForm) => {
  33. return http.put<any>('/demo/toInfrared', data, { loading: true })
  34. }
  35. /**
  36. * @name 删除可见光转红外
  37. * @param id id
  38. * @returns returns
  39. */
  40. export const delToInfraredApi = (id: string | number | Array<string | number>) => {
  41. return http.delete<any>(`/demo/toInfrared/${id}`)
  42. }
  43. /**
  44. * @name 下载模板
  45. * @returns returns
  46. */
  47. export const importTemplateApi = () => {
  48. return http.downloadPost('/demo/toInfrared/importTemplate', {})
  49. }
  50. /**
  51. * @name 导入数据
  52. * @returns returns
  53. */
  54. export const importToInfraredDataApi = (data: any) => {
  55. return http.post('/demo/toInfrared/importData', data)
  56. }
  57. /**
  58. * @name 导出数据
  59. * @returns returns
  60. */
  61. export const exportToInfraredApi = (data: any) => {
  62. return http.downloadPost('/demo/toInfrared/export', data)
  63. }
  64. export const startToInfraredApi = (id: string | number) => {
  65. return http.get('/demo/toInfrared/start/' + id)
  66. }
  67. export const stopToInfraredApi = (id: string | number) => {
  68. return http.get('/demo/toInfrared/stop/' + id)
  69. }
  70. /**
  71. * @name 下载压缩包
  72. * @returns returns
  73. */
  74. export const dowloadToInfraredApi = (id: string | number): Promise<any> => {
  75. return http.downloadGet('/demo/toInfrared/zip/' + id)
  76. }
  77. export const getLogToInfraredApi = (id: string | number) => {
  78. return http.get('/demo/toInfrared/log/' + id, {}, { loading: false })
  79. }
  80. export const showToInfraredModelApi = (id: string | number) => {
  81. return http.get('/demo/toInfrared/model/' + id, {}, { loading: false })
  82. }