From 927317a87e6de62b2f1688be6fb2ec39d4aa508d Mon Sep 17 00:00:00 2001 From: DungTT Date: Thu, 14 May 2026 15:41:56 +0700 Subject: [PATCH] =?UTF-8?q?fix=20danh=20m=E1=BB=A5c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/app.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/public/js/app.js b/public/js/app.js index 853ecb9..b75b421 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -39,6 +39,7 @@ class AccountManager { this.assetStatusFilter = ''; this.assetBorrows = []; this.assetBorrowSearchTerm = ''; + this.assetBorrowTypeFilter = ''; this.myBorrowedAssetSearchTerm = ''; this.assetBorrowProductSearchTimer = undefined; this.assetBorrowProductItems = []; @@ -1471,9 +1472,16 @@ class AccountManager { getFilteredAssetBorrows() { const search = String(this.assetBorrowSearchTerm || '').toLowerCase(); + const typeFilter = String(this.assetBorrowTypeFilter || '').trim().toLowerCase(); const rows = Array.isArray(this.assetBorrows) ? this.assetBorrows : []; return rows.filter(item => { + const requestType = this.normalizeAssetRequestType(item.RequestType); + const matchesType = !typeFilter || requestType === typeFilter; + if (!matchesType) { + return false; + } + if (!search) { return true; } @@ -3220,6 +3228,14 @@ class AccountManager {
+
+ Danh mục + +
Tìm kiếm { + const nextValue = String(event.target.value || '').trim().toLowerCase(); + this.assetBorrowTypeFilter = (nextValue === 'borrow' || nextValue === 'return') + ? nextValue + : ''; + this.assetBorrowPage = 1; + this.renderAssetBorrowsTableBody(); + }); + typeFilter.dataset.boundChange = 'true'; + } + const searchInput = document.getElementById('assetBorrowSearch'); if (searchInput && searchInput.dataset.boundInput !== 'true') { searchInput.addEventListener('input', (event) => {