|
|
|
@ -90,13 +90,13 @@
|
|
|
|
|
rows.map((item) => item.id)
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
const handleSort = async (newSort, oldSort, e, list) => {
|
|
|
|
|
list = list || unref(list);
|
|
|
|
|
const handleSort = async (newSort, oldSort, e, arr) => {
|
|
|
|
|
arr = arr || unref(list);
|
|
|
|
|
let direction = (oldSort - newSort) / Math.abs(oldSort - newSort);
|
|
|
|
|
let currentSort = list[newSort].sort;
|
|
|
|
|
oldSort = list[newSort + direction].sort;
|
|
|
|
|
let currentSort = arr[newSort].sort;
|
|
|
|
|
oldSort = arr[newSort + direction].sort;
|
|
|
|
|
loading.value = true;
|
|
|
|
|
await store.dispatch('category/sort', { id: list[newSort].id, currentSort, oldSort });
|
|
|
|
|
await store.dispatch('category/sort', { id: arr[newSort].id, currentSort, oldSort });
|
|
|
|
|
loading.value = false;
|
|
|
|
|
};
|
|
|
|
|
const handleExpand = (row) => {
|
|
|
|
|