完善设备信息界面

This commit is contained in:
ChenYi 2025-12-31 14:24:10 +08:00
parent f54c055199
commit d672ea04aa
5 changed files with 1350 additions and 89 deletions

View File

@ -996,6 +996,7 @@ export const CTWingPrivateProductInfoDtoSchema = {
deviceThingModelFileId: { deviceThingModelFileId: {
type: 'string', type: 'string',
description: '设备物模型文件Id', description: '设备物模型文件Id',
format: 'uuid',
nullable: true nullable: true
}, },
deviceThingModelFileName: { deviceThingModelFileName: {
@ -1051,6 +1052,7 @@ export const CTWingPrivateProductInfoInsertInputSchema = {
deviceThingModelFileId: { deviceThingModelFileId: {
type: 'string', type: 'string',
description: '设备物模型文件Id', description: '设备物模型文件Id',
format: 'uuid',
nullable: true nullable: true
}, },
deviceThingModelFileName: { deviceThingModelFileName: {
@ -1139,6 +1141,7 @@ export const CTWingPrivateProductInfoModifyInputSchema = {
deviceThingModelFileId: { deviceThingModelFileId: {
type: 'string', type: 'string',
description: '设备物模型文件Id', description: '设备物模型文件Id',
format: 'uuid',
nullable: true nullable: true
}, },
deviceThingModelFileName: { deviceThingModelFileName: {
@ -1427,6 +1430,53 @@ export const CreateDeviceAggregationInputSchema = {
description: '设备聚合新增设备' description: '设备聚合新增设备'
} as const; } as const;
export const CreateDeviceFirmwareInfoInputSchema = {
required: ['firmwareFileId', 'firmwareFileName', 'firmwareHashCode', 'firmwareLength', 'firmwareVersion', 'ioTPlatform', 'ioTPlatformProductId', 'ioTPlatformProductName'],
type: 'object',
properties: {
ioTPlatform: {
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
},
ioTPlatformProductId: {
minLength: 1,
type: 'string',
description: '物联网平台中对应的产品Id'
},
ioTPlatformProductName: {
minLength: 1,
type: 'string',
description: '物联网平台中对应的产品名称'
},
firmwareVersion: {
minLength: 1,
type: 'string',
description: '固件版本'
},
firmwareFileId: {
type: 'string',
description: '固件文件Id',
format: 'uuid'
},
firmwareFileName: {
minLength: 1,
type: 'string',
description: '固件文件名称'
},
firmwareHashCode: {
minLength: 1,
type: 'string',
description: '固件哈希值'
},
firmwareLength: {
type: 'integer',
description: '固件文件长度',
format: 'int64'
}
},
additionalProperties: false,
description: '创建设备固件信息'
} as const;
export const CreateLanguageInputSchema = { export const CreateLanguageInputSchema = {
type: 'object', type: 'object',
properties: { properties: {
@ -1975,6 +2025,144 @@ export const DeviceCommandForApiInputSchema = {
description: '设备命令' description: '设备命令'
} as const; } as const;
export const DeviceFirmwareInfoDtoSchema = {
type: 'object',
properties: {
id: {
type: 'string',
format: 'uuid'
},
creationTime: {
type: 'string',
format: 'date-time'
},
creatorId: {
type: 'string',
format: 'uuid',
nullable: true
},
lastModificationTime: {
type: 'string',
format: 'date-time',
nullable: true
},
lastModifierId: {
type: 'string',
format: 'uuid',
nullable: true
},
isDeleted: {
type: 'boolean'
},
deleterId: {
type: 'string',
format: 'uuid',
nullable: true
},
deletionTime: {
type: 'string',
format: 'date-time',
nullable: true
},
tenantId: {
type: 'string',
description: '租户Id',
format: 'uuid',
nullable: true
},
remark: {
type: 'string',
description: '备注',
nullable: true
},
osaCreatorId: {
type: 'integer',
description: '旧系统授权创建者Id',
format: 'int32',
nullable: true
},
osaLastModifierId: {
type: 'integer',
description: '旧系统授权最后修改者Id',
format: 'int32',
nullable: true
},
osaDeleterId: {
type: 'integer',
description: '旧系统授权最后删除者Id',
format: 'int32',
nullable: true
},
extraProperties: {
type: 'object',
additionalProperties: {},
description: '扩展属性,用于存储自定义字段,JSON格式',
nullable: true
},
ioTPlatform: {
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
},
ioTPlatformProductId: {
type: 'string',
description: '物联网平台中对应的产品Id',
nullable: true
},
ioTPlatformProductName: {
type: 'string',
description: '物联网平台中对应的产品名称',
nullable: true
},
firmwareVersion: {
type: 'string',
description: '固件版本',
nullable: true
},
firmwareFileId: {
type: 'string',
description: '固件文件Id',
format: 'uuid'
},
firmwareFileName: {
type: 'string',
description: '固件文件名称',
nullable: true
},
firmwareHashCode: {
type: 'string',
description: '固件哈希值',
nullable: true
},
firmwareLength: {
type: 'integer',
description: '固件文件长度',
format: 'int64'
},
isEnable: {
type: 'boolean',
description: '是否启用'
}
},
additionalProperties: false
} as const;
export const DeviceFirmwareInfoDtoPagedResultDtoSchema = {
type: 'object',
properties: {
items: {
type: 'array',
items: {
'$ref': '#/components/schemas/DeviceFirmwareInfoDto'
},
nullable: true
},
totalCount: {
type: 'integer',
format: 'int64'
}
},
additionalProperties: false
} as const;
export const DeviceManagementInfoDtoSchema = { export const DeviceManagementInfoDtoSchema = {
type: 'object', type: 'object',
properties: { properties: {
@ -2160,6 +2348,22 @@ export const DeviceManagementInfoDtoSchema = {
type: 'string', type: 'string',
description: '设备物模型名称', description: '设备物模型名称',
nullable: true nullable: true
},
firmwareVersion: {
type: 'string',
description: '固件版本',
nullable: true
},
upgradeDate: {
type: 'string',
description: '升级日期',
format: 'date-time',
nullable: true
},
securityKey: {
type: 'string',
description: '设备接入鉴权key',
nullable: true
} }
}, },
additionalProperties: false additionalProperties: false
@ -3295,6 +3499,219 @@ export const DeviceTypeEnumSchema = {
'说明:': '未知=0,网关设备=1,直连设备=2,子设备=3' '说明:': '未知=0,网关设备=1,直连设备=2,子设备=3'
} as const; } as const;
export const DeviceUpgradeForApiInputSchema = {
required: ['id', 'ioTPlatform', 'ioTPlatformProductId', 'nowFirmwareVersionDataId'],
type: 'object',
properties: {
id: {
type: 'string',
format: 'uuid'
},
ioTPlatform: {
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
},
ioTPlatformProductId: {
minLength: 1,
type: 'string',
description: '物联网平台中对应的产品Id'
},
nowFirmwareVersionDataId: {
type: 'string',
description: '固件版本信息',
format: 'uuid'
}
},
additionalProperties: false,
description: '设备升级'
} as const;
export const DeviceUpgradeRecordDtoSchema = {
type: 'object',
properties: {
id: {
type: 'string',
format: 'uuid'
},
creationTime: {
type: 'string',
format: 'date-time'
},
creatorId: {
type: 'string',
format: 'uuid',
nullable: true
},
lastModificationTime: {
type: 'string',
format: 'date-time',
nullable: true
},
lastModifierId: {
type: 'string',
format: 'uuid',
nullable: true
},
isDeleted: {
type: 'boolean'
},
deleterId: {
type: 'string',
format: 'uuid',
nullable: true
},
deletionTime: {
type: 'string',
format: 'date-time',
nullable: true
},
tenantId: {
type: 'string',
description: '租户Id',
format: 'uuid',
nullable: true
},
remark: {
type: 'string',
description: '备注',
nullable: true
},
osaCreatorId: {
type: 'integer',
description: '旧系统授权创建者Id',
format: 'int32',
nullable: true
},
osaLastModifierId: {
type: 'integer',
description: '旧系统授权最后修改者Id',
format: 'int32',
nullable: true
},
osaDeleterId: {
type: 'integer',
description: '旧系统授权最后删除者Id',
format: 'int32',
nullable: true
},
extraProperties: {
type: 'object',
additionalProperties: {},
description: '扩展属性,用于存储自定义字段,JSON格式',
nullable: true
},
deviceName: {
type: 'string',
description: '设备名称',
nullable: true
},
deviceAddress: {
type: 'string',
description: '设备地址',
nullable: true
},
oldFirmwareVersion: {
type: 'string',
description: '旧的固件版本',
nullable: true
},
nowFirmwareVersion: {
type: 'string',
description: '固件版本',
nullable: true
},
upgradeDate: {
type: 'string',
description: '升级日期',
format: 'date-time'
},
upgradeSource: {
'$ref': '#/components/schemas/DeviceUpgradeSourceTypeEnum'
},
upgradeSourceTypeName: {
type: 'string',
description: '升级来源',
nullable: true,
readOnly: true
},
upgradeMessage: {
type: 'string',
description: '升级信息',
nullable: true
},
upgradeStatus: {
'$ref': '#/components/schemas/DeviceUpgradeStatusTypeEnum'
},
upgradeStatusName: {
type: 'string',
description: '升级状态',
nullable: true,
readOnly: true
},
upgradeIdentifier: {
type: 'integer',
description: '升级标识符号',
format: 'int64'
},
firmwareSignature: {
type: 'string',
description: '签名校验值',
nullable: true
},
upgradeResult: {
'$ref': '#/components/schemas/DeviceUpgradeResultTypeEnum'
},
upgradeResultName: {
type: 'string',
description: '升级结果',
nullable: true,
readOnly: true
}
},
additionalProperties: false
} as const;
export const DeviceUpgradeRecordDtoPagedResultDtoSchema = {
type: 'object',
properties: {
items: {
type: 'array',
items: {
'$ref': '#/components/schemas/DeviceUpgradeRecordDto'
},
nullable: true
},
totalCount: {
type: 'integer',
format: 'int64'
}
},
additionalProperties: false
} as const;
export const DeviceUpgradeResultTypeEnumSchema = {
enum: [0, 1001, 1002, 1003, 1004, 1005, 2001, 2002, 2003, 2004, 2005, 2006, 3001, 3002, 3003, 4001, 5001, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 9999],
type: 'integer',
description: '设备升级结果枚举',
format: 'int32',
'说明:': 'Success=0,InvalidUrl=1001,UrlFileNameMismatch=1002,InvalidFileLength=1003,NvmWriteFailed=1004,ModuleUrlFetchFailed=1005,DownloadTimeout=2001,ParseHttpDlFileFailed=2002,DownloadIncomplete=2003,DownloadSizeMismatch=2004,ModuleReadTimeout=2005,FilePointerException=2006,ExternalFlashWriteFailed=3001,ExternalFlashReadCrcMismatch=3002,ExternalFlashWriteCrcMismatch=3003,SecurityVerificationFailed=4001,Crc32Mismatch=5001,DiffDecompressFailed=6001,DiffPatchFailed=6002,DiffDictionaryExceeded=6003,DiffCompressionTypeUnsupported=6004,RestoredFirmwareSizeExceeded=6005,TargetAddressInBootArea=6006,IapPowerAbnormal=6007,IapSerialPowerAbnormal=6008,UnknownError=9999'
} as const;
export const DeviceUpgradeSourceTypeEnumSchema = {
enum: [1, 2],
type: 'integer',
description: '设备升级来源类型枚举',
format: 'int32',
'说明:': '管理后台=1,业务系统=2'
} as const;
export const DeviceUpgradeStatusTypeEnumSchema = {
enum: [1, 2, 3, 4],
type: 'integer',
description: '设备升级状态枚举',
format: 'int32',
'说明:': '未升级=1,升级中=2,升级成功=3,升级失败=4'
} as const;
export const DisabledTwoFactorInputSchema = { export const DisabledTwoFactorInputSchema = {
required: ['code'], required: ['code'],
type: 'object', type: 'object',
@ -3959,6 +4376,11 @@ export const FileObjectDtoSchema = {
type: 'string', type: 'string',
description: '文件名称', description: '文件名称',
nullable: true nullable: true
},
mD5Hash: {
type: 'string',
description: '文件MD5',
nullable: true
} }
}, },
additionalProperties: false, additionalProperties: false,
@ -6574,6 +6996,7 @@ export const OneNETProductInfoDtoSchema = {
deviceThingModelFileId: { deviceThingModelFileId: {
type: 'string', type: 'string',
description: '设备物模型文件Id', description: '设备物模型文件Id',
format: 'uuid',
nullable: true nullable: true
}, },
deviceThingModelFileName: { deviceThingModelFileName: {
@ -6823,6 +7246,7 @@ export const OneNetProductInfoInsertInputSchema = {
deviceThingModelFileId: { deviceThingModelFileId: {
type: 'string', type: 'string',
description: '设备物模型文件Id', description: '设备物模型文件Id',
format: 'uuid',
nullable: true nullable: true
}, },
deviceThingModelFileName: { deviceThingModelFileName: {
@ -6921,6 +7345,7 @@ export const OneNetProductInfoModifyInputSchema = {
deviceThingModelFileId: { deviceThingModelFileId: {
type: 'string', type: 'string',
description: '设备物模型文件Id', description: '设备物模型文件Id',
format: 'uuid',
nullable: true nullable: true
}, },
deviceThingModelFileName: { deviceThingModelFileName: {
@ -6969,6 +7394,60 @@ export const OpenTypeSchema = {
'说明:': '无=10,组件=20,内链=30,外链=40' '说明:': '无=10,组件=20,内链=30,外链=40'
} as const; } as const;
export const PageDeviceFirmwareInfoInputSchema = {
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
},
isPage: {
type: 'boolean',
description: '是否分页'
},
ioTPlatform: {
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
},
firmwareVersion: {
type: 'string',
description: '固件版本',
nullable: true
},
ioTPlatformProductId: {
type: 'string',
description: '物联网平台中对应的产品Id',
nullable: true
},
searchKeyword: {
type: 'string',
description: '搜索关键字',
nullable: true
}
},
additionalProperties: false,
description: '创建设备固件信息'
} as const;
export const PageDeviceInputSchema = { export const PageDeviceInputSchema = {
type: 'object', type: 'object',
properties: { properties: {
@ -7027,6 +7506,84 @@ export const PageDeviceInputSchema = {
additionalProperties: false additionalProperties: false
} as const; } as const;
export const PageDeviceUpgradeRecordInputSchema = {
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
},
isPage: {
type: 'boolean',
description: '是否分页'
},
deviceName: {
type: 'string',
description: '设备名称',
nullable: true
},
deviceAddress: {
type: 'string',
description: '设备地址',
nullable: true
},
oldFirmwareVersion: {
type: 'string',
description: '旧的固件版本',
nullable: true
},
nowFirmwareVersion: {
type: 'string',
description: '当前固件版本',
nullable: true
},
upgradeDate: {
type: 'string',
description: '升级日期',
format: 'date-time'
},
upgradeSource: {
'$ref': '#/components/schemas/DeviceUpgradeSourceTypeEnum'
},
searchKeyword: {
type: 'string',
description: '搜索关键字',
nullable: true
},
upgradeIdentifier: {
type: 'integer',
description: '升级标识符号',
format: 'int64',
nullable: true
},
upgradeResult: {
'$ref': '#/components/schemas/DeviceUpgradeResultTypeEnum'
}
},
additionalProperties: false,
description: '设备升级记录分页查询输入'
} as const;
export const PageFileObjectInputSchema = { export const PageFileObjectInputSchema = {
type: 'object', type: 'object',
properties: { properties: {
@ -10286,6 +10843,58 @@ export const UpdateDetailInputSchema = {
additionalProperties: false additionalProperties: false
} as const; } as const;
export const UpdateDeviceFirmwareInfoInputSchema = {
required: ['firmwareFileId', 'firmwareFileName', 'firmwareHashCode', 'firmwareLength', 'firmwareVersion', 'id', 'ioTPlatform', 'ioTPlatformProductId', 'ioTPlatformProductName'],
type: 'object',
properties: {
ioTPlatform: {
'$ref': '#/components/schemas/IoTPlatformTypeEnum'
},
ioTPlatformProductId: {
minLength: 1,
type: 'string',
description: '物联网平台中对应的产品Id'
},
ioTPlatformProductName: {
minLength: 1,
type: 'string',
description: '物联网平台中对应的产品名称'
},
firmwareVersion: {
minLength: 1,
type: 'string',
description: '固件版本'
},
firmwareFileId: {
type: 'string',
description: '固件文件Id',
format: 'uuid'
},
firmwareFileName: {
minLength: 1,
type: 'string',
description: '固件文件名称'
},
firmwareHashCode: {
minLength: 1,
type: 'string',
description: '固件哈希值'
},
firmwareLength: {
type: 'integer',
description: '固件文件长度',
format: 'int64'
},
id: {
type: 'string',
description: '数据Id',
format: 'uuid'
}
},
additionalProperties: false,
description: '更新固件信息'
} as const;
export const UpdateFeatureDtoSchema = { export const UpdateFeatureDtoSchema = {
type: 'object', type: 'object',
properties: { properties: {

File diff suppressed because one or more lines are too long

View File

@ -348,6 +348,41 @@ export type CreateDeviceAggregationInput = {
deviceSourceTypeEnum?: DeviceSourceTypeEnum; deviceSourceTypeEnum?: DeviceSourceTypeEnum;
}; };
/**
*
*/
export type CreateDeviceFirmwareInfoInput = {
ioTPlatform: IoTPlatformTypeEnum;
/**
* Id
*/
ioTPlatformProductId: string;
/**
*
*/
ioTPlatformProductName: string;
/**
*
*/
firmwareVersion: string;
/**
* Id
*/
firmwareFileId: string;
/**
*
*/
firmwareFileName: string;
/**
*
*/
firmwareHashCode: string;
/**
*
*/
firmwareLength: number;
};
/** /**
* *
*/ */
@ -1080,6 +1115,81 @@ export type DeviceCommandForApiInput = {
}; };
}; };
export type DeviceFirmwareInfoDto = {
id?: string;
creationTime?: string;
creatorId?: (string) | null;
lastModificationTime?: (string) | null;
lastModifierId?: (string) | null;
isDeleted?: boolean;
deleterId?: (string) | null;
deletionTime?: (string) | null;
/**
* Id
*/
tenantId?: (string) | null;
/**
*
*/
remark?: (string) | null;
/**
* Id
*/
osaCreatorId?: (number) | null;
/**
* Id
*/
osaLastModifierId?: (number) | null;
/**
* Id
*/
osaDeleterId?: (number) | null;
/**
* ,,JSON格式
*/
extraProperties?: {
[key: string]: unknown;
} | null;
ioTPlatform?: IoTPlatformTypeEnum;
/**
* Id
*/
ioTPlatformProductId?: (string) | null;
/**
*
*/
ioTPlatformProductName?: (string) | null;
/**
*
*/
firmwareVersion?: (string) | null;
/**
* Id
*/
firmwareFileId?: string;
/**
*
*/
firmwareFileName?: (string) | null;
/**
*
*/
firmwareHashCode?: (string) | null;
/**
*
*/
firmwareLength?: number;
/**
*
*/
isEnable?: boolean;
};
export type DeviceFirmwareInfoDtoPagedResultDto = {
items?: Array<DeviceFirmwareInfoDto> | null;
totalCount?: number;
};
export type DeviceManagementInfoDto = { export type DeviceManagementInfoDto = {
id?: string; id?: string;
creationTime?: string; creationTime?: string;
@ -1195,6 +1305,18 @@ export type DeviceManagementInfoDto = {
* *
*/ */
deviceThingModelName?: (string) | null; deviceThingModelName?: (string) | null;
/**
*
*/
firmwareVersion?: (string) | null;
/**
*
*/
upgradeDate?: (string) | null;
/**
* key
*/
securityKey?: (string) | null;
}; };
export type DeviceManagementInfoDtoPagedResultDto = { export type DeviceManagementInfoDtoPagedResultDto = {
@ -1921,6 +2043,126 @@ export type DeviceTreeModelDataInfoInput = {
*/ */
export type DeviceTypeEnum = 0 | 1 | 2 | 3; export type DeviceTypeEnum = 0 | 1 | 2 | 3;
/**
*
*/
export type DeviceUpgradeForApiInput = {
id: string;
ioTPlatform: IoTPlatformTypeEnum;
/**
* Id
*/
ioTPlatformProductId: string;
/**
*
*/
nowFirmwareVersionDataId: string;
};
export type DeviceUpgradeRecordDto = {
id?: string;
creationTime?: string;
creatorId?: (string) | null;
lastModificationTime?: (string) | null;
lastModifierId?: (string) | null;
isDeleted?: boolean;
deleterId?: (string) | null;
deletionTime?: (string) | null;
/**
* Id
*/
tenantId?: (string) | null;
/**
*
*/
remark?: (string) | null;
/**
* Id
*/
osaCreatorId?: (number) | null;
/**
* Id
*/
osaLastModifierId?: (number) | null;
/**
* Id
*/
osaDeleterId?: (number) | null;
/**
* ,,JSON格式
*/
extraProperties?: {
[key: string]: unknown;
} | null;
/**
*
*/
deviceName?: (string) | null;
/**
*
*/
deviceAddress?: (string) | null;
/**
*
*/
oldFirmwareVersion?: (string) | null;
/**
*
*/
nowFirmwareVersion?: (string) | null;
/**
*
*/
upgradeDate?: string;
upgradeSource?: DeviceUpgradeSourceTypeEnum;
/**
*
*/
readonly upgradeSourceTypeName?: (string) | null;
/**
*
*/
upgradeMessage?: (string) | null;
upgradeStatus?: DeviceUpgradeStatusTypeEnum;
/**
*
*/
readonly upgradeStatusName?: (string) | null;
/**
*
*/
upgradeIdentifier?: number;
/**
*
*/
firmwareSignature?: (string) | null;
upgradeResult?: DeviceUpgradeResultTypeEnum;
/**
*
*/
readonly upgradeResultName?: (string) | null;
};
export type DeviceUpgradeRecordDtoPagedResultDto = {
items?: Array<DeviceUpgradeRecordDto> | null;
totalCount?: number;
};
/**
*
*/
export type DeviceUpgradeResultTypeEnum = 0 | 1001 | 1002 | 1003 | 1004 | 1005 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 3001 | 3002 | 3003 | 4001 | 5001 | 6001 | 6002 | 6003 | 6004 | 6005 | 6006 | 6007 | 6008 | 9999;
/**
*
*/
export type DeviceUpgradeSourceTypeEnum = 1 | 2;
/**
*
*/
export type DeviceUpgradeStatusTypeEnum = 1 | 2 | 3 | 4;
export type DisabledTwoFactorInput = { export type DisabledTwoFactorInput = {
/** /**
* *
@ -2161,6 +2403,10 @@ export type FileObjectDto = {
* *
*/ */
fileName?: (string) | null; fileName?: (string) | null;
/**
* MD5
*/
mD5Hash?: (string) | null;
}; };
export type FileQoSOptions = { export type FileQoSOptions = {
@ -3716,6 +3962,48 @@ export type OpenApiRequest = {
*/ */
export type OpenType = 10 | 20 | 30 | 40; export type OpenType = 10 | 20 | 30 | 40;
/**
*
*/
export type PageDeviceFirmwareInfoInput = {
/**
* .1
*/
pageIndex?: number;
/**
* .
*/
pageSize?: number;
/**
*
*/
readonly skipCount?: number;
/**
*
* <example>
* name desc
* </example>
*/
sorting?: (string) | null;
/**
*
*/
isPage?: boolean;
ioTPlatform?: IoTPlatformTypeEnum;
/**
*
*/
firmwareVersion?: (string) | null;
/**
* Id
*/
ioTPlatformProductId?: (string) | null;
/**
*
*/
searchKeyword?: (string) | null;
};
export type PageDeviceInput = { export type PageDeviceInput = {
/** /**
* .1 * .1
@ -3759,6 +4047,65 @@ export type PageDeviceInput = {
searchKeyword?: (string) | null; searchKeyword?: (string) | null;
}; };
/**
*
*/
export type PageDeviceUpgradeRecordInput = {
/**
* .1
*/
pageIndex?: number;
/**
* .
*/
pageSize?: number;
/**
*
*/
readonly skipCount?: number;
/**
*
* <example>
* name desc
* </example>
*/
sorting?: (string) | null;
/**
*
*/
isPage?: boolean;
/**
*
*/
deviceName?: (string) | null;
/**
*
*/
deviceAddress?: (string) | null;
/**
*
*/
oldFirmwareVersion?: (string) | null;
/**
*
*/
nowFirmwareVersion?: (string) | null;
/**
*
*/
upgradeDate?: string;
upgradeSource?: DeviceUpgradeSourceTypeEnum;
/**
*
*/
searchKeyword?: (string) | null;
/**
*
*/
upgradeIdentifier?: (number) | null;
upgradeResult?: DeviceUpgradeResultTypeEnum;
};
/** /**
* *
*/ */
@ -5538,6 +5885,45 @@ export type UpdateDetailInput = {
extendedAttribute?: (string) | null; extendedAttribute?: (string) | null;
}; };
/**
*
*/
export type UpdateDeviceFirmwareInfoInput = {
ioTPlatform: IoTPlatformTypeEnum;
/**
* Id
*/
ioTPlatformProductId: string;
/**
*
*/
ioTPlatformProductName: string;
/**
*
*/
firmwareVersion: string;
/**
* Id
*/
firmwareFileId: string;
/**
*
*/
firmwareFileName: string;
/**
*
*/
firmwareHashCode: string;
/**
*
*/
firmwareLength: number;
/**
* Id
*/
id: string;
};
export type UpdateFeatureDto = { export type UpdateFeatureDto = {
name?: (string) | null; name?: (string) | null;
value?: (string) | null; value?: (string) | null;
@ -6141,6 +6527,96 @@ export type PostAggregationDeviceGetDevicePropertyValueForApiAsyncResponse = ({
export type PostAggregationDeviceGetDevicePropertyValueForApiAsyncError = unknown; export type PostAggregationDeviceGetDevicePropertyValueForApiAsyncError = unknown;
export type PostAggregationDeviceDeviceUpgradeForApiAsyncData = {
query?: {
input?: DeviceUpgradeForApiInput;
};
};
export type PostAggregationDeviceDeviceUpgradeForApiAsyncResponse = (boolean);
export type PostAggregationDeviceDeviceUpgradeForApiAsyncError = unknown;
export type PostAggregationDeviceDownloadFirmwareData = {
query?: {
input?: IdInput;
};
};
export type PostAggregationDeviceDownloadFirmwareResponse = (RemoteStreamContent);
export type PostAggregationDeviceDownloadFirmwareError = unknown;
export type GetAggregationDeviceDownloadFirmwareData = {
query?: {
input?: IdInput;
};
};
export type GetAggregationDeviceDownloadFirmwareResponse = (RemoteStreamContent);
export type GetAggregationDeviceDownloadFirmwareError = unknown;
export type PostFirmwareInfoCreateAsyncData = {
query?: {
input?: CreateDeviceFirmwareInfoInput;
};
};
export type PostFirmwareInfoCreateAsyncResponse = (DeviceFirmwareInfoDto);
export type PostFirmwareInfoCreateAsyncError = unknown;
export type PostFirmwareInfoUpdateAsyncData = {
query?: {
input?: UpdateDeviceFirmwareInfoInput;
};
};
export type PostFirmwareInfoUpdateAsyncResponse = (DeviceFirmwareInfoDto);
export type PostFirmwareInfoUpdateAsyncError = unknown;
export type PostFirmwareInfoDeleteAsyncData = {
query?: {
input?: IdInput;
};
};
export type PostFirmwareInfoDeleteAsyncResponse = (boolean);
export type PostFirmwareInfoDeleteAsyncError = unknown;
export type PostFirmwareInfoFindByIdAsyncData = {
query?: {
input?: IdInput;
};
};
export type PostFirmwareInfoFindByIdAsyncResponse = (DeviceFirmwareInfoDto);
export type PostFirmwareInfoFindByIdAsyncError = unknown;
export type PostFirmwareInfoFindByDeviceProductIdAsyncData = {
query?: {
input?: StringIdInput;
};
};
export type PostFirmwareInfoFindByDeviceProductIdAsyncResponse = (Array<DeviceFirmwareInfoDto>);
export type PostFirmwareInfoFindByDeviceProductIdAsyncError = unknown;
export type PostFirmwareInfoPageData = {
query?: {
input?: PageDeviceFirmwareInfoInput;
};
};
export type PostFirmwareInfoPageResponse = (DeviceFirmwareInfoDtoPagedResultDto);
export type PostFirmwareInfoPageError = unknown;
export type PostDeviceInfoFindByDeviceAddressData = { export type PostDeviceInfoFindByDeviceAddressData = {
query?: { query?: {
deviceAddress?: string; deviceAddress?: string;
@ -6421,6 +6897,26 @@ export type PostDeviceThingModelManagementCacheAllDeviceThingModelToRedisAsyncRe
export type PostDeviceThingModelManagementCacheAllDeviceThingModelToRedisAsyncError = unknown; export type PostDeviceThingModelManagementCacheAllDeviceThingModelToRedisAsyncError = unknown;
export type PostUpgradeRecordDeleteAsyncData = {
query?: {
input?: IdInput;
};
};
export type PostUpgradeRecordDeleteAsyncResponse = (boolean);
export type PostUpgradeRecordDeleteAsyncError = unknown;
export type PostUpgradeRecordPageData = {
query?: {
input?: PageDeviceUpgradeRecordInput;
};
};
export type PostUpgradeRecordPageResponse = (DeviceUpgradeRecordDtoPagedResultDto);
export type PostUpgradeRecordPageError = unknown;
export type PostFeaturesListData = { export type PostFeaturesListData = {
body?: GetFeatureListResultInput; body?: GetFeatureListResultInput;
}; };
@ -6446,12 +6942,17 @@ export type PostFeaturesDeleteResponse = (unknown);
export type PostFeaturesDeleteError = (RemoteServiceErrorResponse); export type PostFeaturesDeleteError = (RemoteServiceErrorResponse);
export type PostFilesPageData = { export type PostFilesPageData = {
body?: PageFileObjectInput; query?: {
/**
*
*/
input?: PageFileObjectInput;
};
}; };
export type PostFilesPageResponse = (PageFileObjectOutputPagedResultDto); export type PostFilesPageResponse = (PageFileObjectOutputPagedResultDto);
export type PostFilesPageError = (RemoteServiceErrorResponse); export type PostFilesPageError = unknown;
export type PostFilesUploadData = { export type PostFilesUploadData = {
body?: { body?: {
@ -6461,23 +6962,30 @@ export type PostFilesUploadData = {
export type PostFilesUploadResponse = (Array<FileObjectDto>); export type PostFilesUploadResponse = (Array<FileObjectDto>);
export type PostFilesUploadError = (RemoteServiceErrorResponse); export type PostFilesUploadError = unknown;
export type PostFilesDeleteData = { export type PostFilesDeleteData = {
body?: DeleteFileObjectInput; query?: {
/**
*
*/
input?: DeleteFileObjectInput;
};
}; };
export type PostFilesDeleteResponse = (unknown); export type PostFilesDeleteResponse = (unknown);
export type PostFilesDeleteError = (RemoteServiceErrorResponse); export type PostFilesDeleteError = unknown;
export type PostFilesDownloadData = { export type PostFilesDownloadData = {
body?: DownloadFileObjectInput; query?: {
input?: DownloadFileObjectInput;
};
}; };
export type PostFilesDownloadResponse = (RemoteStreamContent); export type PostFilesDownloadResponse = (RemoteStreamContent);
export type PostFilesDownloadError = (RemoteServiceErrorResponse); export type PostFilesDownloadError = unknown;
export type PostIdentitySecurityLogsPageData = { export type PostIdentitySecurityLogsPageData = {
body?: PagingIdentitySecurityLogInput; body?: PagingIdentitySecurityLogInput;

View File

@ -54,10 +54,26 @@ defineOptions({
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
//
const isSettingFromRoute = ref(false);
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
schema: querySchema.value, schema: querySchema.value,
submitOnChange: false, submitOnChange: false,
handleValuesChange: async (values, changedFields) => { handleValuesChange: async (values, changedFields) => {
//
if (isSettingFromRoute.value) {
return;
}
// ID
if (changedFields.includes('ioTPlatform')) {
if (gridApi?.formApi) {
await gridApi.formApi.setFieldValue('ioTPlatformProductId', undefined);
}
}
// //
if (changedFields.includes('ioTPlatformProductId')) { if (changedFields.includes('ioTPlatformProductId')) {
// //
@ -203,66 +219,89 @@ const editRow: Record<string, any> = ref({});
watch( watch(
() => route.query, () => route.query,
async (newQuery) => { async (newQuery) => {
if (newQuery.ioTPlatform || newQuery.ioTPlatformDeviceOpenInfo) { if (newQuery.ioTPlatform || newQuery.ioTPlatformProductId) {
//
const waitForFormApi = async (maxRetries = 10, delay = 100) => {
for (let i = 0; i < maxRetries; i++) {
if (gridApi?.formApi) {
return true;
}
await new Promise((resolve) => setTimeout(resolve, delay));
}
return false;
};
// //
setTimeout(async () => { setTimeout(async () => {
try { try {
// handleValuesChange
isSettingFromRoute.value = true;
// API
const formApiReady = await waitForFormApi();
if (!formApiReady) {
console.warn('表单API初始化超时无法设置筛选条件');
isSettingFromRoute.value = false;
return;
}
// //
const filterValues: any = {}; const filterValues: any = {};
if (newQuery.ioTPlatform) { if (newQuery.ioTPlatform) {
filterValues.ioTPlatform = newQuery.ioTPlatform; filterValues.ioTPlatform = String(newQuery.ioTPlatform);
} }
if (newQuery.ioTPlatformDeviceOpenInfo) { if (newQuery.ioTPlatformProductId) {
// ID // ID
filterValues.ioTPlatformProductId = filterValues.ioTPlatformProductId = String(
newQuery.ioTPlatformDeviceOpenInfo; newQuery.ioTPlatformProductId,
// );
filterValues.ioTPlatformDeviceOpenInfo =
newQuery.ioTPlatformDeviceOpenInfo;
} }
// //
if (gridApi?.formApi) { if (filterValues.ioTPlatform) {
await gridApi.formApi.setValues(filterValues); await gridApi.formApi.setFieldValue(
// 'ioTPlatform',
filterValues.ioTPlatform,
);
await nextTick(); await nextTick();
// ApiSelect
await new Promise((resolve) => setTimeout(resolve, 600));
}
// ID
if (filterValues.ioTPlatformProductId) {
await gridApi.formApi.setFieldValue(
'ioTPlatformProductId',
filterValues.ioTPlatformProductId,
);
await nextTick();
//
await new Promise((resolve) => setTimeout(resolve, 600));
}
//
await nextTick();
await new Promise((resolve) => setTimeout(resolve, 200));
//
isSettingFromRoute.value = false;
//
if (gridApi?.reload) {
gridApi.reload(); gridApi.reload();
} }
} catch (error) { } catch (error) {
console.error('设置表单筛选条件时出错:', error); console.error('设置表单筛选条件时出错:', error);
isSettingFromRoute.value = false;
} }
}, 200); // ApiSelect }, 500); //
} }
}, },
{ immediate: true }, { immediate: true },
); );
// ioTPlatformDeviceOpenInfo
watch(
() => gridApi?.formApi?.getValues,
(formValues) => {
if (formValues) {
const { ioTPlatformProductId } = formValues;
// ioTPlatformDeviceOpenInfo
if (ioTPlatformProductId) {
console.log('检测到产品选择变化:', ioTPlatformProductId);
gridApi?.formApi?.setFieldValue(
'ioTPlatformDeviceOpenInfo',
ioTPlatformProductId,
);
console.log('已设置ioTPlatformDeviceOpenInfo为:', ioTPlatformProductId);
} else {
console.log('清空产品选择');
gridApi?.formApi?.setFieldValue('ioTPlatformDeviceOpenInfo', '');
}
}
},
{ deep: true },
);
const cacheRefreshLoading = ref(false); const cacheRefreshLoading = ref(false);
const pageLoading = ref(false); const pageLoading = ref(false);
const loadingTip = ref('缓存刷新中...'); const loadingTip = ref('缓存刷新中...');
@ -1687,25 +1726,15 @@ const toolbarActions = computed(() => [
</div> </div>
<div v-else> <div v-else>
<div style="margin-bottom: 16px"> <div style="margin-bottom: 16px">
<Input <Input v-model:value="filterKeyword" placeholder="请输入标准物模型属性名称或平台物模型属性标识符进行筛选" allow-clear
v-model:value="filterKeyword" style="width: 100%">
placeholder="请输入标准物模型属性名称或平台物模型属性标识符进行筛选"
allow-clear
style="width: 100%"
>
<template #prefix> <template #prefix>
<Icon icon="ant-design:search-outlined" /> <Icon icon="ant-design:search-outlined" />
</template> </template>
</Input> </Input>
</div> </div>
<Table <Table :columns="commandTableColumns" :data-source="filteredThingModelProperties" :pagination="false"
:columns="commandTableColumns" :scroll="{ x: 1000, y: 500 }" row-key="id" size="small" />
:data-source="filteredThingModelProperties"
:pagination="false"
:scroll="{ x: 1000, y: 500 }"
row-key="id"
size="small"
/>
</div> </div>
</CommandModal> </CommandModal>
<UpgradeModal title="设备升级" class="w-[600px]"> <UpgradeModal title="设备升级" class="w-[600px]">

View File

@ -316,7 +316,7 @@ function onDeviceManagement(record: any) {
path: '/devicemanagement/deviceinfo', path: '/devicemanagement/deviceinfo',
query: { query: {
ioTPlatform: '2', // OneNET2 ioTPlatform: '2', // OneNET2
ioTPlatformDeviceOpenInfo: record.ioTPlatformProductId, // ID ioTPlatformProductId: record.ioTPlatformProductId, // ID
productName: record.productName, productName: record.productName,
}, },
}); });
@ -339,12 +339,15 @@ function onThingModelManagement(record: any) {
// //
async function onThingModelUpdate(record: any) { async function onThingModelUpdate(record: any) {
try { try {
const resp = await postAggregationIoTplatformUpdateIoTplatformProductPropertyInfoAsync({ const resp =
await postAggregationIoTplatformUpdateIoTplatformProductPropertyInfoAsync(
{
body: { body: {
ioTPlatformType: 2, // OneNET 2 ioTPlatformType: 2, // OneNET 2
ioTPlatformProductId: record.ioTPlatformProductId, ioTPlatformProductId: record.ioTPlatformProductId,
}, },
}); },
);
if (resp.data) { if (resp.data) {
Message.success('物模型更新成功'); Message.success('物模型更新成功');
gridApi.reload(); gridApi.reload();
@ -414,10 +417,12 @@ async function onThingModelUpdate(record: any) {
type: 'link', type: 'link',
size: 'small', size: 'small',
onClick: onThingModelUpdate.bind(null, row), onClick: onThingModelUpdate.bind(null, row),
} },
]" :drop-down-actions="[ ]" :drop-down-actions="[
{ {
label: row.isEnabled ? $t('common.disabled') : $t('common.enabled'), label: row.isEnabled
? $t('common.disabled')
: $t('common.enabled'),
icon: 'ant-design:edit-filled', icon: 'ant-design:edit-filled',
type: 'primary', type: 'primary',
danger: row.isEnabled, danger: row.isEnabled,