From dab9509ba0ae1e68b6dd1a91dd752318bdcd36ed Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 20 May 2026 09:01:57 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=88iot=EF=BC=89:=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=20rule/scene=20=E7=9A=84=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-antd/src/views/iot/rule/scene/data.ts | 37 +- .../rule/scene/form/configs/alert-config.vue | 16 +- .../scene/form/configs/condition-config.vue | 51 +-- .../configs/current-time-condition-config.vue | 8 +- .../form/configs/device-control-config.vue | 40 +- .../form/configs/device-trigger-config.vue | 106 +++--- .../configs/main-condition-inner-config.vue | 37 +- .../configs/sub-condition-group-config.vue | 10 +- .../configs/timer-condition-group-config.vue | 184 +++++++++ .../scene/form/inputs/json-params-input.vue | 29 +- .../rule/scene/form/inputs/value-input.vue | 26 +- .../iot/rule/scene/form/rule-scene-form.vue | 360 ------------------ .../scene/form/sections/action-section.vue | 90 +++-- .../form/sections/basic-info-section.vue | 32 +- .../scene/form/sections/trigger-section.vue | 99 +++-- .../scene/form/selectors/device-selector.vue | 12 +- .../form/selectors/operator-selector.vue | 14 +- .../scene/form/selectors/product-selector.vue | 11 +- .../form/selectors/property-selector.vue | 105 +++-- .../src/views/iot/rule/scene/index.vue | 341 ++++++++++++++++- .../src/views/iot/rule/scene/modules/form.vue | 270 ++++++++++--- 21 files changed, 1094 insertions(+), 784 deletions(-) create mode 100644 apps/web-antd/src/views/iot/rule/scene/form/configs/timer-condition-group-config.vue delete mode 100644 apps/web-antd/src/views/iot/rule/scene/form/rule-scene-form.vue diff --git a/apps/web-antd/src/views/iot/rule/scene/data.ts b/apps/web-antd/src/views/iot/rule/scene/data.ts index fd948f9bf..b164629d5 100644 --- a/apps/web-antd/src/views/iot/rule/scene/data.ts +++ b/apps/web-antd/src/views/iot/rule/scene/data.ts @@ -89,49 +89,42 @@ export function useGridFormSchema(): VbenFormSchema[] { export function useGridColumns(): VxeTableGridOptions['columns'] { return [ { type: 'checkbox', width: 40 }, - { - field: 'id', - title: '规则编号', - minWidth: 80, - }, { field: 'name', title: '规则名称', - minWidth: 150, + minWidth: 180, + slots: { default: 'name' }, }, { - field: 'description', - title: '规则描述', - minWidth: 200, + field: 'triggers', + title: '触发条件', + minWidth: 260, + slots: { default: 'triggers' }, + }, + { + field: 'actions', + title: '执行动作', + minWidth: 220, + slots: { default: 'actionsCol' }, }, { field: 'status', title: '规则状态', - minWidth: 100, + width: 90, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.COMMON_STATUS }, }, }, - { - field: 'actionCount', - title: '执行动作数', - minWidth: 100, - }, - { - field: 'executeCount', - title: '执行次数', - minWidth: 100, - }, { field: 'createTime', title: '创建时间', - minWidth: 180, + width: 160, formatter: 'formatDateTime', }, { title: '操作', - width: 240, + width: 200, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-antd/src/views/iot/rule/scene/form/configs/alert-config.vue b/apps/web-antd/src/views/iot/rule/scene/form/configs/alert-config.vue index 1edf04e92..5d829a6de 100644 --- a/apps/web-antd/src/views/iot/rule/scene/form/configs/alert-config.vue +++ b/apps/web-antd/src/views/iot/rule/scene/form/configs/alert-config.vue @@ -23,17 +23,13 @@ const localValue = useVModel(props, 'modelValue', emit); const loading = ref(false); // 加载状态 const alertConfigs = ref([]); // 告警配置列表 -/** - * 处理选择变化事件 - * @param value 选中的值 - */ +/** 处理选择变化事件 */ function handleChange(value?: any) { emit('update:modelValue', value); } -/** - * 加载告警配置列表 - */ +// TODO @AI:这个是不是 antd + vue 也使用这个接口?要不增加一个 simple-list 接口? +/** 加载告警配置列表 */ async function loadAlertConfigs() { loading.value = true; try { @@ -48,7 +44,7 @@ async function loadAlertConfigs() { } } -// 组件挂载时加载数据 +/** 初始化 **/ onMounted(() => { loadAlertConfigs(); }); @@ -58,7 +54,7 @@ onMounted(() => {