修复分页

master
yutent 2023-11-15 18:50:50 +08:00
parent bee6a247bc
commit 87217334f8
1 changed files with 8 additions and 8 deletions

16
dist/views/request.js vendored
View File

@ -122,10 +122,13 @@ class Request extends Component {
let filter = this.#filter
let waited = this.#onlyShowWaited
this.list = this.#list
.filter(it => it.id.includes(filter) && (waited ? it.stat === 1 : true))
.slice(start, end)
this.total = (filter || waited ? this.list : this.#list).length
let list = this.#list.filter(
it => it.id.includes(filter) && (waited ? it.stat === 1 : true)
)
this.list = list.slice(start, end)
this.total = list.length
}
#pageChanged(ev) {
@ -140,10 +143,7 @@ class Request extends Component {
this.#filter = filter
this.#onlyShowWaited = waited
this.list = this.#list.filter(
it => it.id.includes(filter) && (waited ? it.stat === 1 : true)
)
this.total = this.list.length
this.#fetchPage()
}
#openDialog() {