|
|
@ -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 += `<th rowspan=${f.rowspan}>${(f['name'] + '(' + f.rowspan + '/' + f.devicesLength + ')') || ''}</th>` |
|
|
|
tableData += `<th rowspan=${f.rowspan}>${(f['name'] + '(' + f.problem + '/' + f.devicesLength + ')') || ''}</th>` |
|
|
|
} |
|
|
|
break; |
|
|
|
case 'SourceName': |
|
|
|