From c5de2882fff315d3e8986db5dbb6775a0cda8e69 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Wed, 5 Nov 2025 00:42:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=8A=9F=E8=83=BD=E5=BC=80?= =?UTF-8?q?=E5=8F=91=EF=BC=8C=E8=AE=BE=E5=A4=87=E5=AE=9E=E6=97=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9F=A5=E7=9C=8B=E7=AD=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/fishery/monitorHistory/index.ts | 16 + src/api/fishery/monitorHistory/types.ts | 136 ++ src/types/components.d.ts | 4 +- src/views/index.vue | 1681 ++++++++++++++++++++--- 4 files changed, 1647 insertions(+), 190 deletions(-) create mode 100644 src/api/fishery/monitorHistory/index.ts create mode 100644 src/api/fishery/monitorHistory/types.ts diff --git a/src/api/fishery/monitorHistory/index.ts b/src/api/fishery/monitorHistory/index.ts new file mode 100644 index 0000000..0a3f949 --- /dev/null +++ b/src/api/fishery/monitorHistory/index.ts @@ -0,0 +1,16 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { DeviceSensorDataQueryBo, DeviceSensorData } from '@/api/fishery/monitorHistory/types'; + +/** + * 查询设备历史数据 + * @param query + * @returns {*} + */ +export const getHistoryData = (query: DeviceSensorDataQueryBo): AxiosPromise => { + return request({ + url: '/td/device/getHistoryData', + method: 'get', + params: query + }); +}; diff --git a/src/api/fishery/monitorHistory/types.ts b/src/api/fishery/monitorHistory/types.ts new file mode 100644 index 0000000..de391a1 --- /dev/null +++ b/src/api/fishery/monitorHistory/types.ts @@ -0,0 +1,136 @@ +/** + * 设备传感器数据查询对象 + */ +export interface DeviceSensorDataQueryBo extends BaseEntity { + /** + * 设备序列号 + */ + serialNum?: string; + + /** + * 设备ID + */ + deviceId?: string | number; + + /** + * 手机号 + */ + mobilePhone?: string; + + /** + * 设备类型 + */ + deviceType?: number; + + /** + * 开始时间 + */ + startTime?: string; + + /** + * 结束时间 + */ + endTime?: string; + + /** + * 时间间隔 + */ + intervalType?: string; +} + +/** + * 设备传感器数据对象 + */ +export interface DeviceSensorData { + // 测量字段(随时间变化的数值) + /** + * 时序主键时间戳 + */ + time: string; + + /** + * 数据创建时间 + */ + createTime: string; + + /** + * 溶解氧 + */ + dissolvedOxygen: number; + + /** + * 温度 + */ + temperature: number; + + /** + * 饱和度 + */ + saturability: number; + + /** + * pH值 + */ + ph: number; + + /** + * 盐度 + */ + salinity: number; + + /** + * 参考值 + */ + treference: number; + + /** + * 荧光值 + */ + tfluorescence: number; + + /** + * 相位差 + */ + phaseDifference: number; + + /** + * 电池电量 + */ + battery: number; + + // 标签字段(元数据,不随时间频繁变化) + /** + * 设备序列号 + */ + serialNum: string; + + /** + * 设备ID + */ + deviceId: number; + + /** + * 用户ID + */ + userId: number; + + /** + * 用户名 + */ + userName: string; + + /** + * 手机号 + */ + mobilePhone: string; + + /** + * 设备名称 + */ + deviceName: string; + + /** + * 设备类型 + */ + deviceType: number; +} diff --git a/src/types/components.d.ts b/src/types/components.d.ts index abfacc7..ba0d740 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -17,9 +17,9 @@ declare module 'vue' { ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] + ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCard: typeof import('element-plus/es')['ElCard'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] - ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCol: typeof import('element-plus/es')['ElCol'] ElColorPicker: typeof import('element-plus/es')['ElColorPicker'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] @@ -38,13 +38,13 @@ declare module 'vue' { ElIcon: typeof import('element-plus/es')['ElIcon'] ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] - ElLink: typeof import('element-plus/es')['ElLink'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] diff --git a/src/views/index.vue b/src/views/index.vue index 1aba486..d57ed1c 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,217 +1,1522 @@