diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/index.ts index de0fb6b2..ca15f6fc 100644 --- a/src/api/iot/device/index.ts +++ b/src/api/iot/device/index.ts @@ -51,6 +51,18 @@ export interface LineDevicePageParams { deviceName?: string status?: string | number collectionTime?: string | number + collectionTimeStart?: string + collectionTimeEnd?: string +} + +export interface SingleDeviceParams { + deviceId: string | number +} + +export interface HistoryRecordParams { + deviceId: string | number + collectionStartTime?: string + collectionEndTime?: string } // 物联设备 API @@ -101,6 +113,14 @@ export const DeviceApi = { return await request.get({ url: `/iot/device/lineDevicePage`, params }) }, + getSingleDevice: async (params: SingleDeviceParams) => { + return await request.get({ url: `/iot/device/singleDevice`, params }) + }, + + getHistoryRecord: async (params: HistoryRecordParams) => { + return await request.get({ url: `/iot/device/historyRecord`, params }) + }, + // ==================== 子表(设备属性) ==================== // 获得设备属性分页 diff --git a/src/views/iot/device/components/DeviceAttributeList.vue b/src/views/iot/device/components/DeviceAttributeList.vue index 2b7ce2e3..8c55bc14 100644 --- a/src/views/iot/device/components/DeviceAttributeList.vue +++ b/src/views/iot/device/components/DeviceAttributeList.vue @@ -56,16 +56,20 @@ ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-to - + + label="最新采集时间" + align="center" + prop="latestCollectionTime" + :formatter="dateFormatter" + width="170px" + /> --> - + @@ -81,7 +85,7 @@ - + - + @@ -120,7 +124,8 @@ 编辑 - {{ isRowConnected(scope.row) ? '断开连接' : '连接' }} @@ -131,7 +136,8 @@ - @@ -339,20 +345,9 @@ const handleToggleConnect = async (row: DeviceVO) => { } } -let timer: any = null; /** 初始化 **/ onMounted(() => { getList() - timer = setInterval(async () => { - const data = await DeviceApi.getDevicePage(queryParams) - list.value = data.list - total.value = data.total - }, 5000); -}) -// 组件卸载时销毁图表 -onUnmounted(() => { - if (timer) { - clearInterval(timer); - } }) + diff --git a/src/views/iot/deviceParamAnalysis/index.vue b/src/views/iot/deviceParamAnalysis/index.vue new file mode 100644 index 00000000..731424a0 --- /dev/null +++ b/src/views/iot/deviceParamAnalysis/index.vue @@ -0,0 +1,315 @@ + + + + + diff --git a/src/views/iot/devicemodel/components/ModelAttributeList.vue b/src/views/iot/devicemodel/components/ModelAttributeList.vue index defc8605..83e6a8a2 100644 --- a/src/views/iot/devicemodel/components/ModelAttributeList.vue +++ b/src/views/iot/devicemodel/components/ModelAttributeList.vue @@ -3,11 +3,13 @@ - - @@ -45,7 +47,8 @@ 新增 - 导出 @@ -59,7 +62,8 @@ - @@ -75,7 +79,8 @@ - +