From 88515705dcb6acf0662eba35000f069fd61b4b3c Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 18 May 2026 12:36:58 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=88iot=EF=BC=89=EF=BC=9A=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20alert=20=E7=9A=84=E4=BB=A3=E7=A0=81=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/iot/alert/config/data.ts | 15 +++++++++-- .../src/views/iot/alert/config/index.vue | 27 ++++++------------- .../{alert-config-form.vue => form.vue} | 19 ++++--------- .../src/views/iot/alert/record/data.ts | 5 +++- .../src/views/iot/alert/record/index.vue | 23 ++++++---------- 5 files changed, 38 insertions(+), 51 deletions(-) rename apps/web-antd/src/views/iot/alert/modules/{alert-config-form.vue => form.vue} (74%) 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..87ae86c1b 100644 --- a/apps/web-antd/src/views/iot/alert/config/data.ts +++ b/apps/web-antd/src/views/iot/alert/config/data.ts @@ -9,6 +9,7 @@ import { getSimpleUserList } from '#/api/system/user'; import { getRangePickerDefaultProps } from '#/utils'; /** 新增/修改告警配置的表单 */ +// TODO @AI:两行=》1 行; export function useFormSchema(): VbenFormSchema[] { return [ { @@ -28,6 +29,7 @@ export function useFormSchema(): VbenFormSchema[] { }, rules: 'required', }, + // TODO @AI:vue + ep 貌似也要改成 teatarea! { fieldName: 'description', label: '配置描述', @@ -56,8 +58,11 @@ export function useFormSchema(): VbenFormSchema[] { buttonStyle: 'solid', optionType: 'button', }, + // TODO @AI:defaultValue 这种要枚举值哇? + defaultValue: 0, rules: 'required', }, + // TODO @AI:可能 label 比较宽,需要拉长点。 { fieldName: 'sceneRuleIds', label: '关联场景联动规则', @@ -69,6 +74,7 @@ export function useFormSchema(): VbenFormSchema[] { mode: 'multiple', placeholder: '请选择关联的场景联动规则', }, + defaultValue: [], rules: 'required', }, { @@ -82,6 +88,7 @@ export function useFormSchema(): VbenFormSchema[] { mode: 'multiple', placeholder: '请选择接收的用户', }, + defaultValue: [], rules: 'required', }, { @@ -93,6 +100,7 @@ export function useFormSchema(): VbenFormSchema[] { mode: 'multiple', placeholder: '请选择接收类型', }, + defaultValue: [], rules: 'required', }, ]; @@ -155,7 +163,10 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { field: 'level', title: '告警级别', minWidth: 100, - slots: { default: 'level' }, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.IOT_ALERT_LEVEL }, + }, }, { field: 'status', @@ -170,7 +181,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { field: 'sceneRuleIds', title: '关联场景联动规则', minWidth: 150, - slots: { default: 'sceneRules' }, + formatter: ({ cellValue }) => `${cellValue?.length || 0} 条`, }, { field: 'receiveUserNames', diff --git a/apps/web-antd/src/views/iot/alert/config/index.vue b/apps/web-antd/src/views/iot/alert/config/index.vue index b83176369..6ba25d9c2 100644 --- a/apps/web-antd/src/views/iot/alert/config/index.vue +++ b/apps/web-antd/src/views/iot/alert/config/index.vue @@ -1,6 +1,6 @@ @@ -102,20 +102,9 @@ const [Grid, gridApi] = useVbenVxeGrid({ ]" /> - - - - - - - - + + +