index.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import request from '@/config/axios'
  2. // 故障上报 VO
  3. export interface IotFailureReportVO {
  4. id: number // 主键id
  5. failureCode: string // 故障编码
  6. failureName: string // 故障名称
  7. deviceId: number // 设备id
  8. status: string // 状态
  9. ifStop: boolean // 是否停机
  10. failureTime: Date // 故障时间
  11. failureInfluence: string // 故障影响
  12. failureSystem: string // 故障系统
  13. description: string // 故障描述
  14. pic: string // 图片
  15. ifDeal: boolean // 是否解决
  16. needHelp: boolean // 是否需要协助
  17. solution: string // 解决办法
  18. remark: string // 备注
  19. }
  20. // 故障上报 API
  21. export const IotFailureReportApi = {
  22. // 提交审核
  23. submitForApproval: async (id: number) => {
  24. return await request.put({ url: `/rq/iot-failure-report/submitForApproval?id=${id}`})
  25. },
  26. // 查询故障上报分页
  27. getIotFailureReportPage: async (params: any) => {
  28. return await request.get({ url: `/rq/iot-failure-report/page`, params })
  29. },
  30. // 查询故障上报详情
  31. getIotFailureReport: async (id: number) => {
  32. return await request.get({ url: `/rq/iot-failure-report/get?id=` + id })
  33. },
  34. // 新增故障上报
  35. createIotFailureReport: async (data: IotFailureReportVO) => {
  36. return await request.post({ url: `/rq/iot-failure-report/create`, data })
  37. },
  38. // 修改故障上报
  39. updateIotFailureReport: async (data: IotFailureReportVO) => {
  40. return await request.put({ url: `/rq/iot-failure-report/update`, data })
  41. },
  42. // 删除故障上报
  43. deleteIotFailureReport: async (id: number) => {
  44. return await request.delete({ url: `/rq/iot-failure-report/delete?id=` + id })
  45. },
  46. // 导出故障上报 Excel
  47. exportIotFailureReport: async (params) => {
  48. return await request.download({ url: `/rq/iot-failure-report/export-excel`, params })
  49. },
  50. }