From 26a4f0fee17e60f0c543b736abcb51fd0d55d133 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 2 Aug 2025 13:18:12 +0800 Subject: [PATCH] =?UTF-8?q?perf=EF=BC=9A=E3=80=90IoT=20=E7=89=A9=E8=81=94?= =?UTF-8?q?=E7=BD=91=E3=80=91=E5=9C=BA=E6=99=AF=E8=81=94=E5=8A=A8=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E5=99=A8=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/configs/DeviceTriggerConfig.vue | 7 ++ .../form/configs/MainConditionConfig.vue | 66 +++++++---------- .../form/configs/MainConditionInnerConfig.vue | 46 +++++++++--- .../scene/form/sections/TriggerSection.vue | 72 +++++++++---------- 4 files changed, 101 insertions(+), 90 deletions(-) diff --git a/src/views/iot/rule/scene/form/configs/DeviceTriggerConfig.vue b/src/views/iot/rule/scene/form/configs/DeviceTriggerConfig.vue index b5e37d5d..69ab5052 100644 --- a/src/views/iot/rule/scene/form/configs/DeviceTriggerConfig.vue +++ b/src/views/iot/rule/scene/form/configs/DeviceTriggerConfig.vue @@ -7,6 +7,7 @@ v-model="trigger" :trigger-type="trigger.type" @validate="handleMainConditionValidate" + @trigger-type-change="handleTriggerTypeChange" /> @@ -42,6 +43,7 @@ const props = defineProps<{ const emit = defineEmits<{ (e: 'update:modelValue', value: TriggerFormData): void (e: 'validate', value: { valid: boolean; message: string }): void + (e: 'trigger-type-change', type: number): void }>() const trigger = useVModel(props, 'modelValue', emit) @@ -83,6 +85,11 @@ const handleMainConditionValidate = (result: { valid: boolean; message: string } updateValidationResult() } +const handleTriggerTypeChange = (type: number) => { + trigger.value.type = type + emit('trigger-type-change', type) +} + // 事件处理 const handleConditionGroupValidate = () => { updateValidationResult() diff --git a/src/views/iot/rule/scene/form/configs/MainConditionConfig.vue b/src/views/iot/rule/scene/form/configs/MainConditionConfig.vue index 0376a01a..5753d7bb 100644 --- a/src/views/iot/rule/scene/form/configs/MainConditionConfig.vue +++ b/src/views/iot/rule/scene/form/configs/MainConditionConfig.vue @@ -1,38 +1,33 @@