fix: 修改场景联动执行动作设备查询排序

This commit is contained in:
100011797 2023-03-29 20:38:24 +08:00
parent 8187e27a43
commit ecd956b4fd
2 changed files with 9 additions and 5 deletions

View File

@ -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,

View File

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