index.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import request from '@/config/axios'
  2. /** IoT 告警配置信息 */
  3. export interface AlertConfig {
  4. id: number // 配置编号
  5. name?: string // 配置名称
  6. description: string // 配置描述
  7. level?: number // 告警级别
  8. status?: number // 配置状态
  9. sceneRuleIds: string // 关联的场景联动规则编号数组
  10. receiveUserIds: string // 接收的用户编号数组
  11. receiveTypes: string // 接收的类型数组
  12. }
  13. // IoT 告警配置 API
  14. export const AlertConfigApi = {
  15. // 查询告警配置分页
  16. getAlertConfigPage: async (params: any) => {
  17. return await request.get({ url: `/iot/alert-config/page`, params })
  18. },
  19. // 查询告警配置详情
  20. getAlertConfig: async (id: number) => {
  21. return await request.get({ url: `/iot/alert-config/get?id=` + id })
  22. },
  23. // 新增告警配置
  24. createAlertConfig: async (data: AlertConfig) => {
  25. return await request.post({ url: `/iot/alert-config/create`, data })
  26. },
  27. // 修改告警配置
  28. updateAlertConfig: async (data: AlertConfig) => {
  29. return await request.put({ url: `/iot/alert-config/update`, data })
  30. },
  31. // 删除告警配置
  32. deleteAlertConfig: async (id: number) => {
  33. return await request.delete({ url: `/iot/alert-config/delete?id=` + id })
  34. },
  35. // 获取告警配置简单列表
  36. getSimpleAlertConfigList: async () => {
  37. return await request.get({ url: `/iot/alert-config/simple-list` })
  38. }
  39. }