|
|
@@ -17,7 +17,6 @@
|
|
|
name: 'usageRateComponent',
|
|
|
data() {
|
|
|
return {
|
|
|
- wendu_zc: require('@/assets/ZDimages/img_cgq_zc@1x.png'),
|
|
|
config: {
|
|
|
rowNum: 7,
|
|
|
headerBGC: 'rgba(0,66,138,0.5)',
|
|
|
@@ -35,7 +34,9 @@
|
|
|
// ['<span class="span_num"><span>8</span></span>','行4列1', '行4列2', '行4列3'],
|
|
|
// ['<span class="span_num"><span>9</span></span>','行4列1', '行4列2', '行4列3'],
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ usageSwitchTime:600000,
|
|
|
+ usageTimer:null,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -43,10 +44,12 @@
|
|
|
},
|
|
|
mounted() {
|
|
|
this.dashboardsFacilitiesUsageStats()
|
|
|
+ this.overviewTimerFunction();
|
|
|
},
|
|
|
methods: {
|
|
|
dashboardsFacilitiesUsageStats() {
|
|
|
let self = this
|
|
|
+ this.$set(this.config,'data',[]);
|
|
|
dashboardsFacilitiesUsageStats().then(res => {
|
|
|
let list = []
|
|
|
for (let i = 0; i < res.data.monthlyUsage.length; i++) {
|
|
|
@@ -95,6 +98,22 @@
|
|
|
return valB - valA // 降序排序
|
|
|
})
|
|
|
},
|
|
|
+ //设施状态概览定时器
|
|
|
+ overviewTimerFunction(){
|
|
|
+ const self = this;
|
|
|
+ self.usageTimer = window.setInterval(usageUpdates, this.usageSwitchTime);
|
|
|
+ async function usageUpdates() {
|
|
|
+ self.dashboardsFacilitiesUsageStats();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ //清除定时器
|
|
|
+ clearInterval(this.usageTimer);
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ //清除定时器
|
|
|
+ clearInterval(this.usageTimer);
|
|
|
}
|
|
|
}
|
|
|
</script>
|