Browse Source

带出已确认告警信息

dev
巴林闲侠 2 years ago
parent
commit
55be401a3f
  1. 11
      api/app/lib/controllers/alarm/data.js

11
api/app/lib/controllers/alarm/data.js

@ -130,7 +130,7 @@ async function list (ctx) {
const confirmedAlarmDetailMax = confirmedAlarm.length ? const confirmedAlarmDetailMax = confirmedAlarm.length ?
await clickHouse.dataAlarm.query(` await clickHouse.dataAlarm.query(`
SELECT SELECT
max(Time) AS Time,AlarmId max(Time) AS Time, AlarmId , max(Content) AS Content
FROM FROM
alarm_details alarm_details
WHERE WHERE
@ -166,11 +166,12 @@ async function list (ctx) {
// 最新告警详情 - 确认信息 // 最新告警详情 - 确认信息
let corConfirmedData = (confirmedAlarmDetailMax.find(cdm => cdm.AlarmId == ar.AlarmId) || {}); let corConfirmedData = (confirmedAlarmDetailMax.find(cdm => cdm.AlarmId == ar.AlarmId) || {});
if (corConfirmedData.AlarmState && corConfirmedData.AlarmState > 2) {
} else { // if (corConfirmedData.AlarmState && corConfirmedData.AlarmState > 2) {
corConfirmedData = {}
} // } else {
// corConfirmedData = {}
// }
ar.confirmedContent = corConfirmedData.Content ar.confirmedContent = corConfirmedData.Content
ar.confirmedTime = corConfirmedData.Time ar.confirmedTime = corConfirmedData.Time

Loading…
Cancel
Save