From 6abbe346633671a0c4251f81cd2660d2ad5656d2 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 29 Mar 2023 16:16:06 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scene/Save/action/Device/actions/index.vue | 2 +- .../Scene/Save/action/Device/device/Device.vue | 9 +++------ .../rule-engine/Scene/Save/action/Device/device/Tag.vue | 5 +++++ .../Scene/Save/action/Device/device/index.vue | 1 + src/views/rule-engine/Scene/Save/action/Device/index.vue | 1 - 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue b/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue index 5266196e..f48ed3d6 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue @@ -58,7 +58,7 @@ @change="propertySelect" > i?.expands?.type?.includes('read'), ) || []" :value="item?.id" diff --git a/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue b/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue index b98f67dd..8ab6ad76 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue @@ -171,15 +171,12 @@ const handleClick = (_detail: any) => { } }; -watch(() => props.value?.[0]?.value, (newVal) => { - if(newVal){ - detail(newVal).then(resp => { +onMounted(() => { + if(props.value?.[0]?.value){ + detail(props.value?.[0]?.value).then(resp => { emit('change', resp.result); }) } -}, { - deep: true, - immediate: true }) watchEffect(() => { diff --git a/src/views/rule-engine/Scene/Save/action/Device/device/Tag.vue b/src/views/rule-engine/Scene/Save/action/Device/device/Tag.vue index b49db279..d839f1bc 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/device/Tag.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/device/Tag.vue @@ -180,6 +180,11 @@ const onValueChange = () => { emits('update:value', [{ value: newValue, name: '标签' }]); emits('change', [{ value: newValue, name: '标签' }], _data); }; + +// onMounted(() => { +// // console.log(tagList.value, props.tagData, props.value) +// // emits('change', props.value, _data); +// })