From 89458dbf96e966426a74490834f1406194a70f48 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Fri, 2 Jun 2023 11:17:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=BA=E6=99=AF=E8=81=94=E5=8A=A8?= =?UTF-8?q?=E5=86=85=E7=BD=AE=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Save/action/Device/actions/EditTable.vue | 2 +- .../Scene/Save/action/ListItem/CheckItem.vue | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/action/Device/actions/EditTable.vue b/src/views/rule-engine/Scene/Save/action/Device/actions/EditTable.vue index 5e0250e2..b560341c 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/actions/EditTable.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/actions/EditTable.vue @@ -17,7 +17,7 @@ diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue b/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue index 941d9cb1..7c7b6d89 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue @@ -152,8 +152,8 @@ const checkDeviceDelete = async () => { if (item!.message!.messageType === 'WRITE_PROPERTY') { let hasProperties = false + const propertiesKey = Object.keys(item!.message!.properties!)?.[0] if (item!.message!.properties && metadata.properties.length) { - const propertiesKey = Object.keys(item!.message!.properties!)?.[0] hasProperties = metadata.properties?.some((item: any) => item.id === propertiesKey) } if (!hasProperties) { @@ -162,6 +162,22 @@ const checkDeviceDelete = async () => { formTouchOff() return } + // 判断值-内置参数 + const _value = item!.message!.properties?.[propertiesKey] + if(_value.source === 'upper') { + const _params = { + branch: props.thenName, + branchGroup: props.branchesName, + action: props.name - 1, + }; + const option = (await getBuildInData(_params, _data.value))(_value?.value!, 'id') + if(!option) { + _data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.message!.properties![propertiesKey] = undefined + _data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.changeData = true + formTouchOff() + return + } + } } if (item!.message!.messageType === 'INVOKE_FUNCTION') {