diff --git a/src/api/iot/alert/config/index.ts b/src/api/iot/alert/config/index.ts index 9d382a8b..e3ddc2a5 100644 --- a/src/api/iot/alert/config/index.ts +++ b/src/api/iot/alert/config/index.ts @@ -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` }) } } diff --git a/src/api/iot/alert/record/index.ts b/src/api/iot/alert/record/index.ts index e69de29b..b124a9c3 100644 --- a/src/api/iot/alert/record/index.ts +++ b/src/api/iot/alert/record/index.ts @@ -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 } + }) + } +} diff --git a/src/views/iot/alert/record/index.vue b/src/views/iot/alert/record/index.vue index e69de29b..c8dcb85e 100644 --- a/src/views/iot/alert/record/index.vue +++ b/src/views/iot/alert/record/index.vue @@ -0,0 +1,273 @@ + + +