diff --git a/apps/web-antd/src/api-client/services.gen.ts b/apps/web-antd/src/api-client/services.gen.ts index 48a099d..2e6d23f 100644 --- a/apps/web-antd/src/api-client/services.gen.ts +++ b/apps/web-antd/src/api-client/services.gen.ts @@ -434,6 +434,11 @@ import type { PostUsersUpdateData, PostUsersUpdateError, PostUsersUpdateResponse, + IoTDBDataInfoErrorResponse, + IoTDBTreeModelDeviceDataPageDataInput, + IoTDBTreeModelDeviceDataPageAllResponse, + SelectResultListInput, + SelectResultListAllResponse } from './types.gen'; import { @@ -3127,19 +3132,35 @@ export const postTableModelPacketInfoPage = < }; /** - * 获取测点数据分页 + * 获取IoTDB设备树模型数据分页 */ -export const postTableModelDeviceDataInfoPage = < +export const postTreeModelDeviceDataInfoPage = < ThrowOnError extends boolean = false, >( - options?: Options, + options?: Options, ) => { return (options?.client ?? client).post< - PostRolesAllResponse, - PostRolesAllError, + IoTDBTreeModelDeviceDataPageAllResponse, + IoTDBDataInfoErrorResponse, ThrowOnError >({ ...options, - url: '/TableModel/DeviceDataInfoPage', + url: '/TreeModel/DeviceDataInfoPage', + }); +}; + +/** + * 获取后端通用下拉框列表集合 + */ +export const getSelectResultList = ( + options?: Options, +) => { + return (options?.client ?? client).get< + SelectResultListAllResponse, + IoTDBDataInfoErrorResponse, + ThrowOnError + >({ + ...options, + url: '/Common/GetSelectList', }); }; diff --git a/apps/web-antd/src/api-client/types.gen.ts b/apps/web-antd/src/api-client/types.gen.ts index 940fb01..96355cb 100644 --- a/apps/web-antd/src/api-client/types.gen.ts +++ b/apps/web-antd/src/api-client/types.gen.ts @@ -5049,3 +5049,75 @@ export type PostUsersResetTwoFactorError = RemoteServiceErrorResponse; export type PostUsersNeedChangePasswordResponse = NeedChangePasswordOutput; export type PostUsersNeedChangePasswordError = RemoteServiceErrorResponse; + +export type IoTDBDataInfoPageInput = { + /** + * 关键字 + */ + filter?: null | string; + /** + * 当前页面.默认从1开始 + */ + pageIndex?: number; + /** + * 每页多少条.每页显示多少记录 + */ + pageSize?: number; + /** + * 跳过多少条 + */ + readonly skipCount?: number; + /** + * 排序 + * + * name desc + * + */ + sorting?: null | string; +}; + +export type IoTDBDataInfoErrorResponse = { + error?: RemoteServiceErrorInfo; +}; + +export type IoTDBTreeModelDeviceDataPageDataInput = { + body?: IoTDBDataInfoPageInput; +}; + +export type IoTDBTreeModelDeviceDataDto = { + concurrencyStamp?: null | string; + creationTime?: string; + readonly extraProperties?: null | { + [key: string]: unknown; + }; + id?: string; + isDefault?: boolean; + isPublic?: boolean; + isStatic?: boolean; + name?: null | string; +}; + +export type IoTDBTreeModelDeviceDataPageListResultDto = { + items?: Array | null; +}; + +export type IoTDBTreeModelDeviceDataPageAllResponse = IoTDBTreeModelDeviceDataPageListResultDto; + + +export type SelectResultListInput = { + query?: { + TypeName?: null | string; + ThirdAttributeTypeName?: null | string; + }; +}; + +export type SelectResultListDto = { + key?: string | null; + value?: string | null; + secondValue?: string | null; + thirdValue?: string | null; +}; +export type SelectResultListAllResponse = { + items?: Array | null; +}; + diff --git a/apps/web-antd/src/locales/langs/en-US/abp.json b/apps/web-antd/src/locales/langs/en-US/abp.json index 23a1f2d..229e9cc 100644 --- a/apps/web-antd/src/locales/langs/en-US/abp.json +++ b/apps/web-antd/src/locales/langs/en-US/abp.json @@ -223,4 +223,59 @@ "pointData": "pointData", "archivesIssued": "archivesIssued" } + , + "IoTDBBase": { + "SystemName": "SystemName", + "ProjectId": "ProjectId", + "ProjectName": "ProjectName", + "IoTDataType": "IoTDataType", + "DeviceType": "DeviceType", + "DeviceId": "DeviceId", + "Timestamps": "Timestamps", + "DevicePath": "DevicePath" + }, + "CTWingLog": { + "PlatformTenantId": "PlatformTenantId", + "ProductId": "ProductId", + "ServiceId": "ServiceId", + "PlatformDeviceId": "PlatformDeviceId", + "MessageType": "MessageType", + "Protocol": "Protocol", + "FocusAddress": "FocusAddress", + "MeterAddress": "MeterAddress", + "RawMessage": "RawMessage", + "ReceivedPayload": "ReceivedPayload", + "ReceivedTime": "ReceivedTime", + "IMSI": "IMSI", + "IMEI": "IMEI" + }, + "OneNETLog": { + "ProductId": "ProductId", + "PlatformDeviceId": "PlatformDeviceId", + "MessageType": "MessageType", + "Protocol": "Protocol", + "FocusAddress": "FocusAddress", + "MeterAddress": "MeterAddress", + "RawMessage": "RawMessage", + "ReceivedPayload": "ReceivedPayload", + "ReceivedTime": "ReceivedTime" + }, + "SelectResultType": { + "MeterTypeEnum": "MeterTypeEnum", + "IoTPlatformTypeEnum": "IoTPlatformTypeEnum", + "BusinessSystemEnum": "BusinessSystemEnum" + }, + "IoTDBDynamicObjectData": { + "DeviceId": "设备ID", + "DeviceName": "设备名称", + "DeviceType": "设备类型", + "DeviceStatus": "设备状态", + "DeviceLocation": "设备位置", + "DeviceDescription": "设备描述", + "DeviceProperties": "设备属性", + "DeviceTags": "设备标签", + "DeviceCreateTime": "设备创建时间", + "DeviceUpdateTime": "设备更新时间", + "DeviceLastActiveTime": "设备最后活跃时间" + } } diff --git a/apps/web-antd/src/locales/langs/zh-CN/abp.json b/apps/web-antd/src/locales/langs/zh-CN/abp.json index 0eff28e..5298be6 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/abp.json +++ b/apps/web-antd/src/locales/langs/zh-CN/abp.json @@ -222,5 +222,59 @@ "DeviceType": "设备类型", "pointData": "测点数据", "archivesIssued": "档案下发" + }, + "IoTDBBase": { + "SystemName": "所属系统", + "ProjectId": "项目编码", + "ProjectName": "项目名称", + "IoTDataType": "数据类型", + "DeviceType": "设备类型", + "DeviceId": "设备ID", + "Timestamps": "时标", + "DevicePath": "设备路径" + }, + "CTWingLog": { + "PlatformTenantId": "物联网平台租户Id", + "ProductId": "物联网平台产品Id", + "ServiceId": "物联网平台服务Id", + "PlatformDeviceId": "物联网平台设备ID", + "MessageType": "消息类型", + "Protocol": "通信协议", + "FocusAddress": "集中器地址", + "MeterAddress": "表地址", + "RawMessage": "消息上报原始内容", + "ReceivedPayload": "消息上报结果", + "ReceivedTime": "消息上报时间", + "IMSI": "IMSI", + "IMEI": "IMEI" + }, + "OneNETLog": { + "ProductId": "物联网平台产品Id", + "PlatformDeviceId": "物联网平台设备ID", + "MessageType": "消息类型", + "Protocol": "通信协议", + "FocusAddress": "集中器地址", + "MeterAddress": "表地址", + "RawMessage": "消息上报原始内容", + "ReceivedPayload": "消息上报结果", + "ReceivedTime": "消息上报时间" + }, + "SelectResultType": { + "MeterTypeEnum": "表计类型", + "IoTPlatformTypeEnum": "物联网平台", + "BusinessSystemEnum": "系统类型" + }, + "IoTDBDynamicObjectData": { + "DeviceId": "设备ID", + "DeviceName": "设备名称", + "DeviceType": "设备类型", + "DeviceStatus": "设备状态", + "DeviceLocation": "设备位置", + "DeviceDescription": "设备描述", + "DeviceProperties": "设备属性", + "DeviceTags": "设备标签", + "DeviceCreateTime": "设备创建时间", + "DeviceUpdateTime": "设备更新时间", + "DeviceLastActiveTime": "设备最后活跃时间" } } diff --git a/apps/web-antd/src/views/dataManger/ctwingLog/index.vue b/apps/web-antd/src/views/dataManger/ctwingLog/index.vue index 439bb1f..ade5042 100644 --- a/apps/web-antd/src/views/dataManger/ctwingLog/index.vue +++ b/apps/web-antd/src/views/dataManger/ctwingLog/index.vue @@ -12,7 +12,7 @@ import { postTableModelDeviceDataInfoPage } from '#/api-client'; import { querySchema, tableSchema } from './schema'; defineOptions({ - name: 'MeasuringPoint', + name: 'ctwingLog', }); const route = useRoute(); @@ -38,7 +38,7 @@ const gridOptions: VxeGridProps = { proxyConfig: { ajax: { query: async ({ page }, formValues) => { - const { data } = await postTableModelDeviceDataInfoPage({ + const { data } = await postTreeModelDeviceDataInfoPage({ body: { ...formValues, pageIndex: page.currentPage, diff --git a/apps/web-antd/src/views/dataManger/deviceData/index.vue b/apps/web-antd/src/views/dataManger/deviceData/index.vue index 439bb1f..defcd16 100644 --- a/apps/web-antd/src/views/dataManger/deviceData/index.vue +++ b/apps/web-antd/src/views/dataManger/deviceData/index.vue @@ -7,12 +7,12 @@ import { useRoute } from 'vue-router'; import { Page } from '@vben/common-ui'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; -import { postTableModelDeviceDataInfoPage } from '#/api-client'; +import { postTreeModelDeviceDataInfoPage } from '#/api-client'; import { querySchema, tableSchema } from './schema'; defineOptions({ - name: 'MeasuringPoint', + name: 'DeviceData', }); const route = useRoute(); @@ -31,6 +31,7 @@ const gridOptions: VxeGridProps = { pagerConfig: {}, toolbarConfig: { custom: true, + search: true, }, customConfig: { storage: true, @@ -38,7 +39,7 @@ const gridOptions: VxeGridProps = { proxyConfig: { ajax: { query: async ({ page }, formValues) => { - const { data } = await postTableModelDeviceDataInfoPage({ + const { data } = await postTreeModelDeviceDataInfoPage({ body: { ...formValues, pageIndex: page.currentPage, diff --git a/apps/web-antd/src/views/dataManger/deviceData/schema.ts b/apps/web-antd/src/views/dataManger/deviceData/schema.ts index 4ca1afc..2813e72 100644 --- a/apps/web-antd/src/views/dataManger/deviceData/schema.ts +++ b/apps/web-antd/src/views/dataManger/deviceData/schema.ts @@ -1,17 +1,56 @@ import type { VxeGridProps } from '#/adapter/vxe-table'; -import { computed } from 'vue'; +import { computed, ref } from 'vue'; import dayjs from 'dayjs'; import { $t } from '#/locales'; +import { getSelectResultList } from '#/api-client'; + +// 手动加载选项数据 +const systemNameOptions = ref>([]); + +const loadSystemNameOptions = async () => { + try { + const { data } = await getSelectResultList({ + params: { + query: { + TypeName: 'BusinessSystemEnum', + }, + }, + }); + console.log('API Response:', data); + if (data?.items) { + systemNameOptions.value = data.items.map((item: any) => ({ + label: item.secondValue || '', + value: item.value || '', + })); + console.log('Processed Options:', systemNameOptions.value); + } + } catch (error) { + console.error('Failed to load system name options:', error); + } +}; + +// 立即加载数据 +loadSystemNameOptions(); + export const querySchema = computed(() => [ { component: 'Input', fieldName: 'FocusAddress', label: $t('abp.focus.focusAddress'), }, + { + component: 'Select', + fieldName: 'SystemName', + label: $t('abp.IoTDBBase.SystemName'), + componentProps: computed(() => ({ + options: systemNameOptions.value, + allowClear: true, + })), + }, ]); export const tableSchema: any = computed((): VxeGridProps['columns'] => [ { title: $t('common.seq'), type: 'seq', width: 50 },