refactor:【antd】【iot】将物联网设备和产品枚举整合为常量,优化设备导入功能,简化设备管理UI组件

This commit is contained in:
haohao
2025-12-06 17:54:46 +08:00
parent cc375100cb
commit 2b270caf30
27 changed files with 1027 additions and 1513 deletions

View File

@@ -77,14 +77,6 @@ export namespace IotDeviceApi {
}
}
/** IoT 设备状态枚举 */
// TODO @haohaopackages/constants/src/biz-iot-enum.ts 枚举;
export enum DeviceStateEnum {
INACTIVE = 0, // 未激活
OFFLINE = 2, // 离线
ONLINE = 1, // 在线
}
/** 查询设备分页 */
export function getDevicePage(params: PageParam) {
return requestClient.get<PageResult<IotDeviceApi.Device>>(
@@ -154,6 +146,14 @@ export function importDeviceTemplate() {
return requestClient.download('/iot/device/get-import-template');
}
/** 导入设备 */
export function importDevice(file: File, updateSupport: boolean) {
return requestClient.upload('/iot/device/import', {
file,
updateSupport,
});
}
/** 获取设备属性最新数据 */
export function getLatestDeviceProperties(params: any) {
return requestClient.get<IotDeviceApi.DevicePropertyDetail[]>(

View File

@@ -27,33 +27,6 @@ export namespace IotProductApi {
}
}
// TODO @haohaopackages/constants/src/biz-iot-enum.ts 枚举;
/** IOT 产品设备类型枚举类 */
export enum DeviceTypeEnum {
DEVICE = 0, // 直连设备
GATEWAY = 2, // 网关设备
GATEWAY_SUB = 1, // 网关子设备
}
/** IOT 产品定位类型枚举类 */
export enum LocationTypeEnum {
IP = 1, // IP 定位
MANUAL = 3, // 手动定位
MODULE = 2, // 设备定位
}
/** IOT 数据格式(编解码器类型)枚举类 */
export enum CodecTypeEnum {
ALINK = 'Alink', // 阿里云 Alink 协议
}
/** IOT 产品状态枚举类 */
export enum ProductStatusEnum {
UNPUBLISHED = 0, // 开发中
PUBLISHED = 1, // 已发布
}
/** 查询产品分页 */
export function getProductPage(params: PageParam) {
return requestClient.get<PageResult<IotProductApi.Product>>(