20260808172946

This commit is contained in:
oneao committed 2026-08-08 17:29:51 +08:00
1 parent 4fbfea82f2
commit d72ca4193d
293 files changed
+37523 -73467

No files matched your search

@@ -40,3 +40,25 @@ export function processGridKeydown(event, $table) {
$table.setCurrentColumn(columns[toIndex]);
}
}
export function processRowDrag(list, event, sortField = "mx_xh") {
const { oldRow, newRow } = event;
console.log("1111111111");
const oldIndex = list.indexOf(oldRow);
const newIndex = list.indexOf(newRow);
console.log(oldIndex);
console.log(newIndex);
if (oldIndex < 0 || newIndex < 0 || oldIndex === newIndex) {
return;
}
const [row] = list.splice(oldIndex, 1);
list.splice(newIndex, 0, row);
list.forEach((item, index) => {
item[sortField] = index + 1;
});
}