diff --git a/.env.development b/.env.development index 0490fbf..5642af4 100644 --- a/.env.development +++ b/.env.development @@ -5,8 +5,8 @@ VITE_APP_TITLE = 云平台管理系统 VITE_APP_ENV = 'development' # 开发环境 - VITE_APP_BASE_API = 'http://47.120.79.150/backend' -#VITE_APP_BASE_API = 'http://192.168.2.23:8000' +# VITE_APP_BASE_API = 'http://47.120.79.150/backend' +VITE_APP_BASE_API = 'http://192.168.2.23:8000' # VITE_APP_BASE_API = 'http://localhost:8000' diff --git a/src/api/home/index.ts b/src/api/home/index.ts new file mode 100644 index 0000000..bdf8456 --- /dev/null +++ b/src/api/home/index.ts @@ -0,0 +1,24 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +// 获取 数据总览 DataOverview +export const getDataOverview = (params) => { + return request({ + url: '/api/device/homepage/getDataOverview', + method: 'get', + params: params + }); +}; +// 设备分类 +export const getEquipmentClassification = (params) => { + return request({ + url: '/api/device/homepage/getEquipmentClassification', + method: 'get', + params: params + }); +}; + + +export default { + getDataOverview, + getEquipmentClassification +} \ No newline at end of file diff --git a/src/api/home/types.ts b/src/api/home/types.ts new file mode 100644 index 0000000..1ae8f5d --- /dev/null +++ b/src/api/home/types.ts @@ -0,0 +1,6 @@ +export interface DataOverviewType { + devicesNumber: number | string; + equipmentOnline: number | string; + bindingNew: number | string; + equipmentAbnormal: number | string; +} \ No newline at end of file diff --git a/src/views/controlCenter/6170/index.vue b/src/views/controlCenter/6170/index.vue index 13f7a78..add244f 100644 --- a/src/views/controlCenter/6170/index.vue +++ b/src/views/controlCenter/6170/index.vue @@ -229,7 +229,7 @@ const laserMode = ref({ active: false }); -const deviceDetail = ref({ +const deviceDetail = ref({ // 重点:personnelInfo 初始化为空对象,避免 undefined personnelInfo: { unitName: '', @@ -246,7 +246,9 @@ const deviceDetail = ref({ longitude: '', latitude: '', address: '', - sendMsg: '' + sendMsg: '', + chargeState: '0', + typeName: '' }); // 保留原有的操作中标志位 const isUpdatingStatus = ref(false); @@ -429,7 +431,7 @@ const saveBtn = () => { // 强制报警 const forceAlarm = async () => { try { - await proxy?.$modal.confirm('确定要对该设备开启强制报警?', ''); + await proxy?.$modal.confirm('确定要对该设备开启强制报警?', '提示'); forceAlarmLoading.value = true // 2. 准备请求数据 const batchId = generateShortId(); @@ -586,7 +588,7 @@ const handleDeviceMessage = (msg: any) => { deviceDetail.value.batteryPercentage = deviceState[3]; //电量 deviceDetail.value.batteryRemainingTime = deviceState[5]; //续航时间 // getList(); // 重新获取设备详情 - if (deviceDetail.value.batteryPercentage < 20 && deviceDetail.value.chargeState == 0) { + if (deviceDetail.value.batteryPercentage < 20 && Number(deviceDetail.value.chargeState) == 0) { centerDialogVisible.value=true } break; diff --git a/src/views/equipmentManagement/deviceType/index.vue b/src/views/equipmentManagement/deviceType/index.vue index eb8e5ad..98c0bab 100644 --- a/src/views/equipmentManagement/deviceType/index.vue +++ b/src/views/equipmentManagement/deviceType/index.vue @@ -64,6 +64,7 @@ @@ -105,7 +106,7 @@ - + @@ -141,6 +142,7 @@ + diff --git a/src/views/equipmentManagement/devices/index.vue b/src/views/equipmentManagement/devices/index.vue index 15df1b7..67daf8b 100644 --- a/src/views/equipmentManagement/devices/index.vue +++ b/src/views/equipmentManagement/devices/index.vue @@ -44,19 +44,23 @@