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

Loading…
Cancel
Save