index.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import request from '@/config/axios'
  2. // IoT 设备分组 VO
  3. export interface DeviceGroupVO {
  4. id: number // 分组 ID
  5. name: string // 分组名字
  6. status: number // 分组状态
  7. description: string // 分组描述
  8. deviceCount?: number // 设备数量
  9. }
  10. // IoT 设备分组 API
  11. export const DeviceGroupApi = {
  12. // 查询设备分组分页
  13. getDeviceGroupPage: async (params: any) => {
  14. return await request.get({ url: `/iot/device-group/page`, params })
  15. },
  16. // 查询设备分组详情
  17. getDeviceGroup: async (id: number) => {
  18. return await request.get({ url: `/iot/device-group/get?id=` + id })
  19. },
  20. // 新增设备分组
  21. createDeviceGroup: async (data: DeviceGroupVO) => {
  22. return await request.post({ url: `/iot/device-group/create`, data })
  23. },
  24. // 修改设备分组
  25. updateDeviceGroup: async (data: DeviceGroupVO) => {
  26. return await request.put({ url: `/iot/device-group/update`, data })
  27. },
  28. // 删除设备分组
  29. deleteDeviceGroup: async (id: number) => {
  30. return await request.delete({ url: `/iot/device-group/delete?id=` + id })
  31. },
  32. // 获取设备分组的精简信息列表
  33. getSimpleDeviceGroupList: async () => {
  34. return await request.get({ url: `/iot/device-group/simple-list` })
  35. }
  36. }