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

Loading…
Cancel
Save