mirror of
https://github.com/TangSengDaoDao/TangSengDaoDaoManager
synced 2025-06-03 23:58:10 +00:00
feat: 更新自定义分组排序
This commit is contained in:
parent
ce95ff4547
commit
12cb42c0c5
@ -235,11 +235,18 @@ const tableDrop = () => {
|
|||||||
Sortable.create(document.querySelector('.el-table__body-wrapper tbody') as HTMLElement, {
|
Sortable.create(document.querySelector('.el-table__body-wrapper tbody') as HTMLElement, {
|
||||||
handle: '.bd-drag',
|
handle: '.bd-drag',
|
||||||
animation: 300,
|
animation: 300,
|
||||||
onEnd({ newIndex, oldIndex }: any) {
|
onEnd(evt: any) {
|
||||||
|
const { newIndex, oldIndex } = evt;
|
||||||
const tablesList = [...tableData.value];
|
const tablesList = [...tableData.value];
|
||||||
const currRow = tablesList.splice(oldIndex as number, 1)[0];
|
const currRow = tablesList.splice(oldIndex as number, 1)[0];
|
||||||
tablesList.splice(newIndex as number, 0, currRow);
|
tablesList.splice(newIndex as number, 0, currRow);
|
||||||
bannerReorder(tablesList[newIndex].banner_no, tablesList[oldIndex].banner_no);
|
if (oldIndex > newIndex) {
|
||||||
|
// 向上排序
|
||||||
|
bannerReorder(tablesList[newIndex].banner_no, tablesList[oldIndex].banner_no);
|
||||||
|
} else {
|
||||||
|
// 向下排序
|
||||||
|
bannerReorder(tablesList[oldIndex].banner_no, tablesList[newIndex].banner_no);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -170,7 +170,13 @@ const treesDrop = () => {
|
|||||||
const treesList = [...dataTree.value];
|
const treesList = [...dataTree.value];
|
||||||
const currRow = treesList.splice(oldIndex as number, 1)[0];
|
const currRow = treesList.splice(oldIndex as number, 1)[0];
|
||||||
treesList.splice(newIndex as number, 0, currRow);
|
treesList.splice(newIndex as number, 0, currRow);
|
||||||
categoryReorder(treesList[newIndex].category_no, treesList[oldIndex].category_no);
|
if (oldIndex > newIndex) {
|
||||||
|
// 向上排序
|
||||||
|
categoryReorder(treesList[newIndex].category_no, treesList[oldIndex].category_no);
|
||||||
|
} else {
|
||||||
|
// 向下排序
|
||||||
|
categoryReorder(treesList[oldIndex].category_no, treesList[newIndex].category_no);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -378,7 +384,13 @@ const tableDrop = () => {
|
|||||||
const currRow = tablesList.splice(oldIndex as number, 1)[0];
|
const currRow = tablesList.splice(oldIndex as number, 1)[0];
|
||||||
tablesList.splice(newIndex as number, 0, currRow);
|
tablesList.splice(newIndex as number, 0, currRow);
|
||||||
tableData.value = tablesList;
|
tableData.value = tablesList;
|
||||||
categorysAppsReorder(tablesList[newIndex].app_id, tablesList[oldIndex].app_id);
|
if (oldIndex > newIndex) {
|
||||||
|
// 向上排序
|
||||||
|
categorysAppsReorder(tablesList[newIndex].app_id, tablesList[oldIndex].app_id);
|
||||||
|
} else {
|
||||||
|
// 向下排序
|
||||||
|
categorysAppsReorder(tablesList[oldIndex].app_id, tablesList[newIndex].app_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user