feat:【IoT 物联网】新增告警记录管理功能,包括告警记录接口和前端展示页面

This commit is contained in:
YunaiV
2025-06-28 16:46:49 +08:00
parent e0099fb748
commit 4f99e3839b
3 changed files with 313 additions and 0 deletions

View File

@@ -37,5 +37,10 @@ export const AlertConfigApi = {
// 删除告警配置
deleteAlertConfig: async (id: number) => {
return await request.delete({ url: `/iot/alert-config/delete?id=` + id })
},
// 获取告警配置简单列表
getSimpleAlertConfigList: async () => {
return await request.get({ url: `/iot/alert-config/simple-list` })
}
}

View File

@@ -0,0 +1,35 @@
import request from '@/config/axios'
/** IoT 告警记录信息 */
export interface AlertRecord {
id: number // 记录编号
configId: number // 告警配置编号
configName: string // 告警名称
configLevel: number // 告警级别
productId: number // 产品编号
deviceId: number // 设备编号
deviceMessage: any // 触发的设备消息
processStatus?: boolean // 是否处理
processRemark: string // 处理结果(备注)
}
// IoT 告警记录 API
export const AlertRecordApi = {
// 查询告警记录分页
getAlertRecordPage: async (params: any) => {
return await request.get({ url: `/iot/alert-record/page`, params })
},
// 查询告警记录详情
getAlertRecord: async (id: number) => {
return await request.get({ url: `/iot/alert-record/get?id=` + id })
},
// 处理告警记录
processAlertRecord: async (id: number, processRemark: string) => {
return await request.put({
url: `/iot/alert-record/process`,
data: { id, processRemark }
})
}
}