diff --git a/weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js b/weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js index 7ed2014..443473c 100644 --- a/weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js +++ b/weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js @@ -149,12 +149,12 @@ Page({ quipmentIntegrityRate:deviceCount?Math.round((normal/deviceCount)*100):0 }) //正常数据 - const data1=Object.values(sevenDays).map(item=>Number(Math.round((item.normal/complexArray.length)*100))) + const normaldata=Object.values(sevenDays).map(item=>Math.ceil((item.normal/complexArray.length)*100)) //故障数据 - const data2=Object.values(sevenDays).map(item=>Number(Math.round((item.abnormal+item.unknown/complexArray.length)*100))) + const abnormaldata=Object.values(sevenDays).map(item=>Math.ceil(((item.abnormal+item.unknown)/complexArray.length)*100)) const xData=Object.keys(sevenDays) setTimeout(() => { - that.initChart(data1,data2,xData) + that.initChart(normaldata,abnormaldata,xData) }, 1000) }, diff --git a/weapp/package/subSystem/subSystem.js b/weapp/package/subSystem/subSystem.js index a2395e6..218a690 100644 --- a/weapp/package/subSystem/subSystem.js +++ b/weapp/package/subSystem/subSystem.js @@ -202,15 +202,13 @@ Page({ const data1=Object.entries(levelCounts).map(([name, value]) => ({ name, value })); const totalValue = data1.reduce((accumulator, item) => accumulator + item.value, 0); that.setData({ - currentRepairCount: res?.filter(i => i.patrolRecordIssueHandles.length > 0).length || 0, + currentRepairCount: res?.filter(i => i.patrolRecordIssueHandles.length > 0?i.patrolRecordIssueHandles[0].state===6:[]).length || 0, currentPatrolCount: res.length, questions:totalValue, record:res, formatter: function (e) { - 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')) + const rs= res.filter(item=> currentDate===moment(item.inspectionTime).format('YYYY-MM-DD') ) if(rs&&rs.length){ if(rs.some(item=>item.patrolRecordIssueHandles.length>0)){ e.bottomInfo = '.';