|
|
@ -516,6 +516,66 @@ module.exports = function (app, opts) { |
|
|
|
`).toPromise() : []
|
|
|
|
} |
|
|
|
|
|
|
|
let dataAlarmTitle2 = [{ |
|
|
|
n: '项目', |
|
|
|
k: '', |
|
|
|
v: pepProjectName |
|
|
|
}, { |
|
|
|
n: '结构物', |
|
|
|
k: '', |
|
|
|
f: (d) => { |
|
|
|
return (strucMap[d.StructureId] || { name: '' }).name |
|
|
|
// return (strucListRes.find(s => s.id == d.StructureId) || { name: '' }).name
|
|
|
|
} |
|
|
|
}, { |
|
|
|
n: '告警源名称', |
|
|
|
k: 'SourceName' |
|
|
|
}, { |
|
|
|
n: '告警源类型', |
|
|
|
k: '', |
|
|
|
f: (d) => { |
|
|
|
switch (d.SourceTypeId) { |
|
|
|
case 0: |
|
|
|
return 'DTU' |
|
|
|
case 1: |
|
|
|
return '传感器' |
|
|
|
case 2: |
|
|
|
return '测点' |
|
|
|
default: |
|
|
|
return '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, { |
|
|
|
n: '告警信息', |
|
|
|
k: 'AlarmContent' |
|
|
|
}, { |
|
|
|
n: '合理值', |
|
|
|
k: '', |
|
|
|
f: (d) => d.AlarmTypeCode == 3018 ? "是" : "否" |
|
|
|
}, { |
|
|
|
n: '告警等级(当前)', |
|
|
|
k: '', |
|
|
|
f: (d) => { |
|
|
|
switch (d.CurrentLevel) { |
|
|
|
case 1: |
|
|
|
return '一级' |
|
|
|
case 2: |
|
|
|
return '二级' |
|
|
|
case 3: |
|
|
|
return '三级' |
|
|
|
default: |
|
|
|
return '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, { |
|
|
|
n: '持续时间', |
|
|
|
k: '', |
|
|
|
f: (d) => { |
|
|
|
return d.StartTime ? |
|
|
|
'超过' + calcMinute2DHM(moment().diff(moment(d.StartTime), 'minutes')) : '' |
|
|
|
} |
|
|
|
},] |
|
|
|
|
|
|
|
let dataAlarmTitle = [{ |
|
|
|
n: '项目', |
|
|
|
k: '', |
|
|
@ -548,6 +608,8 @@ module.exports = function (app, opts) { |
|
|
|
}, { |
|
|
|
n: '告警信息', |
|
|
|
k: 'AlarmContent' |
|
|
|
}, { |
|
|
|
|
|
|
|
}, { |
|
|
|
n: '告警等级(当前)', |
|
|
|
k: '', |
|
|
@ -671,10 +733,6 @@ module.exports = function (app, opts) { |
|
|
|
n: '告警源', |
|
|
|
k: 'SourceName' |
|
|
|
}, |
|
|
|
{ |
|
|
|
n: '合理值', |
|
|
|
k: 'AlarmTypeCode' |
|
|
|
}, |
|
|
|
{ |
|
|
|
n: '中断时间', |
|
|
|
k: '', |
|
|
@ -1106,8 +1164,7 @@ module.exports = function (app, opts) { |
|
|
|
alarms.SourceId AS sourceId, |
|
|
|
alarms.StartTime AS StartTime, |
|
|
|
alarms.SourceName AS SourceName, |
|
|
|
alarms.AlarmCode AS AlarmCode, |
|
|
|
alarms.AlarmTypeCode AS AlarmTypeCode |
|
|
|
alarms.AlarmCode AS AlarmCode |
|
|
|
FROM |
|
|
|
alarms |
|
|
|
WHERE |
|
|
@ -1288,9 +1345,6 @@ module.exports = function (app, opts) { |
|
|
|
case 'SourceName': |
|
|
|
tableData += `<td>${d[t.k] || ''}</td>` |
|
|
|
break; |
|
|
|
case 'AlarmTypeCode': |
|
|
|
tableData += `<td>${d[t.k] == 3018 ? "是" : '否'}</td>` |
|
|
|
break |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
@ -1360,7 +1414,7 @@ module.exports = function (app, opts) { |
|
|
|
html += packageAlarmData2Table({ |
|
|
|
titlePrefix: '数据异常', |
|
|
|
alarmData: dataAlarmG2, |
|
|
|
alarmTitleArr: dataAlarmTitle, |
|
|
|
alarmTitleArr: dataAlarmTitle2, |
|
|
|
}) |
|
|
|
} |
|
|
|
if (c.alarmType.includes('strategy_hit')) { |
|
|
|