diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index 4af615e..6d8e84e 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -1194,7 +1194,7 @@ module.exports = function (app, opts) { } h.rowspan = rowspan1 }) - console.log('数据组合',pepProject_name); + console.log('数据组合', JSON.stringify(pepProject_name)); dataAlarmG1 = pepProject_name } @@ -1246,32 +1246,24 @@ module.exports = function (app, opts) { if (type == 1) { alarmData.map((h, hi) => { - let rowspan1 = 0 + if (h.projects && h.projects.length) { h.projects.map((x, xi) => { - let rowspan2 = 0 - let showOne1 = xi == 0 ? true : false + + let showOne1 = (xi == 0) ? true : false if (x.factor && x.factor.length) { x.factor.map((f, fi) => { - let rowspan3 = 0 - let showOne2 = fi == 0 ? true : false + + let showOne2 = (fi == 0) ? true : false if (f.devices && f.devices.length) { f.devices.map((c, ci) => { - let showOne3 = ci == 0 ? true : false + let showOne3 = (ci == 0) ? true : false if (c.alarmDatas && c.alarmDatas.length) { c.alarmDatas.map(a => { - rowspan1 += 1 - rowspan2 += 1 - rowspan3 += 1 - // dataAlarmG1.push({ - // name: h.name, - // Structure: x.name, - // factor: f.name, - // SourceName: a.SourceName, - // StartTime: a.StartTime - // }) + + let tableData = '' for (let t of alarmTitleArr) { @@ -1351,7 +1343,7 @@ module.exports = function (app, opts) { alarmHtml += `` + tableTitlePrefix + '' alarmHtml += alarmHtmlTitle alarmHtml += alarmContent - console.log('表格结果',alarmContent); + console.log('表格结果', alarmContent); alarmHtml += '
' return alarmHtml