From dabc73b58940400beb7701aeb0c1aead20910aae Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 18 Jul 2023 10:56:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AD=90=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Subscribe/components/Detail.vue | 2 +- .../ChildDevice/BindChildDevice/index.vue | 23 ++++++++++----- .../Alarm/Configuration/Save/Base/index.vue | 28 ++++++++++++++++--- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/src/views/account/Center/components/Subscribe/components/Detail.vue b/src/views/account/Center/components/Subscribe/components/Detail.vue index 30682f1e..bd823a11 100644 --- a/src/views/account/Center/components/Subscribe/components/Detail.vue +++ b/src/views/account/Center/components/Subscribe/components/Detail.vue @@ -105,7 +105,7 @@ const handleSearch = async () => { ); }); if (_item) { - info.value = _item?.providerName + info.value = _item?.providerName || _item?.provider } } }; diff --git a/src/views/device/Instance/Detail/ChildDevice/BindChildDevice/index.vue b/src/views/device/Instance/Detail/ChildDevice/BindChildDevice/index.vue index c4d22930..b1eb60f9 100644 --- a/src/views/device/Instance/Detail/ChildDevice/BindChildDevice/index.vue +++ b/src/views/device/Instance/Detail/ChildDevice/BindChildDevice/index.vue @@ -194,13 +194,22 @@ const handleOk = () => { if (instanceStore.current.accessProvider === 'official-edge-gateway') { // 网关设备 queryDeviceMapping(instanceStore.current.id) .then(res => { - const arr = bindDeviceRef.value?._dataSource.filter(item => { - return !res.result?.[0]?.find(val => val.deviceId === item.id) && _selectedRowKeys.value.includes(item.id); - }).map(item => { - return { - deviceId: item.id, - deviceName: item.name - } + const arr = bindDeviceRef.value?._dataSource.filter((item: any) => { + return _selectedRowKeys.value.includes(item.id); + }).map((item: any) => { + const _item = res.result?.[0]?.find((val: any) => val.deviceId === item.id) + if(_item){ + return { + id: _item.id, + deviceId: _item.deviceId, + deviceName: _item.deviceName + } + }else { + return { + deviceId: item.id, + deviceName: item.name + } + } }) return saveDeviceMapping(instanceStore.current.id, {info: arr}) }).then(res => { diff --git a/src/views/rule-engine/Alarm/Configuration/Save/Base/index.vue b/src/views/rule-engine/Alarm/Configuration/Save/Base/index.vue index f7941de7..4fc26e98 100644 --- a/src/views/rule-engine/Alarm/Configuration/Save/Base/index.vue +++ b/src/views/rule-engine/Alarm/Configuration/Save/Base/index.vue @@ -11,7 +11,27 @@ > - + + { if (route.query?.id) { detail(route.query?.id).then((res) => { if (res.status === 200) { - emit('change', res?.result?.targetType) + emit('change', res?.result?.targetType); form.value = res?.result; // form.level = res?.result?.level; // form.name = res?.result?.name; @@ -209,7 +229,7 @@ const handleSave = async () => { if (res.status === 200) { onlyMessage('操作成功,请配置关联的场景联动'); loading.value = false; - emit('change', form.value.targetType) + emit('change', form.value.targetType); if (res.result?.id) { menuStory.jumpPage( 'rule-engine/Alarm/Configuration/Save',