Merge pull request '更新 Web/src/views/system/codeGen/component/genConfigDialog.vue' (#169) from IMaster/Admin.NET.Pro:template into main
Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/169
This commit is contained in:
commit
d6b9f2883e
@ -231,29 +231,13 @@ const rowDrop = () => {
|
|||||||
const fullData = xGrid.value?.getTableData().fullData || [];
|
const fullData = xGrid.value?.getTableData().fullData || [];
|
||||||
const newIndex = sortableEvent.newIndex as number;
|
const newIndex = sortableEvent.newIndex as number;
|
||||||
const oldIndex = sortableEvent.oldIndex as number;
|
const oldIndex = sortableEvent.oldIndex as number;
|
||||||
// 往前移动
|
var orderNo = fullData[newIndex - 1].orderNo;
|
||||||
if (oldIndex > newIndex) {
|
fullData[newIndex].orderNo = orderNo! + 10;
|
||||||
const moveRow = fullData?.find((e) => e.orderNo == oldIndex + 1);
|
const currentRow = fullData.splice(oldIndex, 1)[0];
|
||||||
for (let i = oldIndex; i > newIndex; i--) {
|
fullData.splice(newIndex, 0, currentRow);
|
||||||
const row = fullData?.find((e) => e.orderNo == i);
|
fullData.forEach((u, i) => (u.orderNo = 100 + i * 10));
|
||||||
if (row) {
|
|
||||||
row.orderNo += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
moveRow.orderNo = newIndex + 1;
|
|
||||||
} else {
|
|
||||||
// 往后移动
|
|
||||||
const moveRow = fullData?.find((e) => e.orderNo == oldIndex + 1);
|
|
||||||
for (let i = oldIndex; i < newIndex; i++) {
|
|
||||||
const row = fullData?.find((e) => e.orderNo == i + 2);
|
|
||||||
if (row) {
|
|
||||||
row.orderNo -= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
moveRow.orderNo = newIndex + 1;
|
|
||||||
}
|
|
||||||
// 更新表格数据
|
// 更新表格数据
|
||||||
xGrid.value?.updateData();
|
xGrid.value?.loadData(fullData);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user