Browse Source

feat:fix bugs

master
zhaobing’ 1 year ago
parent
commit
ffb55e511a
  1. 6
      weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js
  2. 6
      weapp/package/subSystem/subSystem.js

6
weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js

@ -149,12 +149,12 @@ Page({
quipmentIntegrityRate:deviceCount?Math.round((normal/deviceCount)*100):0 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) const xData=Object.keys(sevenDays)
setTimeout(() => { setTimeout(() => {
that.initChart(data1,data2,xData) that.initChart(normaldata,abnormaldata,xData)
}, 1000) }, 1000)
}, },

6
weapp/package/subSystem/subSystem.js

@ -202,15 +202,13 @@ Page({
const data1=Object.entries(levelCounts).map(([name, value]) => ({ name, value })); const data1=Object.entries(levelCounts).map(([name, value]) => ({ name, value }));
const totalValue = data1.reduce((accumulator, item) => accumulator + item.value, 0); const totalValue = data1.reduce((accumulator, item) => accumulator + item.value, 0);
that.setData({ 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, currentPatrolCount: res.length,
questions:totalValue, questions:totalValue,
record:res, record:res,
formatter: function (e) { formatter: function (e) {
let allRecordsAreClean=false
// console.log('filter',filteredData)
const currentDate = moment(e.date).format('YYYY-MM-DD'); 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&&rs.length){
if(rs.some(item=>item.patrolRecordIssueHandles.length>0)){ if(rs.some(item=>item.patrolRecordIssueHandles.length>0)){
e.bottomInfo = '.'; e.bottomInfo = '.';

Loading…
Cancel
Save