review:【antd】【iot】设备管理(暂未彻底 review,等 product 搞完)

This commit is contained in:
YunaiV
2025-11-21 10:53:54 +08:00
parent 77afbe4d64
commit 543e48504b
5 changed files with 11 additions and 4 deletions

View File

@@ -3,7 +3,8 @@ import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace IotDeviceApi {
/** IoT 设备 VO */
// TODO @haohao需要跟后端对齐必要的 ReqVO、RespVO
/** 设备 */
export interface Device {
id?: number; // 设备 ID主键自增
deviceName: string; // 设备名称
@@ -48,7 +49,7 @@ export namespace IotDeviceApi {
dataSpecsList: any[]; // 数据定义列表
}
/** IoT 设备属性 VO */
/** 设备属性 VO */
export interface DeviceProperty {
identifier: string; // 属性标识符
value: string; // 最新值
@@ -62,7 +63,7 @@ export namespace IotDeviceApi {
password: string; // 密码
}
/** IoT 设备发送消息 Request VO */
/** 设备发送消息 Request VO */
export interface DeviceMessageSendReq {
deviceId: number; // 设备编号
method: string; // 请求方法
@@ -77,6 +78,7 @@ export namespace IotDeviceApi {
}
/** IoT 设备状态枚举 */
// TODO @haohaopackages/constants/src/biz-iot-enum.ts 枚举;
export enum DeviceStateEnum {
INACTIVE = 0, // 未激活
OFFLINE = 2, // 离线

View File

@@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace IotProductApi {
/** IoT 产品 VO */
/** 产品 */
export interface Product {
id?: number; // 产品编号
name: string; // 产品名称
@@ -27,6 +27,8 @@ export namespace IotProductApi {
}
}
// TODO @haohaopackages/constants/src/biz-iot-enum.ts 枚举;
/** IOT 产品设备类型枚举类 */
export enum DeviceTypeEnum {
DEVICE = 0, // 直连设备

View File

@@ -48,6 +48,7 @@ const viewMode = ref<'card' | 'list'>('card');
const cardViewRef = ref();
// Modal instances
// TODO @haohao这个界面等 product 改完,在一起看看怎么弄更好。
const [DeviceFormModal, deviceFormModalApi] = useVbenModal({
connectedComponent: DeviceForm,
destroyOnClose: true,

View File

@@ -0,0 +1 @@
// TODO @haohao枚举可以放到这里

View File

@@ -2,6 +2,7 @@ export * from './biz-ai-enum';
export * from './biz-bpm-enum';
export * from './biz-erp-enum';
export * from './biz-infra-enum';
export * from './biz-iot-enum';
export * from './biz-mall-enum';
export * from './biz-mp-enum';
export * from './biz-pay-enum';