|
|
@ -148,7 +148,6 @@ Page({ |
|
|
|
maxInspectionTimeByPointId[pointId] = inspectionTime; |
|
|
|
} |
|
|
|
}); |
|
|
|
console.log('maxInspectionTimeByPointId',maxInspectionTimeByPointId) |
|
|
|
// 过滤数据以获取相同pointId中inspectionTime最大的记录
|
|
|
|
const filteredData = res.filter((item) => { |
|
|
|
const {pointId,inspectionTime} = item; |
|
|
@ -158,7 +157,7 @@ Page({ |
|
|
|
const devices=that.data.deviceList.map(item=>{return {id:item.id,name:item.name,status:'unknown'}}) |
|
|
|
filteredData.forEach((item) => { |
|
|
|
const inspectContent =item.alarm?(item?.points?.inspectContent || []):[]; |
|
|
|
if (inspectContent && inspectContent.length&&Array.isArray(inspectContent)) { |
|
|
|
if (inspectContent && inspectContent.length&&Array.isArray(inspectContent)&&inspectContent.some(o=>o.deviceId)) { |
|
|
|
inspectContent.forEach((p) => { |
|
|
|
// 如果设备有报警
|
|
|
|
if (p.alarm) { |
|
|
@ -180,6 +179,8 @@ Page({ |
|
|
|
normal += 1; |
|
|
|
} |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
unknown += 1; |
|
|
|
} |
|
|
|
}); |
|
|
|
//更新devices
|
|
|
|