diff --git a/src/api/iot/device/device/index.ts b/src/api/iot/device/device/index.ts index ab6a09a3..1804628c 100644 --- a/src/api/iot/device/device/index.ts +++ b/src/api/iot/device/device/index.ts @@ -5,6 +5,7 @@ export interface DeviceVO { id: number // 设备 ID,主键,自增 deviceName: string // 设备名称 productId: number // 产品编号 + productName?: string // 产品名称(只有部分接口返回,例如 getDeviceLocationList) productKey: string // 产品标识 deviceType: number // 设备类型 nickname: string // 设备备注名称 @@ -114,6 +115,11 @@ export const DeviceApi = { return await request.get({ url: `/iot/device/simple-list?`, params: { deviceType, productId } }) }, + // 获取设备位置列表(用于地图展示) + getDeviceLocationList: async () => { + return await request.get({ url: `/iot/device/location-list` }) + }, + // 根据产品编号,获取设备的精简信息列表 getDeviceListByProductId: async (productId: number) => { return await request.get({ url: `/iot/device/simple-list?`, params: { productId } }) diff --git a/src/api/iot/statistics/index.ts b/src/api/iot/statistics/index.ts index cdcb94d2..30360785 100644 --- a/src/api/iot/statistics/index.ts +++ b/src/api/iot/statistics/index.ts @@ -16,18 +16,6 @@ export interface IotStatisticsSummaryRespVO { productCategoryDeviceCounts: Record } -/** 时间戳-数值的键值对类型 */ -interface TimeValueItem { - [key: string]: number -} - -/** IoT 消息统计数据类型 */ -export interface IotStatisticsDeviceMessageSummaryRespVO { - statType: number - upstreamCounts: TimeValueItem[] - downstreamCounts: TimeValueItem[] -} - /** 新的消息统计数据项 */ export interface IotStatisticsDeviceMessageSummaryByDateRespVO { time: string @@ -41,6 +29,17 @@ export interface IotStatisticsDeviceMessageReqVO { times?: string[] } +/** 设备位置数据 VO */ +export interface DeviceLocationRespVO { + id: number + deviceName: string + nickname?: string + productName?: string + state: number + longitude: number + latitude: number +} + // IoT 数据统计 API export const StatisticsApi = { // 查询全局的数据统计 diff --git a/src/components/Map/index.ts b/src/components/Map/index.ts index 27b9675b..3ac8c7bc 100644 --- a/src/components/Map/index.ts +++ b/src/components/Map/index.ts @@ -1,3 +1,4 @@ import MapDialog from './src/MapDialog.vue' +export { loadBaiduMapSdk } from './src/utils' export { MapDialog } diff --git a/src/components/Map/src/MapDialog.vue b/src/components/Map/src/MapDialog.vue index 0f93c4d5..9b6ecdce 100644 --- a/src/components/Map/src/MapDialog.vue +++ b/src/components/Map/src/MapDialog.vue @@ -57,14 +57,7 @@ diff --git a/src/views/iot/home/index.vue b/src/views/iot/home/index.vue index 3d60acef..6ff2d3b7 100644 --- a/src/views/iot/home/index.vue +++ b/src/views/iot/home/index.vue @@ -54,13 +54,18 @@ - + - + + + + + +