优化设备数据查询和登出逻辑

This commit is contained in:
ChenYi 2025-08-04 14:21:42 +08:00
parent ed095728a4
commit 934043edde
6 changed files with 334 additions and 534 deletions

View File

@ -430,26 +430,6 @@ export const ApplicationSettingConfigurationDtoSchema = {
additionalProperties: false
} as const;
export const ArchivalDataIssuedInputSchema = {
type: 'object',
properties: {
meterType: {
'$ref': '#/components/schemas/DeviceTypeEnum'
},
meterAddress: {
type: 'string',
description: '表计地址',
nullable: true
},
focusAddress: {
type: 'string',
description: '集中器地址',
nullable: true
}
},
additionalProperties: false
} as const;
export const AuthTypeEnumSchema = {
enum: [1, 2, 3, 4, 6, 7, 8, 9],
type: 'integer',
@ -457,6 +437,33 @@ export const AuthTypeEnumSchema = {
'说明:': '特征串认证=1,SM9认证=2,证书认证=3,IMEI认证=4,SM2认证=6,IPV6标识认证=7,HTTP基本认证=8,HTTP摘要认证=9'
} as const;
export const BatchCreateDeviceAggregationInputSchema = {
required: ['addressList', 'ioTPlatform', 'ioTPlatformProductId'],
type: 'object',
properties: {
addressList: {
type: 'array',
items: {
type: 'string'
},
description: '表通信地址集合'
},
ioTPlatform: {
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
},
ioTPlatformProductId: {
minLength: 1,
type: 'string',
description: '集中器在物联网平台中对应的产品Id'
},
deviceSourceTypeEnum: {
'$ref': '#/components/schemas/DeviceSourceTypeEnum'
}
},
additionalProperties: false,
description: '批量创建设备信息'
} as const;
export const CTWingAccountInfoDtoSchema = {
type: 'object',
properties: {
@ -650,6 +657,42 @@ export const CTWingAccountInsertInputSchema = {
export const CTWingAccountListInputSchema = {
type: 'object',
properties: {
pageIndex: {
type: 'integer',
description: '当前页面.默认从1开始',
format: 'int32'
},
pageSize: {
type: 'integer',
description: '每页多少条.每页显示多少记录',
format: 'int32'
},
skipCount: {
type: 'integer',
description: '跳过多少条',
format: 'int32',
readOnly: true
},
sorting: {
type: 'string',
description: `排序
<example>
name desc
</example>`,
nullable: true
},
phoneNumber: {
type: 'string',
description: '手机号码',
nullable: true
},
ctWingAccountId: {
type: 'string',
description: '账号ID',
nullable: true
}
},
additionalProperties: false,
description: '账号列表输入参数'
} as const;
@ -787,6 +830,16 @@ export const CTWingPrivateProductInfoDtoSchema = {
description: '账号ID',
nullable: true
},
accountPhoneNumber: {
type: 'string',
description: '账户手机号',
nullable: true
},
ctWingAccountName: {
type: 'string',
description: '账号名称',
nullable: true
},
communicationAddress: {
type: 'string',
description: '通讯服务地址',
@ -803,9 +856,9 @@ export const CTWingPrivateProductInfoDtoSchema = {
nullable: true
},
ioTPlatformProductId: {
type: 'integer',
type: 'string',
description: '产品ID',
format: 'int32'
nullable: true
},
productName: {
type: 'string',
@ -1022,115 +1075,6 @@ export const CTWingPrivateProductInfoModifyInputSchema = {
description: 'CTWing 产品修改'
} as const;
export const CTWingWorkshopProductListOutputSchema = {
type: 'object',
properties: {
nonce: {
type: 'string',
description: '用于计算签名字符的随机串',
nullable: true
},
signature: {
type: 'string',
description: '加密签名,用以校验推送客户端身份合法性,校验方法见实例验证',
nullable: true
},
timestamp: {
type: 'integer',
description: '签名有效期(毫秒)',
format: 'int64'
},
msg: {
type: 'string',
description: '消息内容JSON字符串,具体的设备相关信息',
nullable: true
},
ctWingAccountId: {
type: 'string',
description: 'CTWing账户Id',
nullable: true
},
ioTPlatformProductId: {
type: 'string',
description: '物联网平台对应的产品Id',
nullable: true
},
productName: {
type: 'string',
description: '产品名称',
nullable: true
},
featureAccesskey: {
type: 'string',
description: '设备访问密钥',
nullable: true
},
communicationAddress: {
type: 'string',
description: '通讯服务地址',
nullable: true
},
communicationAddressTLS: {
type: 'string',
description: 'TLS通讯服务地址',
nullable: true
}
},
additionalProperties: false,
description: '生产车间获取CTWing产品列表'
} as const;
export const CTWingWorkshopProductListOutputListHttpDataResultSchema = {
type: 'object',
properties: {
code: {
'$ref': '#/components/schemas/ResponeResultEnum'
},
msg: {
type: 'string',
description: '详细描述',
nullable: true
},
success: {
type: 'boolean',
description: `是否获取到数据或者逻辑处理成功
`
},
timestamp: {
type: 'integer',
description: '时间戳(毫秒)',
format: 'int64',
readOnly: true
},
locationCode: {
type: 'integer',
description: `位置编码,主要用于接口请求逻辑定位
使`,
format: 'int32'
},
extras: {
type: 'string',
description: '扩展信息',
nullable: true
},
data: {
type: 'array',
items: {
'$ref': '#/components/schemas/CTWingWorkshopProductListOutput'
},
description: '扩展字段',
nullable: true
},
total: {
type: 'integer',
description: '总数',
format: 'int64'
}
},
additionalProperties: false,
description: 'HTTP 请求返回结果'
} as const;
export const ChangePasswordInputSchema = {
required: ['newPassword'],
type: 'object',
@ -1288,6 +1232,9 @@ export const CreateDeviceAggregationInputSchema = {
minLength: 1,
type: 'string',
description: '集中器在物联网平台中对应的产品Id'
},
deviceSourceTypeEnum: {
'$ref': '#/components/schemas/DeviceSourceTypeEnum'
}
},
additionalProperties: false,
@ -1888,9 +1835,9 @@ export const DeviceManagementInfoDtoSchema = {
description: '物联网平台中对应的账号Id',
nullable: true
},
ioTPlatformAccountName: {
accountPhoneNumber: {
type: 'string',
description: '物联网平台中对应的账号Name',
description: '户手机号',
nullable: true
},
ioTPlatformResponse: {
@ -1901,6 +1848,36 @@ export const DeviceManagementInfoDtoSchema = {
isPlatformPushSuccess: {
type: 'boolean',
description: '物联网平台推送是否成功'
},
deviceOnlineStatus: {
'$ref': '#/components/schemas/DeviceOnlineStatusEnum'
},
deviceOnlineStatusName: {
type: 'string',
description: '设备在线状态',
nullable: true,
readOnly: true
},
lastOnlineTime: {
type: 'string',
description: '最后在线时间',
format: 'date-time',
nullable: true
},
lastOfflineTime: {
type: 'string',
description: '最后离线时间',
format: 'date-time',
nullable: true
},
deviceSourceTypeEnum: {
'$ref': '#/components/schemas/DeviceSourceTypeEnum'
},
deviceSourceTypeName: {
type: 'string',
description: '设备来源类型',
nullable: true,
readOnly: true
}
},
additionalProperties: false
@ -1924,6 +1901,22 @@ export const DeviceManagementInfoDtoPagedResultDtoSchema = {
additionalProperties: false
} as const;
export const DeviceOnlineStatusEnumSchema = {
enum: [1, 2],
type: 'integer',
description: '设备在线状态',
format: 'int32',
'说明:': '在线=1,离线=2'
} as const;
export const DeviceSourceTypeEnumSchema = {
enum: [1, 2, 3, 4],
type: 'integer',
description: '设备来源类型枚举',
format: 'int32',
'说明:': '管理后台=1,生产车间=2,CTWing推送=3,OneNET推送=4'
} as const;
export const DeviceTableModelDataInfoPageInputSchema = {
type: 'object',
properties: {
@ -1951,11 +1944,6 @@ export const DeviceTableModelDataInfoPageInputSchema = {
</example>`,
nullable: true
},
dataBaseName: {
type: 'string',
description: '数据库名称',
nullable: true
},
ioTDataType: {
type: 'string',
description: '数据类型',
@ -2075,11 +2063,6 @@ export const DeviceTreeModelDataInfoInputSchema = {
</example>`,
nullable: true
},
dataBaseName: {
type: 'string',
description: '数据库名称',
nullable: true
},
ioTDataType: {
type: 'string',
description: '数据类型',
@ -3591,6 +3574,16 @@ export const HttpDataResultSchema = {
format: 'int64',
readOnly: true
},
nonce: {
type: 'string',
description: '用于计算签名字符的随机串',
nullable: true
},
signature: {
type: 'string',
description: '加密签名,用以校验推送客户端身份合法性,校验方法见实例验证',
nullable: true
},
locationCode: {
type: 'integer',
description: `位置编码,主要用于接口请求逻辑定位
@ -4297,7 +4290,7 @@ JiShe.ServicePro.Enums.DeviceTypeEnum`,
},
formattedTimestamps: {
type: 'string',
description: '格式化的时标',
description: '时标格式化以后的本地时间',
format: 'date-time',
readOnly: true
},
@ -4482,11 +4475,6 @@ export const MeterReadingPacketInfoPageInputSchema = {
</example>`,
nullable: true
},
dataBaseName: {
type: 'string',
description: '数据库名称',
nullable: true
},
ioTDataType: {
type: 'string',
description: '数据类型',
@ -4554,7 +4542,7 @@ JiShe.ServicePro.Enums.DeviceTypeEnum`,
},
formattedTimestamps: {
type: 'string',
description: '格式化的时标',
description: '时标格式化以后的本地时间',
format: 'date-time',
readOnly: true
},
@ -5155,6 +5143,11 @@ export const OneNETProductInfoDtoSchema = {
description: 'OneNET账户Id',
nullable: true
},
accountPhoneNumber: {
type: 'string',
description: '账户手机号',
nullable: true
},
oneNETAccountName: {
type: 'string',
description: 'OneNET账户',
@ -5519,115 +5512,6 @@ export const OneNetProductInfoModifyInputSchema = {
description: '修改OneNET产品'
} as const;
export const OneNetWorkshopProductListOutputSchema = {
type: 'object',
properties: {
nonce: {
type: 'string',
description: '用于计算签名字符的随机串',
nullable: true
},
signature: {
type: 'string',
description: '加密签名,用以校验推送客户端身份合法性,校验方法见实例验证',
nullable: true
},
timestamp: {
type: 'integer',
description: '签名有效期(毫秒)',
format: 'int64'
},
msg: {
type: 'string',
description: '消息内容JSON字符串,具体的设备相关信息',
nullable: true
},
oneNETAccountId: {
type: 'string',
description: 'OneNET账户Id',
nullable: true
},
ioTPlatformProductId: {
type: 'string',
description: '物联网平台对应的产品Id',
nullable: true
},
productName: {
type: 'string',
description: '产品名称',
nullable: true
},
productAccesskey: {
type: 'string',
description: '产品访问密钥',
nullable: true
},
communicationAddress: {
type: 'string',
description: '通讯服务地址',
nullable: true
},
communicationAddressTLS: {
type: 'string',
description: 'TLS通讯服务地址',
nullable: true
}
},
additionalProperties: false,
description: '生产车间获取OneNET产品列表'
} as const;
export const OneNetWorkshopProductListOutputListHttpDataResultSchema = {
type: 'object',
properties: {
code: {
'$ref': '#/components/schemas/ResponeResultEnum'
},
msg: {
type: 'string',
description: '详细描述',
nullable: true
},
success: {
type: 'boolean',
description: `是否获取到数据或者逻辑处理成功
`
},
timestamp: {
type: 'integer',
description: '时间戳(毫秒)',
format: 'int64',
readOnly: true
},
locationCode: {
type: 'integer',
description: `位置编码,主要用于接口请求逻辑定位
使`,
format: 'int32'
},
extras: {
type: 'string',
description: '扩展信息',
nullable: true
},
data: {
type: 'array',
items: {
'$ref': '#/components/schemas/OneNetWorkshopProductListOutput'
},
description: '扩展字段',
nullable: true
},
total: {
type: 'integer',
description: '总数',
format: 'int64'
}
},
additionalProperties: false,
description: 'HTTP 请求返回结果'
} as const;
export const OpenApiRequestSchema = {
type: 'object',
properties: {
@ -5641,7 +5525,7 @@ export const OpenApiRequestSchema = {
description: '加密签名,用以校验推送客户端身份合法性,校验方法见实例验证',
nullable: true
},
timestamp: {
time: {
type: 'integer',
description: '签名有效期(毫秒)',
format: 'int64'
@ -5650,6 +5534,10 @@ export const OpenApiRequestSchema = {
type: 'string',
description: '消息内容JSON字符串,具体的设备相关信息',
nullable: true
},
encrypted: {
type: 'boolean',
description: '是否加密'
}
},
additionalProperties: false,
@ -7824,11 +7712,6 @@ export const QueryCTWingAepReceiveMessageInputSchema = {
</example>`,
nullable: true
},
dataBaseName: {
type: 'string',
description: '数据库名称',
nullable: true
},
ioTDataType: {
type: 'string',
description: '数据类型',
@ -7896,7 +7779,7 @@ JiShe.ServicePro.Enums.DeviceTypeEnum`,
},
formattedTimestamps: {
type: 'string',
description: '格式化的时标',
description: '时标格式化以后的本地时间',
format: 'date-time',
readOnly: true
},
@ -8020,11 +7903,6 @@ export const QueryOneNETReceiveMessageInputSchema = {
</example>`,
nullable: true
},
dataBaseName: {
type: 'string',
description: '数据库名称',
nullable: true
},
ioTDataType: {
type: 'string',
description: '数据类型',
@ -8092,7 +7970,7 @@ JiShe.ServicePro.Enums.DeviceTypeEnum`,
},
formattedTimestamps: {
type: 'string',
description: '格式化的时标',
description: '时标格式化以后的本地时间',
format: 'date-time',
readOnly: true
},

File diff suppressed because one or more lines are too long

View File

@ -154,20 +154,24 @@ export type ApplicationSettingConfigurationDto = {
} | null;
};
export type ArchivalDataIssuedInput = {
meterType?: DeviceTypeEnum;
/**
*
*/
meterAddress?: (string) | null;
/**
*
*/
focusAddress?: (string) | null;
};
export type AuthTypeEnum = 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9;
/**
*
*/
export type BatchCreateDeviceAggregationInput = {
/**
*
*/
addressList: Array<(string)>;
ioTPlatform: IoTPlatformTypeEnum;
/**
* Id
*/
ioTPlatformProductId: string;
deviceSourceTypeEnum?: DeviceSourceTypeEnum;
};
export type ChangePasswordInput = {
currentPassword?: (string) | null;
newPassword: string;
@ -223,6 +227,7 @@ export type CreateDeviceAggregationInput = {
* Id
*/
ioTPlatformProductId: string;
deviceSourceTypeEnum?: DeviceSourceTypeEnum;
};
/**
@ -480,7 +485,33 @@ export type CTWingAccountInsertInput = {
*
*/
export type CTWingAccountListInput = {
[key: string]: unknown;
/**
* .1
*/
pageIndex?: number;
/**
* .
*/
pageSize?: number;
/**
*
*/
readonly skipCount?: number;
/**
*
* <example>
* name desc
* </example>
*/
sorting?: (string) | null;
/**
*
*/
phoneNumber?: (string) | null;
/**
* ID
*/
ctWingAccountId?: (string) | null;
};
/**
@ -567,6 +598,14 @@ export type CTWingPrivateProductInfoDto = {
* ID
*/
ctWingAccountId?: (string) | null;
/**
*
*/
accountPhoneNumber?: (string) | null;
/**
*
*/
ctWingAccountName?: (string) | null;
/**
*
*/
@ -582,7 +621,7 @@ export type CTWingPrivateProductInfoDto = {
/**
* ID
*/
ioTPlatformProductId?: number;
ioTPlatformProductId?: (string) | null;
/**
*
*/
@ -731,89 +770,6 @@ export type CTWingPrivateProductInfoModifyInput = {
id?: string;
};
/**
* CTWing产品列表
*/
export type CTWingWorkshopProductListOutput = {
/**
*
*/
nonce?: (string) | null;
/**
*
*/
signature?: (string) | null;
/**
*
*/
timestamp?: number;
/**
* JSON字符串,
*/
msg?: (string) | null;
/**
* CTWing账户Id
*/
ctWingAccountId?: (string) | null;
/**
* Id
*/
ioTPlatformProductId?: (string) | null;
/**
*
*/
productName?: (string) | null;
/**
* 访
*/
featureAccesskey?: (string) | null;
/**
*
*/
communicationAddress?: (string) | null;
/**
* TLS通讯服务地址
*/
communicationAddressTLS?: (string) | null;
};
/**
* HTTP
*/
export type CTWingWorkshopProductListOutputListHttpDataResult = {
code?: ResponeResultEnum;
/**
*
*/
msg?: (string) | null;
/**
*
*
*/
success?: boolean;
/**
* ()
*/
readonly timestamp?: number;
/**
*
* 使
*/
locationCode?: number;
/**
*
*/
extras?: (string) | null;
/**
*
*/
data?: Array<CTWingWorkshopProductListOutput> | null;
/**
*
*/
total?: number;
};
export type CurrentCultureDto = {
displayName?: (string) | null;
englishName?: (string) | null;
@ -1004,9 +960,9 @@ export type DeviceManagementInfoDto = {
*/
ioTPlatformAccountId?: (string) | null;
/**
* Name
*
*/
ioTPlatformAccountName?: (string) | null;
accountPhoneNumber?: (string) | null;
/**
*
*/
@ -1015,6 +971,24 @@ export type DeviceManagementInfoDto = {
*
*/
isPlatformPushSuccess?: boolean;
deviceOnlineStatus?: DeviceOnlineStatusEnum;
/**
* 线
*/
readonly deviceOnlineStatusName?: (string) | null;
/**
* 线
*/
lastOnlineTime?: (string) | null;
/**
* 线
*/
lastOfflineTime?: (string) | null;
deviceSourceTypeEnum?: DeviceSourceTypeEnum;
/**
*
*/
readonly deviceSourceTypeName?: (string) | null;
};
export type DeviceManagementInfoDtoPagedResultDto = {
@ -1022,6 +996,16 @@ export type DeviceManagementInfoDtoPagedResultDto = {
totalCount?: number;
};
/**
* 线
*/
export type DeviceOnlineStatusEnum = 1 | 2;
/**
*
*/
export type DeviceSourceTypeEnum = 1 | 2 | 3 | 4;
/**
*
*/
@ -1045,10 +1029,6 @@ export type DeviceTableModelDataInfoPageInput = {
* </example>
*/
sorting?: (string) | null;
/**
*
*/
dataBaseName?: (string) | null;
/**
*
*/
@ -1130,10 +1110,6 @@ export type DeviceTreeModelDataInfoInput = {
* </example>
*/
sorting?: (string) | null;
/**
*
*/
dataBaseName?: (string) | null;
/**
*
*/
@ -1726,6 +1702,14 @@ export type HttpDataResult = {
* ()
*/
readonly timestamp?: number;
/**
*
*/
nonce?: (string) | null;
/**
*
*/
signature?: (string) | null;
/**
*
* 使
@ -1997,7 +1981,7 @@ export type MeterReadingPacketInfoDto = {
*/
timestamps?: number;
/**
*
*
*/
readonly formattedTimestamps?: string;
/**
@ -2145,10 +2129,6 @@ export type MeterReadingPacketInfoPageInput = {
* </example>
*/
sorting?: (string) | null;
/**
*
*/
dataBaseName?: (string) | null;
/**
*
*/
@ -2199,7 +2179,7 @@ export type MeterReadingPacketInfoPageOutput = {
*/
timestamps?: number;
/**
*
*
*/
readonly formattedTimestamps?: string;
/**
@ -2596,6 +2576,10 @@ export type OneNETProductInfoDto = {
* OneNET账户Id
*/
oneNETAccountId?: (string) | null;
/**
*
*/
accountPhoneNumber?: (string) | null;
/**
* OneNET账户
*/
@ -2788,89 +2772,6 @@ export type OneNetProductInfoModifyInput = {
deviceThingModelFileName?: (string) | null;
};
/**
* OneNET产品列表
*/
export type OneNetWorkshopProductListOutput = {
/**
*
*/
nonce?: (string) | null;
/**
*
*/
signature?: (string) | null;
/**
*
*/
timestamp?: number;
/**
* JSON字符串,
*/
msg?: (string) | null;
/**
* OneNET账户Id
*/
oneNETAccountId?: (string) | null;
/**
* Id
*/
ioTPlatformProductId?: (string) | null;
/**
*
*/
productName?: (string) | null;
/**
* 访
*/
productAccesskey?: (string) | null;
/**
*
*/
communicationAddress?: (string) | null;
/**
* TLS通讯服务地址
*/
communicationAddressTLS?: (string) | null;
};
/**
* HTTP
*/
export type OneNetWorkshopProductListOutputListHttpDataResult = {
code?: ResponeResultEnum;
/**
*
*/
msg?: (string) | null;
/**
*
*
*/
success?: boolean;
/**
* ()
*/
readonly timestamp?: number;
/**
*
* 使
*/
locationCode?: number;
/**
*
*/
extras?: (string) | null;
/**
*
*/
data?: Array<OneNetWorkshopProductListOutput> | null;
/**
*
*/
total?: number;
};
/**
*
*/
@ -2886,11 +2787,15 @@ export type OpenApiRequest = {
/**
*
*/
timestamp?: number;
time?: number;
/**
* JSON字符串,
*/
msg?: (string) | null;
/**
*
*/
encrypted?: boolean;
};
/**
@ -4071,10 +3976,6 @@ export type QueryCTWingAepReceiveMessageInput = {
* </example>
*/
sorting?: (string) | null;
/**
*
*/
dataBaseName?: (string) | null;
/**
*
*/
@ -4125,7 +4026,7 @@ export type QueryCTWingAepReceiveMessageOutput = {
*/
timestamps?: number;
/**
*
*
*/
readonly formattedTimestamps?: string;
/**
@ -4214,10 +4115,6 @@ export type QueryOneNETReceiveMessageInput = {
* </example>
*/
sorting?: (string) | null;
/**
*
*/
dataBaseName?: (string) | null;
/**
*
*/
@ -4268,7 +4165,7 @@ export type QueryOneNETReceiveMessageOutput = {
*/
timestamps?: number;
/**
*
*
*/
readonly formattedTimestamps?: string;
/**
@ -4937,7 +4834,7 @@ export type PostAggregationCtWingGetProductListAsyncData = {
};
};
export type PostAggregationCtWingGetProductListAsyncResponse = (CTWingWorkshopProductListOutputListHttpDataResult);
export type PostAggregationCtWingGetProductListAsyncResponse = (HttpDataResult);
export type PostAggregationCtWingGetProductListAsyncError = unknown;
@ -5103,6 +5000,16 @@ export type PostAggregationDeviceCreateAsyncResponse = (boolean);
export type PostAggregationDeviceCreateAsyncError = unknown;
export type PostAggregationDeviceBatchCreateAsyncData = {
query?: {
input?: BatchCreateDeviceAggregationInput;
};
};
export type PostAggregationDeviceBatchCreateAsyncResponse = (boolean);
export type PostAggregationDeviceBatchCreateAsyncError = unknown;
export type PostAggregationDeviceDeleteAsyncData = {
query?: {
input?: IdInput;
@ -5157,16 +5064,6 @@ export type PostDeviceInfoCacheDeviceDataToRedisResponse = (boolean);
export type PostDeviceInfoCacheDeviceDataToRedisError = unknown;
export type PostDeviceInfoArchivesDownData = {
query?: {
input?: ArchivalDataIssuedInput;
};
};
export type PostDeviceInfoArchivesDownResponse = (boolean);
export type PostDeviceInfoArchivesDownError = unknown;
export type PostFeaturesListData = {
body?: GetFeatureListResultInput;
};
@ -5479,7 +5376,7 @@ export type PostAggregationOneNetReceiveWorkshopProductionInfoAsyncData = {
};
};
export type PostAggregationOneNetReceiveWorkshopProductionInfoAsyncResponse = (unknown);
export type PostAggregationOneNetReceiveWorkshopProductionInfoAsyncResponse = (HttpDataResult);
export type PostAggregationOneNetReceiveWorkshopProductionInfoAsyncError = unknown;
@ -5492,7 +5389,7 @@ export type PostAggregationOneNetGetProductListAsyncData = {
};
};
export type PostAggregationOneNetGetProductListAsyncResponse = (OneNetWorkshopProductListOutputListHttpDataResult);
export type PostAggregationOneNetGetProductListAsyncResponse = (HttpDataResult);
export type PostAggregationOneNetGetProductListAsyncError = unknown;

View File

@ -19,6 +19,7 @@ import {
getApiAbpApplicationConfiguration,
postApiAppAccountLogin2Fa,
postTenantsFind,
postApiAppAccountLogout,
} from '#/api-client';
import { useSignalR } from '#/hooks/useSignalR';
import { $t } from '#/locales';
@ -105,7 +106,8 @@ export const useAuthStore = defineStore('auth', () => {
async function logout(redirect: boolean = true) {
try {
// await logoutApi();
// 先调用后端登出接口
await postApiAppAccountLogout();
const { closeConnect } = useSignalR();
closeConnect();
} catch {

View File

@ -73,12 +73,7 @@ onBeforeMount(async () => {
</script>
<template>
<AuthenticationLogin
:form-schema="formSchema"
:loading="authStore.loginLoading"
:show-tenant-login="showTenant"
:show-third-party-login="showThirdPartyLogin"
:third-part-login-list="thirdPartLoginList as any"
@submit="authStore.authLogin"
/>
<AuthenticationLogin :form-schema="formSchema" :loading="authStore.loginLoading" :show-tenant-login="showTenant"
:show-third-party-login="showThirdPartyLogin" :third-part-login-list="thirdPartLoginList as any"
@submit="authStore.authLogin" />
</template>

View File

@ -68,7 +68,7 @@ const formatDate = (date: Date | string) => {
};
const route = useRoute();
const { DeviceType, DeviceAddress } = route.query;
const { IoTDataType, DeviceAddress } = route.query;
//
const dynamicColumns = ref<any[]>([]);
@ -155,7 +155,7 @@ initDefaultColumns();
const formOptions: VbenFormProps = {
schema: querySchema.value,
initialValues: {
DeviceType: DeviceType ? Number(DeviceType) : undefined,
IoTDataType: IoTDataType as string,
DeviceAddress: DeviceAddress as string, // 使DeviceAddress
},
// 使
@ -164,13 +164,13 @@ const formOptions: VbenFormProps = {
handleValuesChange: async (values, changedFields) => {
//
if (isInitializing.value) {
console.log('初始化中,跳过表单值变化处理');
return;
}
//
const relevantFields = new Set([
'DeviceAddress',
'DeviceType',
'EndCreationTime',
'IoTDataType',
'StartCreationTime',
@ -278,14 +278,19 @@ const gridOptions: VxeGridProps<any> = {
if (!currentFormValues.DeviceAddress && DeviceAddress) {
currentFormValues.DeviceAddress = DeviceAddress as string;
}
// DeviceTypeIoTDataType
const deviceTypeValue = currentFormValues.DeviceType;
const deviceTypeNumber = deviceTypeValue
? Number(deviceTypeValue)
: undefined;
// IoTDataType使
if (!currentFormValues.IoTDataType && IoTDataType) {
currentFormValues.IoTDataType = IoTDataType as string;
}
// IoTDataType
const ioTDataTypeValue = currentFormValues.IoTDataType;
//
console.log('表单值:', currentFormValues);
console.log('路由参数:', { IoTDataType, DeviceAddress });
//
const startCreationTime = currentFormValues.StartCreationTime
? formatDate(currentFormValues.StartCreationTime)
@ -313,13 +318,23 @@ const gridOptions: VxeGridProps<any> = {
deviceAddress = deviceInfo.deviceAddress || deviceAddress;
}
try {
//
console.log('API请求参数:', {
pageIndex: page.currentPage,
pageSize: page.pageSize,
DeviceAddress: deviceAddress,
IoTDataType: ioTDataTypeValue,
StartCreationTime: startCreationTime,
EndCreationTime: endCreationTime,
});
console.log('调用来源:', new Error().stack);
const { data } = await postTreeModelDeviceDataInfoPage({
body: {
pageIndex: page.currentPage,
pageSize: page.pageSize,
// 使DeviceAddress
DeviceAddress: deviceAddress,
DeviceType: deviceTypeNumber || undefined,
IoTDataType: ioTDataTypeValue || undefined,
//
StartCreationTime: startCreationTime || undefined,
@ -429,23 +444,31 @@ const initializeGrid = async () => {
}
//
if (DeviceType || DeviceAddress) {
if (IoTDataType || DeviceAddress) {
//
setTimeout(async () => {
if (gridApi && gridApi.formApi) {
//
const currentValues = await gridApi.formApi.getValues();
const updatedValues = { ...currentValues };
if (!currentValues.DeviceAddress && DeviceAddress) {
await gridApi.formApi.setValues({
...currentValues,
DeviceAddress: DeviceAddress as string,
});
updatedValues.DeviceAddress = DeviceAddress as string;
}
//
if (!currentValues.IoTDataType && IoTDataType) {
updatedValues.IoTDataType = IoTDataType as string;
}
if (updatedValues !== currentValues) {
await gridApi.formApi.setValues(updatedValues);
//
await nextTick();
}
//
setTimeout(() => {
isInitializing.value = false;
//
gridApi.reload();
}, 200);
} else {
isInitializing.value = false;
@ -463,15 +486,20 @@ const initializeGrid = async () => {
//
watch(
() => [DeviceType, DeviceAddress],
() => [IoTDataType, DeviceAddress],
async (newValues, oldValues) => {
//
if (isInitializing.value) {
if (isInitializing.value || !isGridInitialized.value) {
return;
}
//
if (newValues.some(Boolean) && gridApi && isGridInitialized.value) {
//
const hasChanged = oldValues && (
newValues[0] !== oldValues[0] ||
newValues[1] !== oldValues[1]
);
if (hasChanged && newValues.some(Boolean) && gridApi) {
//
setTimeout(() => {
gridApi.reload();