fix: 分类排序

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

@ -90,13 +90,13 @@
rows.map((item) => item.id) rows.map((item) => item.id)
); );
}; };
const handleSort = async (newSort, oldSort, e, list) => { const handleSort = async (newSort, oldSort, e, arr) => {
list = list || unref(list); arr = arr || unref(list);
let direction = (oldSort - newSort) / Math.abs(oldSort - newSort); let direction = (oldSort - newSort) / Math.abs(oldSort - newSort);
let currentSort = list[newSort].sort; let currentSort = arr[newSort].sort;
oldSort = list[newSort + direction].sort; oldSort = arr[newSort + direction].sort;
loading.value = true; 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; loading.value = false;
}; };
const handleExpand = (row) => { const handleExpand = (row) => {

Loading…
Cancel
Save