mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-04-24 23:47:17 +08:00
fix: 修改“岗位管理”-pagination翻页、变换page大小时排序的错误。
This commit is contained in:
parent
0217e53b87
commit
9563c073cf
@ -16,7 +16,7 @@ const statusMap = useUserStoreHook().dictionaryMap["common.status"];
|
||||
|
||||
export function usePostHook() {
|
||||
const defaultSort: Sort = {
|
||||
prop: "post_sort",
|
||||
prop: "postSort",
|
||||
order: "ascending"
|
||||
};
|
||||
|
||||
@ -117,7 +117,7 @@ export function usePostHook() {
|
||||
sortState.value = sort;
|
||||
// 表格列的排序变化的时候,需要重置分页
|
||||
pagination.currentPage = 1;
|
||||
getPostList(sort);
|
||||
getPostList();
|
||||
}
|
||||
|
||||
async function onSearch(tableRef) {
|
||||
@ -126,7 +126,7 @@ export function usePostHook() {
|
||||
// 点击搜索的时候,需要清空表格上列的排序
|
||||
tableRef.getTableRef().clearSort();
|
||||
// 使用默认排序发起请求
|
||||
getPostList(defaultSort);
|
||||
getPostList();
|
||||
}
|
||||
|
||||
function resetForm(formEl, tableRef) {
|
||||
@ -144,11 +144,9 @@ export function usePostHook() {
|
||||
onSearch(tableRef);
|
||||
}
|
||||
|
||||
async function getPostList(sort: Sort = defaultSort) {
|
||||
async function getPostList() {
|
||||
pageLoading.value = true;
|
||||
if (sort != null) {
|
||||
CommonUtils.fillSortParams(searchFormParams, sort);
|
||||
}
|
||||
CommonUtils.fillSortParams(searchFormParams, sortState.value);
|
||||
CommonUtils.fillPaginationParams(searchFormParams, pagination);
|
||||
|
||||
const { data } = await getPostListApi(toRaw(searchFormParams)).finally(
|
||||
|
Loading…
x
Reference in New Issue
Block a user