|
|
@ -46,7 +46,7 @@ |
|
|
|
</div> |
|
|
|
<div class="card-panel-description"> |
|
|
|
<div class="card-panel-text"> |
|
|
|
<count-to :start-val="0" :end-val="17" :duration="3200" class="card-panel-num" /> |
|
|
|
<count-to :start-val="0" :end-val="onlineDeviceNum" :duration="3200" class="card-panel-num" /> |
|
|
|
</div> |
|
|
|
在线设备 |
|
|
|
</div> |
|
|
@ -59,7 +59,7 @@ |
|
|
|
</div> |
|
|
|
<div class="card-panel-description"> |
|
|
|
<div class="card-panel-text"> |
|
|
|
<count-to :start-val="0" :end-val="0" :duration="3200" class="card-panel-num" /> |
|
|
|
<count-to :start-val="0" :end-val="offlineDeviceNum" :duration="3200" class="card-panel-num" /> |
|
|
|
</div> |
|
|
|
离线设备 |
|
|
|
</div> |
|
|
@ -72,6 +72,8 @@ |
|
|
|
import CountTo from 'vue-count-to' |
|
|
|
import { FetchGetArchivesNum, FetchGetCaseNum } from '@/api/archivesManage/statistics' |
|
|
|
import { getDeviceList } from '@/api/storeManage/deviceManage/device' |
|
|
|
import { getOnlineDevice } from '@/api/home/device' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
CountTo |
|
|
@ -80,7 +82,9 @@ export default { |
|
|
|
return { |
|
|
|
archivesNum: 0, |
|
|
|
caseNum: 0, |
|
|
|
totalDeviceNum: 0 |
|
|
|
totalDeviceNum: 0, |
|
|
|
onlineDeviceNum: 0, |
|
|
|
offlineDeviceNum: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
@ -104,10 +108,12 @@ export default { |
|
|
|
this.caseNum = data |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 设备总数 |
|
|
|
// 设备总数,在线设备数,离线设备数 |
|
|
|
handleTotalDeviceNum() { |
|
|
|
getDeviceList({ page: 0, size: 10 }).then(data => { |
|
|
|
this.totalDeviceNum = data.totalElements |
|
|
|
Promise.all([getDeviceList({ page: 0, size: 10 }), getOnlineDevice()]).then((result) => { |
|
|
|
this.totalDeviceNum = result[0].totalElements |
|
|
|
this.onlineDeviceNum = result[1] |
|
|
|
this.offlineDeviceNum = this.totalDeviceNum - this.onlineDeviceNum |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|