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 = () => {