修正分页more计算

This commit is contained in:
wkj 2025-06-13 14:31:30 +08:00
parent e686d60bb4
commit 46e9a205c3
3 changed files with 16 additions and 8 deletions

View File

@ -1025,8 +1025,11 @@ class ListNode extends EntityNode {
}
if (typeof total === 'number') {
this.pagination.total = total;
if (typeof getTotal === 'number' && this.pagination.more && total < getTotal) {
const pages = Math.floor((total - 1) / this.pagination.pageSize) + 1;
}
if (typeof getTotal === 'number') {
const total2 = this.pagination.total || 0;
if (this.pagination.more && total2 < getTotal) {
const pages = Math.floor((total2 - 1) / this.pagination.pageSize) + 1;
this.pagination.more = this.pagination.currentPage + 1 < pages;
}
}

View File

@ -1028,8 +1028,11 @@ class ListNode extends EntityNode {
}
if (typeof total === 'number') {
this.pagination.total = total;
if (typeof getTotal === 'number' && this.pagination.more && total < getTotal) {
const pages = Math.floor((total - 1) / this.pagination.pageSize) + 1;
}
if (typeof getTotal === 'number') {
const total2 = this.pagination.total || 0;
if (this.pagination.more && total2 < getTotal) {
const pages = Math.floor((total2 - 1) / this.pagination.pageSize) + 1;
this.pagination.more = this.pagination.currentPage + 1 < pages;
}
}

View File

@ -1268,10 +1268,12 @@ class ListNode<
}
if (typeof total === 'number') {
this.pagination.total = total;
if (typeof getTotal === 'number' && this.pagination.more && total < getTotal) {
const pages = Math.floor((total - 1) / this.pagination.pageSize) + 1;
this.pagination.more = this.pagination.currentPage + 1 < pages
}
if (typeof getTotal === 'number') {
const total2 = this.pagination.total || 0;
if (this.pagination.more && total2 < getTotal) {
const pages = Math.floor((total2 - 1) / this.pagination.pageSize) + 1;
this.pagination.more = this.pagination.currentPage + 1 < pages;
}
}
if (append) {