fix: 分类排序

feature/task1.0.0__0514__ch
向文可 3 years ago
parent bc54630d0a
commit fd37d9b31e

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

Loading…
Cancel
Save