feat(client): 入库/出库搜索框支持酒名,并对搜索限流

- 搜索框 hint 改为「单号/往来单位/酒名」
- setKeyword 加去重+350ms 防抖:同词不重查、连发回车/狂点合并取最后一次,
  避免酒名模糊查询(单次约 55ms 明细扫描)被刷
- Timer 在 provider dispose 时取消

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-23 23:57:28 +08:00
parent e8f416ddea
commit 102ace42ac
4 changed files with 30 additions and 8 deletions
@@ -366,7 +366,7 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
final searchField = TextField(
controller: _searchCtrl,
decoration: InputDecoration(
hintText: '单号/往来单位,回车搜索',
hintText: '单号/往来单位/酒名,回车搜索',
prefixIcon: const Icon(Icons.search, size: 16),
hintStyle: const TextStyle(fontSize: 12),
suffixIcon: IconButton(
@@ -378,7 +378,7 @@ class _StockOutListScreenState extends ConsumerState<StockOutListScreen> {
final searchField = TextField(
controller: _searchCtrl,
decoration: InputDecoration(
hintText: '单号/往来单位,回车搜索',
hintText: '单号/往来单位/酒名,回车搜索',
prefixIcon: const Icon(Icons.search, size: 16),
hintStyle: const TextStyle(fontSize: 12),
suffixIcon: IconButton(