修正分页器异常
This commit is contained in:
@@ -692,14 +692,21 @@ function fnGetList(pageNum?: number) {
|
||||
: '';
|
||||
filterState.sql = sql;
|
||||
}
|
||||
listAct(toRaw(queryParams), filterState.sql).then(res => {
|
||||
listAct(toRaw(queryParams), filterState.sql).then((res: any) => {
|
||||
console.log(res);
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
|
||||
// 取消勾选
|
||||
if (state.selectedRowKeys.length > 0) {
|
||||
state.selectedRowKeys = [];
|
||||
}
|
||||
////
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
if(tablePagination.total<=(queryParams.pageNum-1)*tablePagination.pageSize&&queryParams.pageNum!==1) {
|
||||
tableState.loading = false;
|
||||
fnGetList(queryParams.pageNum-1)
|
||||
}
|
||||
} else {
|
||||
tablePagination.total = 0;
|
||||
tableState.data = [];
|
||||
|
||||
@@ -494,6 +494,10 @@ function fnGetList(pageNum?: number) {
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
|
||||
tableState.loading = false;
|
||||
fnGetList(queryParams.pageNum - 1);
|
||||
}
|
||||
} else {
|
||||
tablePagination.total = 0;
|
||||
tableState.data = [];
|
||||
|
||||
Reference in New Issue
Block a user