设备数据查询

This commit is contained in:
ChenYi 2025-07-09 17:07:25 +08:00
parent 54924d973e
commit dffb5a9fad
7 changed files with 254 additions and 12 deletions

View File

@ -434,6 +434,11 @@ import type {
PostUsersUpdateData, PostUsersUpdateData,
PostUsersUpdateError, PostUsersUpdateError,
PostUsersUpdateResponse, PostUsersUpdateResponse,
IoTDBDataInfoErrorResponse,
IoTDBTreeModelDeviceDataPageDataInput,
IoTDBTreeModelDeviceDataPageAllResponse,
SelectResultListInput,
SelectResultListAllResponse
} from './types.gen'; } from './types.gen';
import { import {
@ -3127,19 +3132,35 @@ export const postTableModelPacketInfoPage = <
}; };
/** /**
* * IoTDB设备树模型数据分
*/ */
export const postTableModelDeviceDataInfoPage = < export const postTreeModelDeviceDataInfoPage = <
ThrowOnError extends boolean = false, ThrowOnError extends boolean = false,
>( >(
options?: Options<PostUsersPageData, ThrowOnError>, options?: Options<IoTDBTreeModelDeviceDataPageDataInput, ThrowOnError>,
) => { ) => {
return (options?.client ?? client).post< return (options?.client ?? client).post<
PostRolesAllResponse, IoTDBTreeModelDeviceDataPageAllResponse,
PostRolesAllError, IoTDBDataInfoErrorResponse,
ThrowOnError ThrowOnError
>({ >({
...options, ...options,
url: '/TableModel/DeviceDataInfoPage', url: '/TreeModel/DeviceDataInfoPage',
});
};
/**
*
*/
export const getSelectResultList = <ThrowOnError extends boolean = false>(
options?: Options<SelectResultListInput, ThrowOnError>,
) => {
return (options?.client ?? client).get<
SelectResultListAllResponse,
IoTDBDataInfoErrorResponse,
ThrowOnError
>({
...options,
url: '/Common/GetSelectList',
}); });
}; };

View File

@ -5049,3 +5049,75 @@ export type PostUsersResetTwoFactorError = RemoteServiceErrorResponse;
export type PostUsersNeedChangePasswordResponse = NeedChangePasswordOutput; export type PostUsersNeedChangePasswordResponse = NeedChangePasswordOutput;
export type PostUsersNeedChangePasswordError = RemoteServiceErrorResponse; export type PostUsersNeedChangePasswordError = RemoteServiceErrorResponse;
export type IoTDBDataInfoPageInput = {
/**
*
*/
filter?: null | string;
/**
* .1
*/
pageIndex?: number;
/**
* .
*/
pageSize?: number;
/**
*
*/
readonly skipCount?: number;
/**
*
* <example>
* name desc
* </example>
*/
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<IoTDBTreeModelDeviceDataDto> | 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<SelectResultListDto> | null;
};

View File

@ -223,4 +223,59 @@
"pointData": "pointData", "pointData": "pointData",
"archivesIssued": "archivesIssued" "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": "设备最后活跃时间"
}
} }

View File

@ -222,5 +222,59 @@
"DeviceType": "设备类型", "DeviceType": "设备类型",
"pointData": "测点数据", "pointData": "测点数据",
"archivesIssued": "档案下发" "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": "设备最后活跃时间"
} }
} }

View File

@ -12,7 +12,7 @@ import { postTableModelDeviceDataInfoPage } from '#/api-client';
import { querySchema, tableSchema } from './schema'; import { querySchema, tableSchema } from './schema';
defineOptions({ defineOptions({
name: 'MeasuringPoint', name: 'ctwingLog',
}); });
const route = useRoute(); const route = useRoute();
@ -38,7 +38,7 @@ const gridOptions: VxeGridProps<any> = {
proxyConfig: { proxyConfig: {
ajax: { ajax: {
query: async ({ page }, formValues) => { query: async ({ page }, formValues) => {
const { data } = await postTableModelDeviceDataInfoPage({ const { data } = await postTreeModelDeviceDataInfoPage({
body: { body: {
...formValues, ...formValues,
pageIndex: page.currentPage, pageIndex: page.currentPage,

View File

@ -7,12 +7,12 @@ import { useRoute } from 'vue-router';
import { Page } from '@vben/common-ui'; import { Page } from '@vben/common-ui';
import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { postTableModelDeviceDataInfoPage } from '#/api-client'; import { postTreeModelDeviceDataInfoPage } from '#/api-client';
import { querySchema, tableSchema } from './schema'; import { querySchema, tableSchema } from './schema';
defineOptions({ defineOptions({
name: 'MeasuringPoint', name: 'DeviceData',
}); });
const route = useRoute(); const route = useRoute();
@ -31,6 +31,7 @@ const gridOptions: VxeGridProps<any> = {
pagerConfig: {}, pagerConfig: {},
toolbarConfig: { toolbarConfig: {
custom: true, custom: true,
search: true,
}, },
customConfig: { customConfig: {
storage: true, storage: true,
@ -38,7 +39,7 @@ const gridOptions: VxeGridProps<any> = {
proxyConfig: { proxyConfig: {
ajax: { ajax: {
query: async ({ page }, formValues) => { query: async ({ page }, formValues) => {
const { data } = await postTableModelDeviceDataInfoPage({ const { data } = await postTreeModelDeviceDataInfoPage({
body: { body: {
...formValues, ...formValues,
pageIndex: page.currentPage, pageIndex: page.currentPage,

View File

@ -1,17 +1,56 @@
import type { VxeGridProps } from '#/adapter/vxe-table'; import type { VxeGridProps } from '#/adapter/vxe-table';
import { computed } from 'vue'; import { computed, ref } from 'vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { $t } from '#/locales'; import { $t } from '#/locales';
import { getSelectResultList } from '#/api-client';
// 手动加载选项数据
const systemNameOptions = ref<Array<{ label: string; value: string }>>([]);
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(() => [ export const querySchema = computed(() => [
{ {
component: 'Input', component: 'Input',
fieldName: 'FocusAddress', fieldName: 'FocusAddress',
label: $t('abp.focus.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'] => [ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
{ title: $t('common.seq'), type: 'seq', width: 50 }, { title: $t('common.seq'), type: 'seq', width: 50 },