Browse Source

feat:fix bugs

master
zhaobing’ 1 year ago
parent
commit
369060f391
  1. 3
      weapp/package/deviceBigdataGraph/lifeWarning/lifeWarning.js
  2. 34
      weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js
  3. 23
      weapp/package/report/report.js

3
weapp/package/deviceBigdataGraph/lifeWarning/lifeWarning.js

@ -11,6 +11,9 @@ const moment = require("../../../utils/moment");
function setOption (chart, seriesData, xData) {
const option = {
tooltip: {
trigger: 'item'
},
grid: {
top: '5%',
left: '3%',

34
weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js

@ -4,6 +4,9 @@ const moment = require("../../../utils/moment");
function setOption(chart, data1, data2,xdata) {
const option = {
tooltip: {
trigger: 'item'
},
legend: {
data:['设备故障率', '设备完好率'],
top: '-5px'
@ -162,9 +165,9 @@ Page({
},
//分类统计设备,异常-正常-未知个数
classifiedStatistics:function(list,len){
let normal = 0;
let normal = len;
let abnormal = 0;
let unknown = len;
let unknown = 0;
list.forEach((item) => {
const inspectContent = item.alarm ? (item?.points?.inspectContent || []) : [];
if (inspectContent && inspectContent.length && Array.isArray(inspectContent)&&inspectContent.some(o=>o.deviceId)) {
@ -175,28 +178,28 @@ Page({
const state = item.patrolRecordIssueHandles[0].state;
if (state === 6) {
// 正常
normal += 1;
unknown-=1
// normal += 1;
// unknown-=1
} else if (state === 5) {
// 未知
// unknown += 1;
unknown += 1;
normal -= 1;
} else {
// 异常
abnormal += 1;
unknown-=1
normal-=1
}
}
} else {
// 正常
normal += 1;
unknown-=1
// normal += 1;
// unknown-=1
}
});
}else{
}
});
console.log('sssss',normal,unknown,abnormal)
return {normal,unknown,abnormal}
},
//统计每天异常-正常-未知个数
@ -210,8 +213,8 @@ Page({
// 初始化每一天的统计为零
dateRange.forEach((date) => {
dailyCounts[date] = {
normal: 0,
unknown: len,
normal: len,
unknown: 0,
abnormal: 0
};
});
@ -221,13 +224,14 @@ Page({
if (dailyCounts[inspectionDate] !== undefined) {
const status = item.patrolRecordIssueHandles.length ? item.patrolRecordIssueHandles[0].state : 6;
if (status === 6) {
dailyCounts[inspectionDate].normal += 1;
dailyCounts[inspectionDate].unknown -= 1;
// dailyCounts[inspectionDate].normal += 1;
// dailyCounts[inspectionDate].unknown -= 1;
} else if (status === 5) {
// dailyCounts[inspectionDate].unknown += 1;
dailyCounts[inspectionDate].unknown += 1;
dailyCounts[inspectionDate].normal -= 1;
} else {
dailyCounts[inspectionDate].abnormal += 1;
dailyCounts[inspectionDate].unknown -= 1;
dailyCounts[inspectionDate].normal -= 1;
}
}
});

23
weapp/package/report/report.js

@ -57,13 +57,16 @@ Page({
pointChange(e){
const that = this
// that.getPatrolPlan(that.data.data[e.detail.value].id)
that.setData({
inspectContentArr:[],
pointIndex:e.detail.value,
devicesList:that.data.data[e.detail.value].devices,
scenePointId:that.data.data[e.detail.value].id,
// patrolTemplate:[]
})
that.setData({
inspectContentArr:[],
pointIndex:e.detail.value,
devicesList:that.data.data[e.detail.value].devices,
scenePointId:that.data.data[e.detail.value].id,
// patrolTemplate:[]
patrolTemplateIndex:null
})
},
// 预览图片
previewImg: function (e) {
@ -80,6 +83,7 @@ Page({
},
//结构物改变函数
structChange(event) {
// console.log('pointIndex',this.data.pointIndex)
const that = this
that.setData({
structListIndex: event.detail.value,
@ -87,8 +91,8 @@ Page({
pointList:[],//选择结构物后先置空先前的点位列表
patrolTemplate:[],
inspectContentArr:[],
patrolTemplateIndex:undefined,
pointIndex:undefined
patrolTemplateIndex:null,
pointIndex:null
})
const projectId=that.data?.structList[event.detail.value]?.id
@ -110,6 +114,7 @@ Page({
name:item.name
}
})
// console.log('patrolTemplateIndex',this.data.patrolTemplateIndex)
that.setData({pointList:pointList,data:res})
}else {
wx.hideLoading();

Loading…
Cancel
Save