From 543e48504bd97e07cc44019e7d61f8fd5e61dc67 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 21 Nov 2025 10:53:54 +0800 Subject: [PATCH] =?UTF-8?q?review=EF=BC=9A=E3=80=90antd=E3=80=91=E3=80=90i?= =?UTF-8?q?ot=E3=80=91=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=EF=BC=88?= =?UTF-8?q?=E6=9A=82=E6=9C=AA=E5=BD=BB=E5=BA=95=20review=EF=BC=8C=E7=AD=89?= =?UTF-8?q?=20product=20=E6=90=9E=E5=AE=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/iot/device/device/index.ts | 8 +++++--- apps/web-antd/src/api/iot/product/product/index.ts | 4 +++- apps/web-antd/src/views/iot/device/device/index.vue | 1 + packages/constants/src/biz-iot-enum.ts | 1 + packages/constants/src/index.ts | 1 + 5 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 packages/constants/src/biz-iot-enum.ts diff --git a/apps/web-antd/src/api/iot/device/device/index.ts b/apps/web-antd/src/api/iot/device/device/index.ts index 650fe0875..7bd59886f 100644 --- a/apps/web-antd/src/api/iot/device/device/index.ts +++ b/apps/web-antd/src/api/iot/device/device/index.ts @@ -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 @haohao:packages/constants/src/biz-iot-enum.ts 枚举; export enum DeviceStateEnum { INACTIVE = 0, // 未激活 OFFLINE = 2, // 离线 diff --git a/apps/web-antd/src/api/iot/product/product/index.ts b/apps/web-antd/src/api/iot/product/product/index.ts index 71bc3ade3..28b2f7b2e 100644 --- a/apps/web-antd/src/api/iot/product/product/index.ts +++ b/apps/web-antd/src/api/iot/product/product/index.ts @@ -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 @haohao:packages/constants/src/biz-iot-enum.ts 枚举; + /** IOT 产品设备类型枚举类 */ export enum DeviceTypeEnum { DEVICE = 0, // 直连设备 diff --git a/apps/web-antd/src/views/iot/device/device/index.vue b/apps/web-antd/src/views/iot/device/device/index.vue index 659f6b98d..83e79c0a3 100644 --- a/apps/web-antd/src/views/iot/device/device/index.vue +++ b/apps/web-antd/src/views/iot/device/device/index.vue @@ -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, diff --git a/packages/constants/src/biz-iot-enum.ts b/packages/constants/src/biz-iot-enum.ts new file mode 100644 index 000000000..a43d9c6b0 --- /dev/null +++ b/packages/constants/src/biz-iot-enum.ts @@ -0,0 +1 @@ +// TODO @haohao:枚举可以放到这里; \ No newline at end of file diff --git a/packages/constants/src/index.ts b/packages/constants/src/index.ts index 0514c480c..311c86d65 100644 --- a/packages/constants/src/index.ts +++ b/packages/constants/src/index.ts @@ -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';