From ecd956b4fd6d616b8b20e05cad7e0a877c85b84a Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 29 Mar 2023 20:38:24 +0800 Subject: [PATCH] =?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=E6=89=A7=E8=A1=8C=E5=8A=A8=E4=BD=9C=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=9F=A5=E8=AF=A2=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scene/Save/action/Device/device/Device.vue | 2 +- src/views/system/DataSource/Management/index.vue | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) 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 8ab6ad76..b837d4da 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 @@ -150,7 +150,7 @@ const handleSearch = (p: any) => { const deviceQuery = (p: any) => { const sorts: any = []; - if (props.value) { + if (props.value[0]?.value) { sorts.push({ name: 'id', value: props.value[0]?.value, diff --git a/src/views/system/DataSource/Management/index.vue b/src/views/system/DataSource/Management/index.vue index ea797fec..2f3f119e 100644 --- a/src/views/system/DataSource/Management/index.vue +++ b/src/views/system/DataSource/Management/index.vue @@ -147,7 +147,7 @@ :danger="true" :popConfirm="{ title: `确认删除`, - onConfirm: () => clickDel(record), + onConfirm: () => clickDel(record, index), }" :disabled="record.status" > @@ -358,14 +358,18 @@ const addRow = () => { table.data.push(initData); }; -const clickDel = (row: any) => { +const clickDel = (row: any, index: number) => { if (row.scale !== undefined) { delSaveRow_api(id, leftData.selectedKeys[0], [row.name]).then( (resp: any) => { - if (resp.status === 200) table.data.splice(row.index, 1); + if (resp.status === 200) { + table.data.splice(index, 1) + } }, ); - } else table.data.splice(row.index, 1); + } else { + table.data.splice(index, 1) + }; }; const clickSave = () => {