From 09a30cd980465f826e9ca2ea0897b2b7f1f00ed6 Mon Sep 17 00:00:00 2001 From: shanshi <3316401569@qq.com> Date: Thu, 19 Nov 2026 11:21:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A8=E5=A4=B4=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E5=9B=9E=E8=BD=A6=E7=9B=B4=E6=8E=A5=E7=AD=9B=E9=80=89=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E9=A1=B9=20(#1261)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../non-store-accounts.blade.php | 14 ++++++++++++++ .../Business/NonStoreAccountMonitorTest.php | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/resources/views/business/pages/financial-operations/non-store-accounts.blade.php b/resources/views/business/pages/financial-operations/non-store-accounts.blade.php index 9db03e8c..6cebd3cb 100644 --- a/resources/views/business/pages/financial-operations/non-store-accounts.blade.php +++ b/resources/views/business/pages/financial-operations/non-store-accounts.blade.php @@ -3086,7 +3086,21 @@ filterSearch.addEventListener('input', showFilterOptions); filterSearch.addEventListener('keydown', (event) => { if (event.key !== 'Enter' || !activeFilter) return; + if (event.isComposing || event.keyCode === 229) return; event.preventDefault(); + const normalizedQuery = filterSearch.value.trim().toLocaleLowerCase('zh-CN'); + if (normalizedQuery !== '') { + const matchingValues = activeFilter.values.filter( + (value) => value.toLocaleLowerCase('zh-CN').includes(normalizedQuery), + ); + if (matchingValues.length === 0) return; + activeFilter.selection = new Set(matchingValues); + activeFilter.state.filter = matchingValues.length === activeFilter.values.length + ? null + : new Set(matchingValues); + activeFilter.applyTable(); + filterCount.textContent = `全部账户 · 已选 ${activeFilter.selection.size} / ${activeFilter.values.length}`; + } activeFilter.applyServer(); }); sortButtons.forEach((button) => { diff --git a/tests/Feature/Business/NonStoreAccountMonitorTest.php b/tests/Feature/Business/NonStoreAccountMonitorTest.php index 07d48666..d85c46af 100644 --- a/tests/Feature/Business/NonStoreAccountMonitorTest.php +++ b/tests/Feature/Business/NonStoreAccountMonitorTest.php @@ -444,6 +444,18 @@ class NonStoreAccountMonitorTest extends FeatureTestCase $this->assertStringNotContainsString('分页占位公司001', $tableMatch[0]); $this->assertStringContainsString('全部账户 · 已选', $html); $this->assertStringContainsString('data-nsm-filter-key="account_display_short"', $html); + $this->assertStringContainsString( + 'const matchingValues = activeFilter.values.filter(', + $html, + ); + $this->assertStringContainsString( + 'activeFilter.selection = new Set(matchingValues);', + $html, + ); + $this->assertStringContainsString( + 'if (event.isComposing || event.keyCode === 229) return;', + $html, + ); $this->assertSame(1, preg_match( '/const serverColumnFilterValues = (.*?);\s*const serverColumnFilters/s', $html,