空调轮询机制改为5分钟,空调控制增加轮询机制5分钟,修正楼控空调funcCat参数缺失bug

main
zhangqun 3 years ago
parent 79ee4f9eb4
commit 6118144cd3
  1. 49
      src/components/monitoring/conditioner.vue

@ -174,13 +174,13 @@
<div class="flex-center-between" style="padding: 0 1rem">
<div class="open-txt">
{{ testObject1.name }}
<span v-if="testObject1.funcCat == 1">{{
<!-- <span v-if="testObject1.funcCat == 1">{{
testObject1.mode == 0
? "通风"
: testObject1.mode == 1
? "制热"
: "制冷"
}}</span>
}}</span> -->
<span v-if="testObject1.funcCat == 3">{{
testObject1.mode == 0
? "内机制热"
@ -400,6 +400,7 @@ export default {
noramlTotal: 0,//
warnEquip: 0,//
equipWarn: 0,//
intervalStatus: null,//1
};
},
watch: {
@ -410,11 +411,14 @@ export default {
if (this.setInterval) {
clearInterval(this.setInterval);
}
if (this.intervalStatus) {
clearInterval(this.intervalStatus);
}
this.setInterval = setInterval(() => {
this.getConditions(); //
this.getAirWarnList();//
}, 3600000);
}, 5 * 60 * 1000);
this.getConditions(); //
},
@ -537,6 +541,9 @@ export default {
if (this.setInterval) {
clearInterval(this.setInterval);
}
if (this.intervalStatus) {
clearInterval(this.intervalStatus);
}
},
created() {
this.getConditions(); //
@ -544,7 +551,7 @@ export default {
this.setInterval = setInterval(() => {
this.getConditions(); //
this.getAirWarnList();//
}, 3600000);
}, 5 * 60 * 1000);//5
},
mounted() {
let dom = document.getElementById('condi_box');
@ -646,6 +653,9 @@ export default {
this.total = 0; //
this.build = i;
this.floor = j;
if (this.intervalStatus) {
clearInterval(this.intervalStatus);
}
if (this.bimModel == 1) {
commonValue.getUpdateMap("water", i, j);
this.removeEvent();
@ -919,7 +929,8 @@ export default {
this.testObject1.open = 1;
var arr = bfHelper.getAll();
bfHelper.clearTags();
if (arr.length < 2) {getOAContent
if (arr.length < 2) {
getOAContent
bfHelper.customTag(
{
x: this.testObject1.xmove,
@ -1053,6 +1064,9 @@ export default {
code = e.target.id.substring(7);
}
if (code) {
if (this.intervalStatus) {
clearInterval(this.intervalStatus);
}
let funcCatObj = this.allDatas.find(item => { return item.code == code });
if (funcCatObj && funcCatObj.funcCat == 3) {
//lora
@ -1070,6 +1084,7 @@ export default {
this.isControl = true;
this.clickCode = code;
}
this.doIntervalStatus(code, 3);
})
return;
}
@ -1080,6 +1095,7 @@ export default {
//
return;
}
this.testObject1.funcCat = 1;
if (
e.target.id == "condition-" + code ||
e.target.id == "temper-" + code ||
@ -1091,15 +1107,34 @@ export default {
this.isControl = true;
this.clickCode = code;
}
this.doIntervalStatus(code, 1);
}
});
}
},
//1
doIntervalStatus(code, type) {
this.intervalStatus = setInterval(() => {
if (type == 3) {
queryLoraAll(code).then(res => {
this.testObject1 = res.data.data;
this.testObject1.funcCat = 3;
})
} else if (type == 1) {
getConditionData(code).then((res) => {
if (res.data.code == 200) {
this.testObject1 = res.data.data;
this.testObject1.funcCat = 1;
}
});
}
}, 5 * 60 * 1000);
},
removeEvent() {
window.removeEventListener("click", this.addEvent);
},
getContent(testObject) {
// console.log(this.clickCode,testObject.code)
// console.log(this.clickCode,testObject)
let button = require("../../../public/img/monitoring/electricity/off-button.png");
let greenWind = require("../../../public/img/monitoring/electricity/green-wind.png");
let decrease = require("../../../public/img/monitoring/electricity/jian.png");
@ -1124,7 +1159,7 @@ export default {
}">${testObject.temCur}</span><span id="tempac-${testObject.code
}"> </span>
</span>
<span style="font-size:14px;display:${testObject.code == this.clickCode ? "inline-block" : "none"
<span style="font-size:16px;display:${testObject.code == this.clickCode ? "inline-block" : "none"
}" id="temper-${testObject.code}">${testObject.name}</span>
</div>
</div>

Loading…
Cancel
Save