diff --git a/apps/web-antd/src/api/iot/rule/scene/index.ts b/apps/web-antd/src/api/iot/rule/scene/index.ts index 5fc3224e1..59c8255a7 100644 --- a/apps/web-antd/src/api/iot/rule/scene/index.ts +++ b/apps/web-antd/src/api/iot/rule/scene/index.ts @@ -101,6 +101,7 @@ export interface Action { identifier?: string; value?: any; alertConfigId?: number; + params?: string; } /** 查询场景联动规则分页 */ 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 09ca905c7..379867edb 100644 --- a/apps/web-antd/src/views/iot/alert/config/data.ts +++ b/apps/web-antd/src/views/iot/alert/config/data.ts @@ -63,7 +63,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '关联场景联动规则', component: 'ApiSelect', componentProps: { - api: getSimpleRuleSceneList, + api: () => getSimpleRuleSceneList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -76,7 +76,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '接收的用户', component: 'ApiSelect', componentProps: { - api: getSimpleUserList, + api: () => getSimpleUserList(), labelField: 'nickname', valueField: 'id', mode: 'multiple', 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 10ebb12f3..70b13b267 100644 --- a/apps/web-antd/src/views/iot/alert/record/data.ts +++ b/apps/web-antd/src/views/iot/alert/record/data.ts @@ -17,7 +17,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '告警配置', component: 'ApiSelect', componentProps: { - api: getSimpleAlertConfigList, + api: () => getSimpleAlertConfigList(), labelField: 'name', valueField: 'id', placeholder: '请选择告警配置', @@ -40,7 +40,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -53,7 +53,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '设备', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceList, + api: () => getSimpleDeviceList(), labelField: 'deviceName', valueField: 'id', placeholder: '请选择设备', diff --git a/apps/web-antd/src/views/iot/alert/record/index.vue b/apps/web-antd/src/views/iot/alert/record/index.vue index 560aae39a..64ba6cfac 100644 --- a/apps/web-antd/src/views/iot/alert/record/index.vue +++ b/apps/web-antd/src/views/iot/alert/record/index.vue @@ -101,7 +101,7 @@ async function handleProcess(row: AlertRecord) { try { await processAlertRecord(row.id as number, processRemark); message.success('处理成功'); - onRefresh(); + handleRefresh(); } catch (error) { console.error('处理失败:', error); throw error; 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 86996ceae..a2fef45e8 100644 --- a/apps/web-antd/src/views/iot/device/device/data.ts +++ b/apps/web-antd/src/views/iot/device/device/data.ts @@ -5,6 +5,7 @@ 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'; import { DeviceTypeEnum, @@ -27,7 +28,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -55,12 +56,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '网关设备', component: 'ApiSelect', componentProps: { - api: async () => { - const { getSimpleDeviceList } = await import( - '#/api/iot/device/device' - ); - return getSimpleDeviceList(DeviceTypeEnum.GATEWAY); - }, + api: () => getSimpleDeviceList(DeviceTypeEnum.GATEWAY), labelField: 'nickname', valueField: 'id', placeholder: '子设备可选择父设备', @@ -93,7 +89,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '设备分组', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceGroupList, + api: () => getSimpleDeviceGroupList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -160,7 +156,7 @@ export function useGroupFormSchema(): VbenFormSchema[] { label: '设备分组', component: 'ApiSelect', componentProps: { - api: getSimpleDeviceGroupList, + api: () => getSimpleDeviceGroupList(), labelField: 'name', valueField: 'id', mode: 'multiple', @@ -203,7 +199,7 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '产品', component: 'ApiSelect', componentProps: { - api: getSimpleProductList, + api: () => getSimpleProductList(), labelField: 'name', valueField: 'id', placeholder: '请选择产品', @@ -253,7 +249,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/device/index.vue b/apps/web-antd/src/views/iot/device/device/index.vue index 06e34ac5e..f83a7c14a 100644 --- a/apps/web-antd/src/views/iot/device/device/index.vue +++ b/apps/web-antd/src/views/iot/device/device/index.vue @@ -32,7 +32,6 @@ import { getSimpleProductList } from '#/api/iot/product/product'; import { $t } from '#/locales'; import { useGridColumns } from './data'; -// @ts-ignore import DeviceCardView from './modules/DeviceCardView.vue'; import DeviceForm from './modules/DeviceForm.vue'; import DeviceGroupForm from './modules/DeviceGroupForm.vue'; diff --git a/apps/web-antd/src/views/iot/device/device/modules/DeviceForm.vue b/apps/web-antd/src/views/iot/device/device/modules/DeviceForm.vue index 32875e43f..39fe16a99 100644 --- a/apps/web-antd/src/views/iot/device/device/modules/DeviceForm.vue +++ b/apps/web-antd/src/views/iot/device/device/modules/DeviceForm.vue @@ -1,15 +1,13 @@