From 16422906087fd34cf396b3b3f6d8d575cef7e669 Mon Sep 17 00:00:00 2001 From: wangshuaiswim Date: Thu, 9 Mar 2023 16:04:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=A9=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E8=A7=84=E5=88=99=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FRuleEditor/Debug/index.vue | 10 +- src/components/FRuleEditor/index.vue | 1 - .../Metadata/VirtualRuleParam/index.vue | 2 +- .../Metadata/Base/Edit/ExpandsForm.vue | 2 +- .../device/components/Metadata/Base/index.vue | 110 +++++++++++------- 5 files changed, 73 insertions(+), 52 deletions(-) diff --git a/src/components/FRuleEditor/Debug/index.vue b/src/components/FRuleEditor/Debug/index.vue index 14257edb..1d89dd9a 100644 --- a/src/components/FRuleEditor/Debug/index.vue +++ b/src/components/FRuleEditor/Debug/index.vue @@ -135,18 +135,18 @@ const runScript = () => { }); if (ws.value) { - ws.value.unsubscribe(); + ws.value.unsubscribe?.(); } if (!props.virtualRule?.script) { isBeginning.value = true; message.warning('请编辑规则'); return; } - ws.value = getWebSocket(`virtual-property-debug-${ruleEditorStore.state.property}-${new Date().getTime()}`, + ws.value = getWebSocket(`virtual-property-debug-${props.id}-${new Date().getTime()}`, '/virtual-property-debug', { virtualId: `${virtualIdRef.value}-virtual-id`, - property: ruleEditorStore.state.property, + property: props.id, virtualRule: { ...props.virtualRule, }, @@ -163,7 +163,7 @@ const beginAction = () => { const stopAction = () => { isBeginning.value = true; if (ws.value) { - ws.value.unsubscribe(); + ws.value.unsubscribe?.(); } } const clearAction = () => { @@ -172,7 +172,7 @@ const clearAction = () => { onUnmounted(() => { if (ws.value) { - ws.value.unsubscribe(); + ws.value.unsubscribe?.(); } }) diff --git a/src/components/FRuleEditor/index.vue b/src/components/FRuleEditor/index.vue index 70cb6fe4..bd12a913 100644 --- a/src/components/FRuleEditor/index.vue +++ b/src/components/FRuleEditor/index.vue @@ -1,6 +1,5 @@ diff --git a/src/components/Metadata/VirtualRuleParam/index.vue b/src/components/Metadata/VirtualRuleParam/index.vue index b8a712f9..5452a0e5 100644 --- a/src/components/Metadata/VirtualRuleParam/index.vue +++ b/src/components/Metadata/VirtualRuleParam/index.vue @@ -1,6 +1,6 @@