能耗分析定时循环,空开15秒执行5次查询指令发送之后空开状态

dev
xuechunyuan 3 years ago
parent 7c2b24b6b5
commit a5830cddee
  1. 10
      src/components/monitoring/light.vue
  2. 11
      src/views/sourceAnaly/components/buildElectric.vue
  3. 12
      src/views/sourceAnaly/components/buildWarm.vue
  4. 12
      src/views/sourceAnaly/components/conditionAnaly.vue
  5. 11
      src/views/sourceAnaly/components/sourceAnaly.vue
  6. 11
      src/views/sourceAnaly/components/sourceSituation.vue
  7. 256
      src/views/sourceAnaly/totalCenter.vue
  8. 17
      src/views/sourceAnaly/totalLeft.vue
  9. 16
      src/views/sourceAnaly/totalRight.vue

@ -690,6 +690,7 @@ export default {
if (row.openStatus == 2) { if (row.openStatus == 2) {
lightControl(row.code).then((res) => { lightControl(row.code).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success("指令发送成功");
if (res.data.data[0].status == 1) { if (res.data.data[0].status == 1) {
// this.getSblb(); // this.getSblb();
this.checkLight(); this.checkLight();
@ -701,6 +702,7 @@ export default {
} else { } else {
lightControl2(row.code).then((res) => { lightControl2(row.code).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success("指令发送成功");
if (res.data.data[0].status == 1) { if (res.data.data[0].status == 1) {
// this.getSblb(); // this.getSblb();
this.checkLight(); this.checkLight();
@ -723,6 +725,7 @@ export default {
lightControl(codes.toString()).then((res) => { lightControl(codes.toString()).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success("指令发送成功");
for (let i = 0; i < res.data.data.length; i++) { for (let i = 0; i < res.data.data.length; i++) {
if (res.data.data[i].status == 0) { if (res.data.data[i].status == 0) {
setTimeout(() => { setTimeout(() => {
@ -749,6 +752,7 @@ export default {
lightControl2(codes.toString()).then((res) => { lightControl2(codes.toString()).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success("指令发送成功");
for (let i = 0; i < res.data.data.length; i++) { for (let i = 0; i < res.data.data.length; i++) {
if (res.data.data[i].status == 0) { if (res.data.data[i].status == 0) {
setTimeout(() => { setTimeout(() => {
@ -773,6 +777,7 @@ export default {
} }
lightOpenBuild(this.tableData.buildCode).then((res) => { lightOpenBuild(this.tableData.buildCode).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success("指令发送成功");
for (let i = 0; i < res.data.data.length; i++) { for (let i = 0; i < res.data.data.length; i++) {
if (res.data.data[i].status == 0) { if (res.data.data[i].status == 0) {
setTimeout(() => { setTimeout(() => {
@ -794,6 +799,7 @@ export default {
} }
lightCloseBuild(this.tableData.buildCode).then((res) => { lightCloseBuild(this.tableData.buildCode).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success("指令发送成功");
for (let i = 0; i < res.data.data.length; i++) { for (let i = 0; i < res.data.data.length; i++) {
if (res.data.data[i].status == 0) { if (res.data.data[i].status == 0) {
setTimeout(() => { setTimeout(() => {
@ -808,7 +814,7 @@ export default {
}, },
/** /**
* 定时轮询空开状态 * 定时轮询空开状态
* 2秒执行一次执行5次 * 15秒执行一次执行5次
*/ */
checkLight() { checkLight() {
if (this.intervalCheckLight == 0) { if (this.intervalCheckLight == 0) {
@ -821,7 +827,7 @@ export default {
} }
this.getSblb(); this.getSblb();
count--; count--;
}, 2000); }, 1000 * 15);
} }
}, },
}, },

@ -190,10 +190,21 @@ export default {
name: "3层", name: "3层",
}, },
], // - ], // -
intervalTime33: null,
}; };
}, },
beforeDestroy() {
if (this.intervalTime33) {
console.log('clearInterval33')
clearInterval(this.intervalTime33);
this.intervalTime33 = null;
}
},
mounted() { mounted() {
this.getData(); this.getData();
this.intervalTime33 = setInterval(() => {
this.getData();
},30*60*1000)
}, },
methods: { methods: {
// //

@ -148,13 +148,21 @@ export default {
"rgb(242,155,119)", "rgb(242,155,119)",
], ],
warmTotal: "", warmTotal: "",
intervalTime55: null,
}; };
}, },
beforeDestroy() {
if (this.intervalTime55) {
console.log('clearInterval55')
clearInterval(this.intervalTime55);
this.intervalTime55 = null;
}
},
mounted() { mounted() {
this.getData(); this.getData();
setTimeout(() => { this.intervalTime55 = setInterval(() => {
this.getData(); this.getData();
}, 3600000); }, 30*60*1000);
}, },
methods: { methods: {
// //

@ -258,13 +258,21 @@ export default {
"rgb(242,155,119)", "rgb(242,155,119)",
], ],
workTimeData: [], // workTimeData: [], //
intervalTime44: null,
}; };
}, },
beforeDestroy() {
if (this.intervalTime44) {
console.log('clearInterval44')
clearInterval(this.intervalTime44);
this.intervalTime44 = null;
}
},
mounted() { mounted() {
this.getData(); this.getData();
setTimeout(() => { this.intervalTime44 = setInterval(() => {
this.getData(); this.getData();
}, 3600000); }, 30*60*1000);
}, },
methods: { methods: {
preDate() { preDate() {

@ -81,10 +81,21 @@ export default {
key: "", key: "",
choseDate: "3", // choseDate: "3", //
chooseDateValue: dateFormat(new Date(), "yyyy-MM-dd"), // chooseDateValue: dateFormat(new Date(), "yyyy-MM-dd"), //
intervalTime11: null,
}; };
}, },
beforeDestroy() {
if (this.intervalTime11) {
console.log('clearInterval11')
clearInterval(this.intervalTime11);
this.intervalTime11 = null;
}
},
mounted() { mounted() {
this.getData(); this.getData();
this.intervalTime11 = setInterval(() => {
this.getData();
},30*60*1000)
// this.getChart(); // this.getChart();
}, },
methods: { methods: {

@ -262,10 +262,21 @@ export default {
fifth: "", fifth: "",
sixth: "", sixth: "",
}, },
intervalTime22: null,
}; };
}, },
beforeDestroy() {
if (this.intervalTime22) {
console.log('clearInterval22')
clearInterval(this.intervalTime22);
this.intervalTime22 = null;
}
},
mounted() { mounted() {
this.getData(); this.getData();
this.intervalTime22 = setInterval(() => {
this.getData();
},30*60*1000)
}, },
methods: { methods: {
getData() { getData() {

@ -1,36 +1,24 @@
<template> <template>
<div class="total-center"> <div class="total-center">
<!-- 园区能耗总体情况 --> <!-- 园区能耗总体情况 -->
<div <div class="analy-total" :style="{
class="analy-total" height: area == 1 ? '26.937rem' : '24.937rem',
:style="{ backgroundImage:
height: area == 1 ? '26.937rem' : '24.937rem', 'url(' +
backgroundImage: require(area == 1
'url(' + ? '../../../public/img/analysis/total-analy.png'
require(area == 1 : '../../../public/img/analysis/tower-total-analy.png') +
? '../../../public/img/analysis/total-analy.png' ')',
: '../../../public/img/analysis/tower-total-analy.png') + }">
')',
}"
>
<p class="yq-title">{{ area == 1 ? "园区" : "塔台" }}能耗总体情况</p> <p class="yq-title">{{ area == 1 ? "园区" : "塔台" }}能耗总体情况</p>
<div class="change-time"> <div class="change-time">
<div <div @click="selectDate(1)" :style="{ backgroundColor: choseTime == 1 ? 'rgb(8,166,255)' : '' }">
@click="selectDate(1)"
:style="{ backgroundColor: choseTime == 1 ? 'rgb(8,166,255)' : '' }"
>
</div> </div>
<div <div @click="selectDate(2)" :style="{ backgroundColor: choseTime == 2 ? 'rgb(8,166,255)' : '' }">
@click="selectDate(2)"
:style="{ backgroundColor: choseTime == 2 ? 'rgb(8,166,255)' : '' }"
>
</div> </div>
<div <div @click="selectDate(3)" :style="{ backgroundColor: choseTime == 3 ? 'rgb(8,166,255)' : '' }">
@click="selectDate(3)"
:style="{ backgroundColor: choseTime == 3 ? 'rgb(8,166,255)' : '' }"
>
</div> </div>
</div> </div>
@ -39,203 +27,128 @@
<img src="../../../public/img/analysis/total-icon.png" /> <img src="../../../public/img/analysis/total-icon.png" />
<div class="analy-total-detail-all-left"> <div class="analy-total-detail-all-left">
消耗量 消耗量
<span class="big-size" <span class="big-size"><span>{{
><span>{{ (consumeSituation.totalKgce + "").substring(".") > 2
(consumeSituation.totalKgce + "").substring(".") > 2 ? consumeSituation.totalKgce.toFixed(2)
? consumeSituation.totalKgce.toFixed(2) : consumeSituation.totalKgce
: consumeSituation.totalKgce }}</span>kgce</span>
}}</span <span style="margin-left: 1.25rem; margin-right: 0.312rem">同比</span>
>kgce</span <img class="compare" :src="
> srcImg(
<span style="margin-left: 1.25rem; margin-right: 0.312rem" consumeSituation.totalKgce,
>同比</span consumeSituation.preTotalKgce
> )
<img " />
class="compare" <span :style="{
:src=" color: styleColor(
srcImg( consumeSituation.totalKgce,
consumeSituation.totalKgce, consumeSituation.preTotalKgce
consumeSituation.preTotalKgce ),
) }">{{
" consumePercent(
/> consumeSituation.totalKgce,
<span consumeSituation.preTotalKgce
:style="{ )
color: styleColor( }}%</span>
consumeSituation.totalKgce,
consumeSituation.preTotalKgce
),
}"
>{{
consumePercent(
consumeSituation.totalKgce,
consumeSituation.preTotalKgce
)
}}%</span
>
</div> </div>
<!-- <div class="border-line"></div> --> <!-- <div class="border-line"></div> -->
<p class="analy-total-detail-all-center"> <p class="analy-total-detail-all-center">
单位面积总能耗 单位面积总能耗
<span <span><span>{{ consumeSituation.unitAreaTotalKgce }}</span>kgce</span>
><span>{{ consumeSituation.unitAreaTotalKgce }}</span
>kgce</span
>
</p> </p>
<!-- <div class="border-line"></div> --> <!-- <div class="border-line"></div> -->
<p class="analy-total-detail-all-right"> <p class="analy-total-detail-all-right">
人均能耗 人均能耗
<span <span><span>{{ consumeSituation.unitPersonTotalKgce }}</span>kgce</span>
><span>{{ consumeSituation.unitPersonTotalKgce }}</span
>kgce</span
>
</p> </p>
</div> </div>
<div class="analy-total-detail-electric" style="margin-top: 1.875rem"> <div class="analy-total-detail-electric" style="margin-top: 1.875rem">
<img src="../../../public/img/analysis/electric-icon.png" /> <img src="../../../public/img/analysis/electric-icon.png" />
<div class="analy-total-detail-electric-left"> <div class="analy-total-detail-electric-left">
消耗量 消耗量
<span class="big-size" <span class="big-size"><span>{{ consumeSituation.elect }}</span>kw·h</span>
><span>{{ consumeSituation.elect }}</span <span style="margin-left: 1.25rem; margin-right: 0.312rem">同比</span>
>kw·h</span <img class="compare" :src="srcImg(consumeSituation.elect, consumeSituation.preElect)" />
> <span :style="{
<span style="margin-left: 1.25rem; margin-right: 0.312rem" color: styleColor(
>同比</span consumeSituation.elect,
> consumeSituation.preElect
<img ),
class="compare" }">{{
:src="srcImg(consumeSituation.elect, consumeSituation.preElect)" consumePercent(
/> consumeSituation.elect,
<span consumeSituation.preElect
:style="{ )
color: styleColor( }}%</span>
consumeSituation.elect,
consumeSituation.preElect
),
}"
>{{
consumePercent(
consumeSituation.elect,
consumeSituation.preElect
)
}}%</span
>
</div> </div>
<!-- <div class="border-line"></div> --> <!-- <div class="border-line"></div> -->
<p class="analy-total-detail-electric-center"> <p class="analy-total-detail-electric-center">
单位面积耗电量 单位面积耗电量
<span <span><span>{{ consumeSituation.unitAreaElect }}</span>kw·h</span>
><span>{{ consumeSituation.unitAreaElect }}</span
>kw·h</span
>
</p> </p>
<!-- <div class="border-line"></div> --> <!-- <div class="border-line"></div> -->
<p class="analy-total-detail-electric-right"> <p class="analy-total-detail-electric-right">
人均能耗 人均能耗
<span <span><span>{{ consumeSituation.unitPersonElect }}</span>kw·h</span>
><span>{{ consumeSituation.unitPersonElect }}</span
>kw·h</span
>
</p> </p>
</div> </div>
<div <div class="analy-total-detail-water" :style="{ marginTop: area == 1 ? '1.875rem' : '2.812rem' }">
class="analy-total-detail-water"
:style="{ marginTop: area == 1 ? '1.875rem' : '2.812rem' }"
>
<img src="../../../public/img/analysis/water-icon.png" /> <img src="../../../public/img/analysis/water-icon.png" />
<div class="analy-total-detail-water-left"> <div class="analy-total-detail-water-left">
消耗量 消耗量
<span class="big-size" <span class="big-size"><span>{{ consumeSituation.water }}</span></span>
><span>{{ consumeSituation.water }}</span <span style="margin-left: 1.25rem; margin-right: 0.312rem">同比</span>
></span <img class="compare" :src="srcImg(consumeSituation.water, consumeSituation.preWater)" />
> <span :style="{
<span style="margin-left: 1.25rem; margin-right: 0.312rem" color: styleColor(
>同比</span consumeSituation.water,
> consumeSituation.preWater
<img ),
class="compare" }">
:src="srcImg(consumeSituation.water, consumeSituation.preWater)"
/>
<span
:style="{
color: styleColor(
consumeSituation.water,
consumeSituation.preWater
),
}"
>
{{ {{
consumePercent( consumePercent(
consumeSituation.water, consumeSituation.water,
consumeSituation.preWater consumeSituation.preWater
) )
}}%</span }}%</span>
>
</div> </div>
<!-- <div class="border-line"></div> --> <!-- <div class="border-line"></div> -->
<p class="analy-total-detail-water-center"> <p class="analy-total-detail-water-center">
单位面积耗水量 单位面积耗水量
<span <span><span>{{ consumeSituation.unitAreaWater }}</span></span>
><span>{{ consumeSituation.unitAreaWater }}</span
></span
>
</p> </p>
<!-- <div class="border-line"></div> --> <!-- <div class="border-line"></div> -->
<p class="analy-total-detail-water-right"> <p class="analy-total-detail-water-right">
人均能耗 人均能耗
<span <span><span>{{ consumeSituation.unitPersonWater }}</span></span>
><span>{{ consumeSituation.unitPersonWater }}</span
></span
>
</p> </p>
</div> </div>
<div <div class="analy-total-detail-warm" style="margin-top: 1.875rem" v-show="area == 1">
class="analy-total-detail-warm"
style="margin-top: 1.875rem"
v-show="area == 1"
>
<img src="../../../public/img/analysis/warm-icon.png" /> <img src="../../../public/img/analysis/warm-icon.png" />
<div class="analy-total-detail-warm-left"> <div class="analy-total-detail-warm-left">
消耗量 消耗量
<span class="big-size" <span class="big-size"><span>{{ consumeSituation.heat }}</span>MJ</span>
><span>{{ consumeSituation.heat }}</span <span style="margin-left: 1.25rem; margin-right: 0.312rem">同比</span>
>MJ</span <img class="compare" :src="srcImg(consumeSituation.heat, consumeSituation.preHeat)" />
> <span :style="{
<span style="margin-left: 1.25rem; margin-right: 0.312rem" color: styleColor(
>同比</span consumeSituation.heat,
> consumeSituation.preHeat
<img ),
class="compare" }">
:src="srcImg(consumeSituation.heat, consumeSituation.preHeat)"
/>
<span
:style="{
color: styleColor(
consumeSituation.heat,
consumeSituation.preHeat
),
}"
>
{{ {{
consumePercent(consumeSituation.heat, consumeSituation.preHeat) consumePercent(consumeSituation.heat, consumeSituation.preHeat)
}}%</span }}%</span>
>
</div> </div>
<!-- <div class="border-line"></div> --> <!-- <div class="border-line"></div> -->
<p class="analy-total-detail-warm-center"> <p class="analy-total-detail-warm-center">
单位面积耗热量 单位面积耗热量
<span <span><span>{{ consumeSituation.unitAreaHeat }}</span>MJ</span>
><span>{{ consumeSituation.unitAreaHeat }}</span
>MJ</span
>
</p> </p>
<!-- <div class="border-line"></div> --> <!-- <div class="border-line"></div> -->
<p class="analy-total-detail-warm-right"> <p class="analy-total-detail-warm-right">
人均能耗 人均能耗
<span <span><span>{{ consumeSituation.unitPersonHeat }}</span>MJ</span>
><span>{{ consumeSituation.unitPersonHeat }}</span
>MJ</span
>
</p> </p>
</div> </div>
</div> </div>
@ -282,6 +195,7 @@ export default {
}, },
unitData: [], unitData: [],
peopleData: [], peopleData: [],
intervalTime2: null,
}; };
}, },
computed: { computed: {
@ -317,8 +231,18 @@ export default {
}; };
}, },
}, },
beforeDestroy() {
if (this.intervalTime2) {
console.log('clearInterval2')
clearInterval(this.intervalTime2);
this.intervalTime2 = null;
}
},
mounted() { mounted() {
this.getData(); this.getData();
this.intervalTime2 = setInterval(() => {
this.getData();
}, 30 * 60 * 1000)
}, },
methods: { methods: {
getData() { getData() {

@ -73,14 +73,25 @@
floorFive: '', floorFive: '',
floorSix: '', floorSix: '',
}, },
intervalTime: null,
}
},
beforeDestroy() {
if(this.intervalTime){
console.log('clearInterval')
clearInterval(this.intervalTime);
this.intervalTime = null;
} }
}, },
mounted() { mounted() {
this.getPercentPie(); this.getPercentPie();
this.getPercentBar(); this.getPercentBar();
this.getData() this.getData();
this.intervalTime = setInterval(() => {
this.getPercentPie();
this.getPercentBar();
this.getData();
},30*60*1000)
}, },
methods: { methods: {
selectDate(i) { selectDate(i) {

@ -22,7 +22,7 @@
<script> <script>
import lineCharts from './components/lineCharts' import lineCharts from './components/lineCharts'
import { getMonth } from '@/util/commonValue' // import { getMonth } from '@/util/commonValue'
import { dateFormat } from "@/util/date"; import { dateFormat } from "@/util/date";
import { getYearLine, getBuildElect } from '@/api/source/total' import { getYearLine, getBuildElect } from '@/api/source/total'
export default { export default {
@ -42,15 +42,23 @@ export default {
buildValue: [ buildValue: [
[20, 30, 40, 87, 74, 47, 59, 200, 200, 128, 128, 198], [20, 30, 40, 87, 74, 47, 59, 200, 200, 128, 128, 198],
[37, 48, 85, 38, 58, 98, 100, 163, 198, 183, 123, 87], [37, 48, 85, 38, 58, 98, 100, 163, 198, 183, 123, 87],
] ],
intervalTime3: null,
}
},
beforeDestroy() {
if (this.intervalTime3) {
console.log('clearInterval3')
clearInterval(this.intervalTime3);
this.intervalTime3 = null;
} }
}, },
mounted() { mounted() {
this.getCharts(); this.getCharts();
setTimeout(() => { this.intervalTime3 = setInterval(() => {
this.getCharts(); this.getCharts();
}, 3600000) }, 30*60*1000)
}, },
methods: { methods: {

Loading…
Cancel
Save