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

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

@ -69,12 +69,12 @@
<img class="icon" src="../../../public/img/monitoring/electricity/lx.png" v-if="item.warnStatus == '2'" />
<img class="icon" src="../../../public/img/monitoring/electricity/bj.png" v-else />
<span class="message" v-text="item.name" :style="{
color:item.warnStatus == 2 ? 'white' : item.warnStatus == 1 ? '#ff0000' : 'white',
color: item.warnStatus == 2 ? 'white' : item.warnStatus == 1 ? '#ff0000' : 'white',
}" :title="item.name"></span>
</div>
<span></span>
<span class="data" :style="{
color:item.warnStatus == 2 ? 'white' : item.warnStatus == 1 ? '#ff0000' : 'white',
color: item.warnStatus == 2 ? 'white' : item.warnStatus == 1 ? '#ff0000' : 'white',
}" :title="item.warnContent">{{ item.warnContent }}</span>
<span class=""></span>
<span class="time"
@ -105,7 +105,7 @@
<span class="btn" @click="searchDevice" style="cursor: pointer;">查询</span>
</div> -->
<div class="tabBox">
<el-table :data="tableData" style="width: 100%; max-height: 220px" @row-contextmenu="tableContext">
<el-table :data="tableData" style="width: 100%; max-height: 220px" @row-contextmenu="tableContext">
<el-table-column label="设备名称" min-width="100px" style="cursor: pointer">
<template slot-scope="scope">
<div class="flex-center-center" @click="clickConditions(scope.row)" style="cursor: pointer">
@ -123,9 +123,9 @@
<template slot-scope="scope">
<span @click="clickConditions(scope.row)" style="cursor: pointer"
:style="{ color: scope.row.open == 1 ? 'white' : '#9d9d9d' }">{{ scope.row.temCur ? scope.row.temCur :
"--"
"--"
}}/{{
scope.row.temSetting ? scope.row.temSetting : "--"
scope.row.temSetting ? scope.row.temSetting : "--"
}}</span>
</template>
</el-table-column>
@ -134,10 +134,10 @@
<template slot-scope="scope">
<span @click="clickConditions(scope.row)" style="cursor: pointer"
:style="{ color: scope.row.open == 1 ? 'white' : '#9d9d9d' }">{{
Number(scope.row.build) +
"号楼" +
Number(scope.row.floored) +
"层"
Number(scope.row.build) +
"号楼" +
Number(scope.row.floored) +
"层"
}}</span>
</template>
</el-table-column>
@ -174,25 +174,25 @@
<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>
? "通风"
: testObject1.mode == 1
? "制热"
: "制冷"
}}</span> -->
<span v-if="testObject1.funcCat == 3">{{
testObject1.mode == 0
? "内机制热"
: testObject1.mode == 1
? "内机地暖同时制热"
: testObject1.mode == 2
? "地暖制热"
: testObject1.mode == 3
? "制冷"
: testObject1.mode == 9
? "通风"
: ""
? "内机制热"
: testObject1.mode == 1
? "内机地暖同时制热"
: testObject1.mode == 2
? "地暖制热"
: testObject1.mode == 3
? "制冷"
: testObject1.mode == 9
? "通风"
: ""
}}</span>
</div>
<div>
@ -225,21 +225,21 @@
当前风速
<span v-if="testObject1.funcCat == 1">{{
testObject1.speed == 0
? "低速"
: testObject1.speed == 1
? "中速"
: testObject1.speed == 2
? "高速"
: "自动"
? "低速"
: testObject1.speed == 1
? "中速"
: testObject1.speed == 2
? "高速"
: "自动"
}}</span>
<span v-if="testObject1.funcCat == 3">{{
testObject1.speed == 1
? "低速"
: testObject1.speed == 2
? "中速"
: testObject1.speed == 3
? "高速"
: "自动"
? "低速"
: testObject1.speed == 2
? "中速"
: testObject1.speed == 3
? "高速"
: "自动"
}}</span>
</div>
</div>
@ -267,21 +267,21 @@
当前风速
<span v-if="testObject1.funcCat == 1">{{
testObject1.speed == 0
? "低速"
: testObject1.speed == 1
? "中速"
: testObject1.speed == 2
? "高速"
: "自动"
? "低速"
: testObject1.speed == 1
? "中速"
: testObject1.speed == 2
? "高速"
: "自动"
}}</span>
<span v-if="testObject1.funcCat == 3">{{
testObject1.speed == 1
? "低速"
: testObject1.speed == 2
? "中速"
: testObject1.speed == 3
? "高速"
: "自动"
? "低速"
: testObject1.speed == 2
? "中速"
: testObject1.speed == 3
? "高速"
: "自动"
}}</span>
</div>
</div>
@ -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(); //
},
@ -485,7 +489,7 @@ export default {
}, 300);
bfHelper.setOpacityFun();
} else {
console.log(build,floor,"=======================")
console.log(build, floor, "=======================")
if (floor.indexOf("undefined") == -1) {
setTimeout(() => {
this.setTowerKT("0" + build, "0" + floor);
@ -537,6 +541,9 @@ export default {
if (this.setInterval) {
clearInterval(this.setInterval);
}
if (this.intervalStatus) {
clearInterval(this.intervalStatus);
}
},
created() {
this.getConditions(); //
@ -544,11 +551,11 @@ export default {
this.setInterval = setInterval(() => {
this.getConditions(); //
this.getAirWarnList();//
}, 3600000);
}, 5 * 60 * 1000);//5
},
mounted() {
let dom = document.getElementById('condi_box');
dom.addEventListener('contextmenu', (event)=> {
dom.addEventListener('contextmenu', (event) => {
event.preventDefault(); //
const routerUrl = this.$router.resolve({ path: '/equipment/index', query: { classCode: '0900' } });
window.open(routerUrl.href, "_blank");
@ -557,13 +564,13 @@ export default {
},
methods: {
tableContext(row,column, event){
event.preventDefault(); //
const routerUrl = this.$router.resolve({ path: '/equipment/index', query: {code: row.code } });
window.open(routerUrl.href, "_blank");
// this.dialogVisible = true
// console.log(row)
},
tableContext(row, column, event) {
event.preventDefault(); //
const routerUrl = this.$router.resolve({ path: '/equipment/index', query: { code: row.code } });
window.open(routerUrl.href, "_blank");
// this.dialogVisible = true
// console.log(row)
},
// -
doCancelWarn(item) {
getCancelWarn(item.id).then((res) => {
@ -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,16 +1084,18 @@ export default {
this.isControl = true;
this.clickCode = code;
}
this.doIntervalStatus(code, 3);
})
return;
}
getConditionData(code).then((res) => {
if (res.data.code == 200) {
this.testObject1 = res.data.data;
if(this.testObject1.getConditionData == 2){
if (this.testObject1.getConditionData == 2) {
//
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