mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-04-25 07:57:18 +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() {
|
export function usePostHook() {
|
||||||
const defaultSort: Sort = {
|
const defaultSort: Sort = {
|
||||||
prop: "post_sort",
|
prop: "postSort",
|
||||||
order: "ascending"
|
order: "ascending"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ export function usePostHook() {
|
|||||||
sortState.value = sort;
|
sortState.value = sort;
|
||||||
// 表格列的排序变化的时候,需要重置分页
|
// 表格列的排序变化的时候,需要重置分页
|
||||||
pagination.currentPage = 1;
|
pagination.currentPage = 1;
|
||||||
getPostList(sort);
|
getPostList();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onSearch(tableRef) {
|
async function onSearch(tableRef) {
|
||||||
@ -126,7 +126,7 @@ export function usePostHook() {
|
|||||||
// 点击搜索的时候,需要清空表格上列的排序
|
// 点击搜索的时候,需要清空表格上列的排序
|
||||||
tableRef.getTableRef().clearSort();
|
tableRef.getTableRef().clearSort();
|
||||||
// 使用默认排序发起请求
|
// 使用默认排序发起请求
|
||||||
getPostList(defaultSort);
|
getPostList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetForm(formEl, tableRef) {
|
function resetForm(formEl, tableRef) {
|
||||||
@ -144,11 +144,9 @@ export function usePostHook() {
|
|||||||
onSearch(tableRef);
|
onSearch(tableRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getPostList(sort: Sort = defaultSort) {
|
async function getPostList() {
|
||||||
pageLoading.value = true;
|
pageLoading.value = true;
|
||||||
if (sort != null) {
|
CommonUtils.fillSortParams(searchFormParams, sortState.value);
|
||||||
CommonUtils.fillSortParams(searchFormParams, sort);
|
|
||||||
}
|
|
||||||
CommonUtils.fillPaginationParams(searchFormParams, pagination);
|
CommonUtils.fillPaginationParams(searchFormParams, pagination);
|
||||||
|
|
||||||
const { data } = await getPostListApi(toRaw(searchFormParams)).finally(
|
const { data } = await getPostListApi(toRaw(searchFormParams)).finally(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user