From 17d5d1b889290761875fc61519308ddba5420522 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 5 Jan 2026 20:45:39 +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=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= 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 | 2 ++ .../iot/device/device/detail/modules/sub-device.vue | 13 +++---------- apps/web-antd/src/views/iot/device/device/index.vue | 9 ++------- .../src/views/iot/device/device/modules/form.vue | 2 ++ 4 files changed, 9 insertions(+), 17 deletions(-) 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 ce3456252..5e7581274 100644 --- a/apps/web-antd/src/api/iot/device/device/index.ts +++ b/apps/web-antd/src/api/iot/device/device/index.ts @@ -4,6 +4,7 @@ import { requestClient } from '#/api/request'; export namespace IotDeviceApi { /** 设备新增/修改 Request VO */ + // TODO @haohao:可以降低一些 VO 哈:DeviceSaveReqVO、DeviceRespVO 合并成 Device 就好,类似别的模块 export interface DeviceSaveReqVO { id?: number; // 设备编号 deviceName: string; // 设备名称 @@ -26,6 +27,7 @@ export namespace IotDeviceApi { } /** 设备分页 Request VO */ + // TODO @haohao:可以不用 DevicePageReqVO,直接 PageParam 即可,简洁一点。这里的强类型,收益不大; export interface DevicePageReqVO extends PageParam { deviceName?: string; // 设备名称 nickname?: string; // 备注名称 diff --git a/apps/web-antd/src/views/iot/device/device/detail/modules/sub-device.vue b/apps/web-antd/src/views/iot/device/device/detail/modules/sub-device.vue index a25235a23..1d0f7c0ab 100644 --- a/apps/web-antd/src/views/iot/device/device/detail/modules/sub-device.vue +++ b/apps/web-antd/src/views/iot/device/device/detail/modules/sub-device.vue @@ -24,16 +24,12 @@ interface Props { const props = defineProps(); const router = useRouter(); -/** 产品列表 */ -const products = ref([]); - -/** 查询参数 */ +const products = ref([]); // 产品列表 const queryParams = reactive({ deviceName: '', status: undefined as number | undefined, -}); +}); // 查询参数 -/** Grid 列定义 */ function useGridColumns(): VxeTableGridOptions['columns'] { return [ { @@ -76,7 +72,6 @@ function useGridColumns(): VxeTableGridOptions['columns'] { ]; } -/** 创建 Grid 实例 */ const [Grid, gridApi] = useVbenVxeGrid({ gridOptions: { columns: useGridColumns(), @@ -164,6 +159,7 @@ onMounted(async () => {