设备数据查询
This commit is contained in:
parent
54924d973e
commit
dffb5a9fad
@ -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<PostUsersPageData, ThrowOnError>,
|
||||
options?: Options<IoTDBTreeModelDeviceDataPageDataInput, ThrowOnError>,
|
||||
) => {
|
||||
return (options?.client ?? client).post<
|
||||
PostRolesAllResponse,
|
||||
PostRolesAllError,
|
||||
IoTDBTreeModelDeviceDataPageAllResponse,
|
||||
IoTDBDataInfoErrorResponse,
|
||||
ThrowOnError
|
||||
>({
|
||||
...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',
|
||||
});
|
||||
};
|
||||
|
||||
@ -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;
|
||||
/**
|
||||
* 排序
|
||||
* <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;
|
||||
};
|
||||
|
||||
|
||||
@ -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": "设备最后活跃时间"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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": "设备最后活跃时间"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<any> = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const { data } = await postTableModelDeviceDataInfoPage({
|
||||
const { data } = await postTreeModelDeviceDataInfoPage({
|
||||
body: {
|
||||
...formValues,
|
||||
pageIndex: page.currentPage,
|
||||
|
||||
@ -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<any> = {
|
||||
pagerConfig: {},
|
||||
toolbarConfig: {
|
||||
custom: true,
|
||||
search: true,
|
||||
},
|
||||
customConfig: {
|
||||
storage: true,
|
||||
@ -38,7 +39,7 @@ const gridOptions: VxeGridProps<any> = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
const { data } = await postTableModelDeviceDataInfoPage({
|
||||
const { data } = await postTreeModelDeviceDataInfoPage({
|
||||
body: {
|
||||
...formValues,
|
||||
pageIndex: page.currentPage,
|
||||
|
||||
@ -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<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(() => [
|
||||
{
|
||||
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 },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user