index.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import request from '@/config/axios'
  2. // 安防前端设备 VO
  3. export interface CameraVO {
  4. id: number // 设备ID
  5. name: string // 名称
  6. code: string // 编号
  7. sort: number // 排序
  8. type: string // 类型
  9. serverId: number // 后端设备
  10. aiMode: string // AI模型
  11. warn: string // 报警状态
  12. warnApi: string // 报警接口
  13. desc: string // 描述
  14. }
  15. // 安防前端设备 API
  16. export const CameraApi = {
  17. // 查询安防前端设备分页
  18. getCameraPage: async (params: any) => {
  19. return await request.get({ url: `/safe/camera/page`, params })
  20. },
  21. // 查询安防前端设备详情
  22. getCamera: async (id: number) => {
  23. return await request.get({ url: `/safe/camera/get?id=` + id })
  24. },
  25. // 新增安防前端设备
  26. createCamera: async (data: CameraVO) => {
  27. return await request.post({ url: `/safe/camera/create`, data })
  28. },
  29. // 修改安防前端设备
  30. updateCamera: async (data: CameraVO) => {
  31. return await request.put({ url: `/safe/camera/update`, data })
  32. },
  33. // 删除安防前端设备
  34. deleteCamera: async (id: number) => {
  35. return await request.delete({ url: `/safe/camera/delete?id=` + id })
  36. },
  37. // 导出安防前端设备 Excel
  38. exportCamera: async (params) => {
  39. return await request.download({ url: `/safe/camera/export-excel`, params })
  40. },
  41. // 根据后端设备id查询前端设备
  42. getCameras: async (id: number) => {
  43. return await request.get({ url: `/safe/camera/cameras?serverId=` + id })
  44. },
  45. }