index.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import request from '@/config/axios'
  2. // 设备分类 VO
  3. export interface IotYfClassifyVO {
  4. id: number // 主键id
  5. parentId: number // 父分类id
  6. name: string // 分类名称
  7. code: string // 分类编码
  8. sort: number // 分类排序
  9. status: number // 开启状态
  10. }
  11. // 设备分类 API
  12. export const IotYfClassifyApi = {
  13. // 查询设备分类分页
  14. getChildrenList: async () => {
  15. return await request.get({ url: `/rq/iot-yf-classify/children-list`})
  16. },
  17. // 查询设备分类分页
  18. getIotYfClassifyPage: async (params: any) => {
  19. return await request.get({ url: `/rq/iot-yf-classify/list`, params })
  20. },
  21. // 查询设备分类详情
  22. getIotYfClassify: async (id: number) => {
  23. return await request.get({ url: `/rq/iot-yf-classify/get?id=` + id })
  24. },
  25. // 新增设备分类
  26. createIotYfClassify: async (data: IotYfClassifyVO) => {
  27. return await request.post({ url: `/rq/iot-yf-classify/create`, data })
  28. },
  29. // 修改设备分类
  30. updateIotYfClassify: async (data: IotYfClassifyVO) => {
  31. return await request.put({ url: `/rq/iot-yf-classify/update`, data })
  32. },
  33. // 删除设备分类
  34. deleteIotYfClassify: async (id: number) => {
  35. return await request.delete({ url: `/rq/iot-yf-classify/delete?id=` + id })
  36. },
  37. // 导出设备分类 Excel
  38. exportIotYfClassify: async (params) => {
  39. return await request.download({ url: `/rq/iot-yf-classify/export-excel`, params })
  40. },
  41. getSimpleYfClassifyList: async (): Promise<IotYfClassifyVO[]> => {
  42. return await request.get({ url: '/rq/iot-yf-classify/simple-list' })
  43. }
  44. }