From 6bf9acbfb2440713ca9bf2c9b7afea75c741675e Mon Sep 17 00:00:00 2001 From: haohao <1036606149@qq.com> Date: Mon, 22 Dec 2025 17:30:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E3=80=90antd=E3=80=91=E3=80=90iot?= =?UTF-8?q?=E3=80=91=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/iot/device/device/data.ts | 12 +- .../views/iot/device/device/detail/index.vue | 8 +- .../device/device/detail/modules/config.vue | 12 +- .../device/device/detail/modules/header.vue | 2 +- .../iot/device/device/detail/modules/info.vue | 20 +- .../device/device/detail/modules/message.vue | 4 +- .../device/detail/modules/simulator.vue | 56 ++--- .../device/detail/modules/sub-device.vue | 2 +- .../detail/modules/thing-model-event.vue | 6 +- .../modules/thing-model-property-history.vue | 22 +- .../detail/modules/thing-model-property.vue | 42 ++-- .../detail/modules/thing-model-service.vue | 6 +- .../src/views/iot/device/device/index.vue | 34 +-- .../iot/device/device/modules/card-view.vue | 200 ++---------------- .../views/iot/device/device/modules/form.vue | 3 - .../iot/device/device/modules/group-form.vue | 2 +- .../iot/device/device/modules/import-form.vue | 2 +- .../src/views/iot/device/group/index.vue | 2 +- .../src/views/iot/product/category/data.ts | 4 +- .../iot/product/category/modules/form.vue | 7 - .../src/views/iot/product/product/data.ts | 155 -------------- .../product/product/detail/modules/header.vue | 2 +- .../product/product/detail/modules/info.vue | 4 +- .../src/views/iot/product/product/index.vue | 36 ++-- .../iot/product/product/modules/card-view.vue | 44 ++-- .../iot/product/product/modules/form.vue | 20 +- 26 files changed, 178 insertions(+), 529 deletions(-) diff --git a/apps/web-antd/src/views/iot/device/device/data.ts b/apps/web-antd/src/views/iot/device/device/data.ts index 625eecac4..9360c8cdd 100644 --- a/apps/web-antd/src/views/iot/device/device/data.ts +++ b/apps/web-antd/src/views/iot/device/device/data.ts @@ -1,7 +1,7 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import { DeviceTypeEnum, DICT_TYPE } from '@vben/constants'; +import { DeviceTypeEnum, DICT_TYPE, LocationTypeEnum } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; import { z } from '#/adapter/form'; @@ -68,7 +68,7 @@ export function useFormSchema(): VbenFormSchema[] { }, dependencies: { triggerFields: ['deviceType'], - show: (values) => values.deviceType === 1, // GATEWAY_SUB + show: (values) => values.deviceType === DeviceTypeEnum.GATEWAY_SUB, }, }, { @@ -134,20 +134,20 @@ export function useFormSchema(): VbenFormSchema[] { }, dependencies: { triggerFields: ['locationType'], - show: (values) => values.locationType === 3, // MANUAL + show: (values) => values.locationType === LocationTypeEnum.MANUAL, }, }, { fieldName: 'latitude', - label: '设备维度', + label: '设备纬度', component: 'InputNumber', componentProps: { - placeholder: '请输入设备维度', + placeholder: '请输入设备纬度', class: 'w-full', }, dependencies: { triggerFields: ['locationType'], - show: (values) => values.locationType === 3, // MANUAL + show: (values) => values.locationType === LocationTypeEnum.MANUAL, }, }, ]; diff --git a/apps/web-antd/src/views/iot/device/device/detail/index.vue b/apps/web-antd/src/views/iot/device/device/detail/index.vue index adc7ea4b1..4b549a363 100644 --- a/apps/web-antd/src/views/iot/device/device/detail/index.vue +++ b/apps/web-antd/src/views/iot/device/device/detail/index.vue @@ -1,4 +1,4 @@ -