|
|
@ -44,6 +44,7 @@ Page({ |
|
|
|
// level3Count: 0, //严重
|
|
|
|
// dataList:[],//饼图数据
|
|
|
|
selectedDate: new Date(), // 设置默认选中的日期为当前日期
|
|
|
|
questions:0,//故障数量
|
|
|
|
formatter(day) { |
|
|
|
|
|
|
|
return day; |
|
|
@ -117,20 +118,7 @@ Page({ |
|
|
|
wx.hideLoading() |
|
|
|
|
|
|
|
}, |
|
|
|
//过滤轻微,中度,重度的巡检个数
|
|
|
|
filterLevelCount: function (list, level) { |
|
|
|
return list?.filter(i => { |
|
|
|
const content = i?.points?.inspectContent |
|
|
|
if (content && content.length) { |
|
|
|
for (let key in content) { |
|
|
|
if (content.hasOwnProperty(key)) { |
|
|
|
const subObject = content[key]; |
|
|
|
return subObject.level === level |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
})?.length |
|
|
|
}, |
|
|
|
|
|
|
|
getSubSystemPatrolAbout: function (options) { |
|
|
|
// const userInfo=wx.getStorageSync('userInfo');
|
|
|
|
let that = this; |
|
|
@ -199,9 +187,11 @@ 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, |
|
|
|
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')) { |
|
|
|