index.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import request from '@/config/axios'
  2. // 设备分类 VO
  3. export interface IotProductClassifyVO {
  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 IotProductClassifyApi = {
  13. // 查询设备分类分页
  14. getIotProductClassifyPage: async (params: any) => {
  15. return await request.get({ url: `/rq/iot-product-classify/list`, params })
  16. },
  17. // 查询设备分类详情
  18. getIotProductClassify: async (id: number) => {
  19. return await request.get({ url: `/rq/iot-product-classify/get?id=` + id })
  20. },
  21. // 新增设备分类
  22. createIotProductClassify: async (data: IotProductClassifyVO) => {
  23. return await request.post({ url: `/rq/iot-product-classify/create`, data })
  24. },
  25. // 修改设备分类
  26. updateIotProductClassify: async (data: IotProductClassifyVO) => {
  27. return await request.put({ url: `/rq/iot-product-classify/update`, data })
  28. },
  29. // 删除设备分类
  30. deleteIotProductClassify: async (id: number) => {
  31. return await request.delete({ url: `/rq/iot-product-classify/delete?id=` + id })
  32. },
  33. // 导出设备分类 Excel
  34. exportIotProductClassify: async (params) => {
  35. return await request.download({ url: `/rq/iot-product-classify/export-excel`, params })
  36. },
  37. getSimpleProductClassifyList: async (): Promise<IotProductClassifyVO[]> => {
  38. return await request.get({ url: '/rq/iot-product-classify/simple-list' })
  39. }
  40. }