Browse Source

feat:fix bugs

master
zhaobing’ 2 years ago
parent
commit
e4210b859e
  1. 40
      weapp/package/subSystem/subSystem.js

40
weapp/package/subSystem/subSystem.js

@ -163,15 +163,17 @@ Page({
const device = content.deviceId; const device = content.deviceId;
content.checkItems.forEach(checkItem => { content.checkItems.forEach(checkItem => {
const level = checkItem.level; const level = checkItem.level;
if (!deviceLevelStatistics[device]) { if(!checkItem.isNormal){
// 如果设备不存在于统计对象中,初始化 if (!deviceLevelStatistics[device]) {
deviceLevelStatistics[device] = { // 如果设备不存在于统计对象中,初始化
deviceName: content.deviceName, // 可能需要设备名称 deviceLevelStatistics[device] = {
level: level deviceName: content.deviceName, // 可能需要设备名称
}; level: level
} else { };
// 如果设备已存在于统计对象中,比较level并更新为最低的level } else {
deviceLevelStatistics[device].level = levelValues[level] < levelValues[deviceLevelStatistics[device].level] ? level : deviceLevelStatistics[device].level; // 如果设备已存在于统计对象中,比较level并更新为最低的level
deviceLevelStatistics[device].level = levelValues[level] < levelValues[deviceLevelStatistics[device].level] ? level : deviceLevelStatistics[device].level;
}
} }
}) })
}) })
@ -193,15 +195,19 @@ Page({
currentPatrolCount: res.length, currentPatrolCount: res.length,
questions:totalValue, questions:totalValue,
formatter: function (e) { formatter: function (e) {
filteredData?.map(i => { let allRecordsAreClean=false
if (moment(i.inspectionTime).format('YYYY-MM-DD') == moment(e.date).format('YYYY-MM-DD')) { // console.log('filter',filteredData)
if (i.patrolRecordIssueHandles.length == 0) { const currentDate = moment(e.date).format('YYYY-MM-DD');
e.bottomInfo = '.'; e.className = 'greenClass' const rs= filteredData.filter(item=>currentDate===moment(item.inspectionTime).format('YYYY-MM-DD'))
} else if (i.patrolRecordIssueHandles.length && i?.patrolRecordIssueHandles[0]?.yanshoushijian && parseInt(moment(i?.patrolRecordIssueHandles[0]?.yanshoushijian).format('YYYYMMDD')) === parseInt(moment().format('YYYYMMDD'))) { if(rs&&rs.length){
e.bottomInfo = '.'; e.className = 'yellowClass' if(rs.some(item=>item.patrolRecordIssueHandles.length>0)){
} e.bottomInfo = '.';
e.className = 'yellowClass';
}else{
e.bottomInfo = '.';
e.className = 'greenClass';
} }
}) }
return e return e
} }
}) })

Loading…
Cancel
Save