|
|
@@ -373,7 +373,7 @@
|
|
|
const parentIndex = row.parent.children!.findIndex((item) => item.id === row.id);
|
|
|
if (parentIndex > 0) {
|
|
|
const previousRow = row.parent.children![parentIndex - 1];
|
|
|
- const targetParent = getParent(tableData.value, previousRow.parent.id);
|
|
|
+ const targetParent = getParent(tableData.value, previousRow.parent.code);
|
|
|
// 进行交换位置
|
|
|
targetParent.children!.splice(parentIndex - 1, 2, row, previousRow);
|
|
|
}
|
|
|
@@ -399,7 +399,7 @@
|
|
|
const parentIndex = row.parent.children!.findIndex((item) => item.id === row.id);
|
|
|
if (parentIndex < row.parent.children?.length - 1) {
|
|
|
const behindRow = row.parent.children![parentIndex + 1];
|
|
|
- const targetParent = getParent(tableData.value, behindRow.parent.id);
|
|
|
+ const targetParent = getParent(tableData.value, behindRow.parent.code);
|
|
|
// 进行交换位置
|
|
|
targetParent.children!.splice(parentIndex, 2, behindRow, row);
|
|
|
}
|