fix device and alert
parent
da225628c0
commit
2fedf94894
@ -0,0 +1,76 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 告警配置 VO
|
||||
export interface AlertVO {
|
||||
id: number // ID
|
||||
alertCode: string // 编码
|
||||
alertName: string // 名称
|
||||
alertType: string // 告警类型
|
||||
alertLevel: string // 告警等级
|
||||
content: string // 告警内容
|
||||
condition: string // 告警条件
|
||||
conditionFormula: string // 逻辑表达式
|
||||
alertAudio: string // 告警音频
|
||||
isRepeat: boolean // 重复告警
|
||||
noRepeatDuration: number // 不重复间隔
|
||||
isEnable: boolean // 是否启用
|
||||
}
|
||||
|
||||
// 告警配置 API
|
||||
export const AlertApi = {
|
||||
// 查询告警配置分页
|
||||
getAlertPage: async (params: any) => {
|
||||
return await request.get({ url: `/iot/alert/page`, params })
|
||||
},
|
||||
|
||||
// 查询告警配置详情
|
||||
getAlert: async (id: number) => {
|
||||
return await request.get({ url: `/iot/alert/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增告警配置
|
||||
createAlert: async (data: AlertVO) => {
|
||||
return await request.post({ url: `/iot/alert/create`, data })
|
||||
},
|
||||
|
||||
// 修改告警配置
|
||||
updateAlert: async (data: AlertVO) => {
|
||||
return await request.put({ url: `/iot/alert/update`, data })
|
||||
},
|
||||
|
||||
// 删除告警配置
|
||||
deleteAlert: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/alert/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出告警配置 Excel
|
||||
exportAlert: async (params) => {
|
||||
return await request.download({ url: `/iot/alert/export-excel`, params })
|
||||
},
|
||||
|
||||
// ==================== 子表(告警记录) ====================
|
||||
|
||||
// 获得告警记录分页
|
||||
getAlertRecordPage: async (params) => {
|
||||
return await request.get({ url: `/iot/alert/alert-record/page`, params })
|
||||
},
|
||||
// 新增告警记录
|
||||
createAlertRecord: async (data) => {
|
||||
return await request.post({ url: `/iot/alert/alert-record/create`, data })
|
||||
},
|
||||
|
||||
// 修改告警记录
|
||||
updateAlertRecord: async (data) => {
|
||||
return await request.put({ url: `/iot/alert/alert-record/update`, data })
|
||||
},
|
||||
|
||||
// 删除告警记录
|
||||
deleteAlertRecord: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/alert/alert-record/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 获得告警记录
|
||||
getAlertRecord: async (id: number) => {
|
||||
return await request.get({ url: `/iot/alert/alert-record/get?id=` + id })
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 告警记录 VO
|
||||
export interface AlertRecordVO {
|
||||
id: number // ID
|
||||
alertCode: string // 编码
|
||||
alertName: string // 名称
|
||||
alertType: string // 告警类型
|
||||
alertLevel: string // 告警等级
|
||||
content: string // 告警内容
|
||||
condition: string // 告警条件
|
||||
conditionFormula: string // 逻辑表达式
|
||||
dataValue: string // 数据值
|
||||
dataType: string // 数据类型
|
||||
dataUnit: string // 单位
|
||||
dataTypeRemark: string // 描述
|
||||
alertId: number // 告警ID
|
||||
alertAudio: string // 告警音频
|
||||
isRepeat: boolean // 重复告警
|
||||
noRepeatDuration: number // 不重复间隔
|
||||
dataId: number // 来源ID
|
||||
dataCode: string // 来源编码
|
||||
dataName: string // 来源名称
|
||||
}
|
||||
|
||||
// 告警记录 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 })
|
||||
},
|
||||
|
||||
// 新增告警记录
|
||||
createAlertRecord: async (data: AlertRecordVO) => {
|
||||
return await request.post({ url: `/iot/alert-record/create`, data })
|
||||
},
|
||||
|
||||
// 修改告警记录
|
||||
updateAlertRecord: async (data: AlertRecordVO) => {
|
||||
return await request.put({ url: `/iot/alert-record/update`, data })
|
||||
},
|
||||
|
||||
// 删除告警记录
|
||||
deleteAlertRecord: async (id: number) => {
|
||||
return await request.delete({ url: `/iot/alert-record/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出告警记录 Excel
|
||||
exportAlertRecord: async (params) => {
|
||||
return await request.download({ url: `/iot/alert-record/export-excel`, params })
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue