From 60d60f69ce72e7c2c203d0d7ab4b8bdbcf801082 Mon Sep 17 00:00:00 2001
From: Administrator <425053404@qq.com>
Date: Fri, 24 Oct 2025 13:41:07 +0800
Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8Diot=E6=A8=A1=E5=9D=97?=
=?UTF-8?q?=E5=AD=97=E5=85=B8=E5=BC=95=E7=94=A8=E4=B8=8D=E8=A7=84=E8=8C=83?=
=?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83?=
=?UTF-8?q?=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA=EF=BC=8C=E7=94=9F=E4=BA=A7?=
=?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=83=A8=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=20=E5=8E=9F=E5=9B=A0=EF=BC=9A=20iot=20=E6=A8=A1=E5=9D=97=20?=
=?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E6=98=AF=20@vben/hooks=20=E5=AF=BC?=
=?UTF-8?q?=E5=87=BA=E7=9A=84=20getDictOptions=EF=BC=88=E6=97=A0=E7=BC=93?=
=?UTF-8?q?=E5=AD=98=EF=BC=89=20elder=20=E6=A8=A1=E5=9D=97=20=E4=BD=BF?=
=?UTF-8?q?=E7=94=A8=E7=9A=84=E6=98=AF=20#/utils=20=E5=AF=BC=E5=87=BA?=
=?UTF-8?q?=E7=9A=84=20getDictOptions=EF=BC=88=E6=9C=89=E7=BC=93=E5=AD=98?=
=?UTF-8?q?=E6=9C=BA=E5=88=B6=EF=BC=89=202.=E4=BF=AE=E6=94=B9ota=E4=BB=BB?=
=?UTF-8?q?=E5=8A=A1=E8=AE=B0=E5=BD=95=E5=92=8C=E8=AE=BE=E5=A4=87=E5=8D=87?=
=?UTF-8?q?=E7=BA=A7=E8=AE=B0=E5=BD=95=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/views/iot/alert/config/data.ts | 14 +++-----
.../src/views/iot/alert/record/data.ts | 16 +++------
.../src/views/iot/device/device/data.ts | 14 ++++----
.../src/views/iot/device/group/data.ts | 2 +-
apps/web-antd/src/views/iot/ota/data.ts | 9 ++---
.../src/views/iot/ota/firmware/data.ts | 9 ++---
.../src/views/iot/ota/firmware/index.vue | 36 ++++++++-----------
.../iot/ota/modules/task/OtaTaskList.vue | 8 ++---
.../src/views/iot/product/category/data.ts | 2 +-
.../src/views/iot/product/product/data.ts | 8 ++---
apps/web-antd/src/views/iot/rule/data/data.ts | 12 ++-----
.../src/views/iot/rule/data/rule/data.ts | 10 ++----
.../src/views/iot/rule/data/sink/data.ts | 10 ++----
.../web-antd/src/views/iot/rule/scene/data.ts | 10 ++----
.../iot/rule/scene/form/RuleSceneForm.vue | 4 +--
.../web-antd/src/views/iot/thingmodel/data.ts | 3 +-
.../iot/thingmodel/modules/ThingModelForm.vue | 4 +--
17 files changed, 58 insertions(+), 113 deletions(-)
diff --git a/apps/web-antd/src/views/iot/alert/config/data.ts b/apps/web-antd/src/views/iot/alert/config/data.ts
index c45a95a74..73dc9f7b1 100644
--- a/apps/web-antd/src/views/iot/alert/config/data.ts
+++ b/apps/web-antd/src/views/iot/alert/config/data.ts
@@ -1,12 +1,9 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import { DICT_TYPE } from '@vben/constants';
-import { getDictOptions } from '@vben/hooks';
-
import { getSimpleRuleSceneList } from '#/api/iot/rule/scene';
import { getSimpleUserList } from '#/api/system/user';
-import { getRangePickerDefaultProps } from '#/utils';
+import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
/** 新增/修改告警配置的表单 */
export function useFormSchema(): VbenFormSchema[] {
@@ -63,7 +60,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '关联场景联动规则',
component: 'ApiSelect',
componentProps: {
- api: getSimpleRuleSceneList,
+ api: () => getSimpleRuleSceneList(),
labelField: 'name',
valueField: 'id',
mode: 'multiple',
@@ -76,7 +73,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '接收的用户',
component: 'ApiSelect',
componentProps: {
- api: getSimpleUserList,
+ api: () => getSimpleUserList(),
labelField: 'nickname',
valueField: 'id',
mode: 'multiple',
@@ -124,10 +121,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'createTime',
label: '创建时间',
component: 'RangePicker',
- componentProps: {
- ...getRangePickerDefaultProps(),
- allowClear: true,
- },
+ componentProps: getRangePickerDefaultProps(),
},
];
}
diff --git a/apps/web-antd/src/views/iot/alert/record/data.ts b/apps/web-antd/src/views/iot/alert/record/data.ts
index 2c5ef9a84..9f4293dae 100644
--- a/apps/web-antd/src/views/iot/alert/record/data.ts
+++ b/apps/web-antd/src/views/iot/alert/record/data.ts
@@ -1,13 +1,10 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import { DICT_TYPE } from '@vben/constants';
-import { getDictOptions } from '@vben/hooks';
-
import { getSimpleAlertConfigList } from '#/api/iot/alert/config';
import { getSimpleDeviceList } from '#/api/iot/device/device';
import { getSimpleProductList } from '#/api/iot/product/product';
-import { getRangePickerDefaultProps } from '#/utils';
+import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
@@ -17,7 +14,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '告警配置',
component: 'ApiSelect',
componentProps: {
- api: getSimpleAlertConfigList,
+ api: () => getSimpleAlertConfigList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择告警配置',
@@ -40,7 +37,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '产品',
component: 'ApiSelect',
componentProps: {
- api: getSimpleProductList,
+ api: () => getSimpleProductList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择产品',
@@ -53,7 +50,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '设备',
component: 'ApiSelect',
componentProps: {
- api: getSimpleDeviceList,
+ api: () => getSimpleDeviceList(),
labelField: 'deviceName',
valueField: 'id',
placeholder: '请选择设备',
@@ -75,10 +72,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'createTime',
label: '创建时间',
component: 'RangePicker',
- componentProps: {
- ...getRangePickerDefaultProps(),
- allowClear: true,
- },
+ componentProps: getRangePickerDefaultProps(),
},
];
}
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 424f0ef92..d26e315d5 100644
--- a/apps/web-antd/src/views/iot/device/device/data.ts
+++ b/apps/web-antd/src/views/iot/device/device/data.ts
@@ -1,9 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import { DICT_TYPE } from '@vben/constants';
-import { getDictOptions } from '@vben/hooks';
-
import { z } from '#/adapter/form';
import { getSimpleDeviceList } from '#/api/iot/device/device';
import { getSimpleDeviceGroupList } from '#/api/iot/device/group';
@@ -11,6 +8,7 @@ import {
DeviceTypeEnum,
getSimpleProductList,
} from '#/api/iot/product/product';
+import { DICT_TYPE, getDictOptions } from '#/utils';
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
@@ -28,7 +26,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '产品',
component: 'ApiSelect',
componentProps: {
- api: getSimpleProductList,
+ api: () => getSimpleProductList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择产品',
@@ -89,7 +87,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '设备分组',
component: 'ApiSelect',
componentProps: {
- api: getSimpleDeviceGroupList,
+ api: () => getSimpleDeviceGroupList(),
labelField: 'name',
valueField: 'id',
mode: 'multiple',
@@ -156,7 +154,7 @@ export function useGroupFormSchema(): VbenFormSchema[] {
label: '设备分组',
component: 'ApiSelect',
componentProps: {
- api: getSimpleDeviceGroupList,
+ api: () => getSimpleDeviceGroupList(),
labelField: 'name',
valueField: 'id',
mode: 'multiple',
@@ -199,7 +197,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '产品',
component: 'ApiSelect',
componentProps: {
- api: getSimpleProductList,
+ api: () => getSimpleProductList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择产品',
@@ -249,7 +247,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '设备分组',
component: 'ApiSelect',
componentProps: {
- api: getSimpleDeviceGroupList,
+ api: () => getSimpleDeviceGroupList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择设备分组',
diff --git a/apps/web-antd/src/views/iot/device/group/data.ts b/apps/web-antd/src/views/iot/device/group/data.ts
index 0bc313e52..3ea5a12da 100644
--- a/apps/web-antd/src/views/iot/device/group/data.ts
+++ b/apps/web-antd/src/views/iot/device/group/data.ts
@@ -34,7 +34,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '父级分组',
component: 'ApiTreeSelect',
componentProps: {
- api: getSimpleDeviceGroupList,
+ api: () => getSimpleDeviceGroupList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择父级分组',
diff --git a/apps/web-antd/src/views/iot/ota/data.ts b/apps/web-antd/src/views/iot/ota/data.ts
index ff9ba6ee1..287cb00bc 100644
--- a/apps/web-antd/src/views/iot/ota/data.ts
+++ b/apps/web-antd/src/views/iot/ota/data.ts
@@ -29,7 +29,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '所属产品',
component: 'ApiSelect',
componentProps: {
- api: getSimpleProductList,
+ api: () => getSimpleProductList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择产品',
@@ -85,7 +85,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '产品',
component: 'ApiSelect',
componentProps: {
- api: getSimpleProductList,
+ api: () => getSimpleProductList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择产品',
@@ -96,10 +96,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'createTime',
label: '创建时间',
component: 'RangePicker',
- componentProps: {
- ...getRangePickerDefaultProps(),
- allowClear: true,
- },
+ componentProps: getRangePickerDefaultProps(),
},
];
}
diff --git a/apps/web-antd/src/views/iot/ota/firmware/data.ts b/apps/web-antd/src/views/iot/ota/firmware/data.ts
index 7b684dba9..de4195809 100644
--- a/apps/web-antd/src/views/iot/ota/firmware/data.ts
+++ b/apps/web-antd/src/views/iot/ota/firmware/data.ts
@@ -29,7 +29,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: '所属产品',
component: 'ApiSelect',
componentProps: {
- api: getSimpleProductList,
+ api: () => getSimpleProductList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择产品',
@@ -86,7 +86,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '产品',
component: 'ApiSelect',
componentProps: {
- api: getSimpleProductList,
+ api: () => getSimpleProductList(),
labelField: 'name',
valueField: 'id',
placeholder: '请选择产品',
@@ -97,10 +97,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'createTime',
label: '创建时间',
component: 'RangePicker',
- componentProps: {
- ...getRangePickerDefaultProps(),
- allowClear: true,
- },
+ componentProps: getRangePickerDefaultProps(),
},
];
}
diff --git a/apps/web-antd/src/views/iot/ota/firmware/index.vue b/apps/web-antd/src/views/iot/ota/firmware/index.vue
index e0f3fb906..cfbdc2b93 100644
--- a/apps/web-antd/src/views/iot/ota/firmware/index.vue
+++ b/apps/web-antd/src/views/iot/ota/firmware/index.vue
@@ -2,10 +2,9 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { IoTOtaFirmwareApi } from '#/api/iot/ota/firmware';
-import { useRouter } from 'vue-router';
-
import { Page, useVbenModal } from '@vben/common-ui';
import { IconifyIcon } from '@vben/icons';
+import { useRouter } from 'vue-router';
import { message } from 'ant-design-vue';
@@ -40,6 +39,7 @@ function handleEdit(row: IoTOtaFirmwareApi.Firmware) {
formModalApi.setData({ type: 'update', id: row.id }).open();
}
+
/** 删除固件 */
async function handleDelete(row: IoTOtaFirmwareApi.Firmware) {
const hideLoading = message.loading({
@@ -117,25 +117,19 @@ const [Grid, gridApi] = useVbenVxeGrid({
-