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;
}