From 87217334f8a6fc0162956757ff5c0a4bd08f933a Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 15 Nov 2023 18:50:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/views/request.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/views/request.js b/dist/views/request.js index 5a60baf..ab20a1e 100644 --- a/dist/views/request.js +++ b/dist/views/request.js @@ -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() {