Browse Source

feat:fix bugs

master
zhaobing’ 1 year ago
parent
commit
436ec9663f
  1. 5
      weapp/package/deviceBigdataGraph/deviceBigdataGraph.js
  2. 4
      weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js
  3. 8
      weapp/package/report/report.js

5
weapp/package/deviceBigdataGraph/deviceBigdataGraph.js

@ -148,7 +148,6 @@ Page({
maxInspectionTimeByPointId[pointId] = inspectionTime; maxInspectionTimeByPointId[pointId] = inspectionTime;
} }
}); });
console.log('maxInspectionTimeByPointId',maxInspectionTimeByPointId)
// 过滤数据以获取相同pointId中inspectionTime最大的记录 // 过滤数据以获取相同pointId中inspectionTime最大的记录
const filteredData = res.filter((item) => { const filteredData = res.filter((item) => {
const {pointId,inspectionTime} = item; const {pointId,inspectionTime} = item;
@ -158,7 +157,7 @@ Page({
const devices=that.data.deviceList.map(item=>{return {id:item.id,name:item.name,status:'unknown'}}) const devices=that.data.deviceList.map(item=>{return {id:item.id,name:item.name,status:'unknown'}})
filteredData.forEach((item) => { filteredData.forEach((item) => {
const inspectContent =item.alarm?(item?.points?.inspectContent || []):[]; const inspectContent =item.alarm?(item?.points?.inspectContent || []):[];
if (inspectContent && inspectContent.length&&Array.isArray(inspectContent)) { if (inspectContent && inspectContent.length&&Array.isArray(inspectContent)&&inspectContent.some(o=>o.deviceId)) {
inspectContent.forEach((p) => { inspectContent.forEach((p) => {
// 如果设备有报警 // 如果设备有报警
if (p.alarm) { if (p.alarm) {
@ -180,6 +179,8 @@ Page({
normal += 1; normal += 1;
} }
}); });
}else{
unknown += 1;
} }
}); });
//更新devices //更新devices

4
weapp/package/deviceBigdataGraph/statusDetail/statusDetail.js

@ -167,7 +167,7 @@ Page({
let unknown = len; let unknown = len;
list.forEach((item) => { list.forEach((item) => {
const inspectContent = item.alarm ? (item?.points?.inspectContent || []) : []; const inspectContent = item.alarm ? (item?.points?.inspectContent || []) : [];
if (inspectContent && inspectContent.length && Array.isArray(inspectContent)) { if (inspectContent && inspectContent.length && Array.isArray(inspectContent)&&inspectContent.some(o=>o.deviceId)) {
inspectContent.forEach((p) => { inspectContent.forEach((p) => {
// 如果设备有报警 // 如果设备有报警
if (p.alarm) { if (p.alarm) {
@ -192,6 +192,8 @@ Page({
unknown-=1 unknown-=1
} }
}); });
}else{
} }
}); });
console.log('sssss',normal,unknown,abnormal) console.log('sssss',normal,unknown,abnormal)

8
weapp/package/report/report.js

@ -61,7 +61,8 @@ Page({
inspectContentArr:[], inspectContentArr:[],
pointIndex:e.detail.value, pointIndex:e.detail.value,
devicesList:that.data.data[e.detail.value].devices, devicesList:that.data.data[e.detail.value].devices,
scenePointId:that.data.data[e.detail.value].id scenePointId:that.data.data[e.detail.value].id,
// patrolTemplate:[]
}) })
}, },
// 预览图片 // 预览图片
@ -406,12 +407,13 @@ Page({
//巡检模板改变 //巡检模板改变
patrolTemplateChange(e){ patrolTemplateChange(e){
const that=this const that=this
if(e.detail.value!=0){
that.getPatrolTemplate(that.data.patrolTemplate[e.detail.value].id,that.data.devicesList) that.getPatrolTemplate(that.data.patrolTemplate[e.detail.value].id,that.data.devicesList)
}
that.setData({ that.setData({
patrolTemplateIndex:e.detail.value patrolTemplateIndex:e.detail.value
}) })
}, },
bindShowMsg() { bindShowMsg() {
this.setData({ this.setData({

Loading…
Cancel
Save