|
|
@@ -31,7 +31,7 @@
|
|
|
<div class="data-box" v-for="(item1,index1) in item.data" :key="index1">
|
|
|
<div>{{item1.label}}</div>
|
|
|
<div>
|
|
|
- <count-to :startVal='0' :endVal='item.value' :duration='2000'></count-to>
|
|
|
+ <count-to :startVal='0' :endVal='item1.value' :duration='2000'></count-to>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -42,6 +42,7 @@
|
|
|
|
|
|
<script>
|
|
|
import countTo from 'vue-count-to'
|
|
|
+ import {getMonitoringaidsApi} from '@/api/device/gb/gbdevice'
|
|
|
export default {
|
|
|
components: {
|
|
|
countTo
|
|
|
@@ -106,10 +107,22 @@
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
-
|
|
|
+ this.init()
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ init(){
|
|
|
+ this.getMonitoringaids()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取监控设备数据
|
|
|
+ */
|
|
|
+ async getMonitoringaids(){
|
|
|
+ let data= (await getMonitoringaidsApi()).data.data
|
|
|
+ this.list[0].total=parseInt(data.total)
|
|
|
+ this.list[0].data[0].value=parseInt(data.total)
|
|
|
+ this.list[0].data[1].value=parseInt(data.offlineCount)
|
|
|
+ this.list[0].data[2].value=parseInt(data.waringCount)
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|