From f8c90d4b29453ff183c6517a76988e8aaa9f91da Mon Sep 17 00:00:00 2001 From: z_yu <1534695664@qq.com> Date: Tue, 6 Sep 2022 15:00:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=A9=E4=BD=99bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/device/index.js | 9 +++++++++ src/views/dashboard/PanelGroup.vue | 18 ++++++++++++------ .../storeManage/warehouse3DConfig/index.vue | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 src/api/home/device/index.js diff --git a/src/api/home/device/index.js b/src/api/home/device/index.js new file mode 100644 index 0000000..6ced3bf --- /dev/null +++ b/src/api/home/device/index.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getOnlineDevice() { + return request({ + url: 'api/device/num', + method: 'get' + }) +} +export default { getOnlineDevice } diff --git a/src/views/dashboard/PanelGroup.vue b/src/views/dashboard/PanelGroup.vue index ca73155..f1dce3c 100644 --- a/src/views/dashboard/PanelGroup.vue +++ b/src/views/dashboard/PanelGroup.vue @@ -46,7 +46,7 @@
- +
在线设备
@@ -59,7 +59,7 @@
- +
离线设备
@@ -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 }) } } diff --git a/src/views/storeManage/warehouse3DConfig/index.vue b/src/views/storeManage/warehouse3DConfig/index.vue index 9ef032a..4928599 100644 --- a/src/views/storeManage/warehouse3DConfig/index.vue +++ b/src/views/storeManage/warehouse3DConfig/index.vue @@ -395,7 +395,7 @@ export default { .head-container .el-button.unbind-btn{ border-color: #f65163; background-color: #f65163; - .is-disabled{ + &.is-disabled{ border-color: #7a2831; background-color: #7a2831; }