Browse Source

告警按时间范围查

dev
巴林闲侠 2 years ago
parent
commit
ee4e5d53e0
  1. 10
      api/app/lib/controllers/alarm/data.js
  2. 2
      web/Dockerfile

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

@ -53,8 +53,8 @@ async function list (ctx) {
whereOption.push(`alarms.AlarmGroupUnit=${groupUnitId}`)
}
if (sustainTimeStart && sustainTimeEnd) {
let momentStart = moment(sustainTimeStart).format()
let momentEnd = moment(sustainTimeEnd).format()
let momentStart = moment(sustainTimeStart).format('YYYY-MM-DD HH:mm:ss')
let momentEnd = moment(sustainTimeEnd).format('YYYY-MM-DD HH:mm:ss')
whereOption.push(`
(
alarms."StartTime"
@ -91,8 +91,7 @@ async function list (ctx) {
alarms.StructureId AS StructureId,
${anxinyun}.t_structure.name AS StructureName,
${anxinyun}.t_alarm_code.name AS AlarmCodeName,
AlarmContent,
${anxinyun}.t_alarm_type.old_name AS alarmTypeOldName
AlarmContent
FROM
alarms
LEFT JOIN ${anxinyun}.t_structure
@ -107,6 +106,9 @@ async function list (ctx) {
${limit && page ? 'OFFSET ' + parseInt(limit) * parseInt(page) : ''}
`).toPromise();
// ,
// ${anxinyun}.t_alarm_type.old_name AS alarmTypeOldName
// State = 3 是 自动恢复 / 4 是 人工恢复 / 其他数字 是 需要恢复
// state = 2 是 等级提升 / 1 是持续产生 / 0 是首次产生

2
web/Dockerfile

@ -24,7 +24,7 @@
# CMD ["node", "server.js"]
# 版本构建方式
# 版本构建方式
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2

Loading…
Cancel
Save