From 70b91cfc2b5cd2b47fa987031104929992636c48 Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 10 May 2023 20:57:02 +0800 Subject: [PATCH] =?UTF-8?q?problem=20=E5=91=8A=E8=AD=A6=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/schedule/alarms_push.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index cfb4a9e..1612846 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -1167,13 +1167,14 @@ module.exports = function (app, opts) { if (x.factor.length) { x.factor.forEach(f => { let rowspan3 = 0 + let problem = 0 if (f.devices.length) { f.devicesLength = f.devices.length f.devices = f.devices.filter(b => b.alarmDatas && b.alarmDatas.length > 0) if (f.devices.length) { f.devices.forEach(c => { if (c.alarmDatas.length) { - rowspan3 += 1 + problem += 1 let grouped = c.alarmDatas.reduce((acc, cur) => { if (!acc[cur.AlarmCode]) { acc[cur.AlarmCode] = [] @@ -1185,6 +1186,7 @@ module.exports = function (app, opts) { for (let key in grouped) { rowspan1 += 1 rowspan2 += 1 + rowspan3 += 1 grouped[key].sort((a, b) => new Date(b.StartTime) - new Date(a.StartTime)) alarmData.push(grouped[key][0]) } @@ -1273,7 +1275,7 @@ module.exports = function (app, opts) { break; case 'factor': if (showOne3 && showOne4) { - tableData += `${(f['name'] + '(' + f.rowspan + '/' + f.devicesLength + ')') || ''}` + tableData += `${(f['name'] + '(' + f.problem + '/' + f.devicesLength + ')') || ''}` } break; case 'SourceName':