feat: SearchBar 模糊搜索功能

- SearchBar: 添加股票代码/名称模糊搜索下拉列表
- SearchBar: 使用 Redux allStocks 数据源进行过滤
- SearchBar: 点击外部自动关闭下拉,选择后自动搜索
- useCompanyStock: handleKeyPress 改为 handleKeyDown(兼容性优化)
- Company/index: 初始化时加载全部股票列表

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-10 10:25:31 +08:00
parent 3382dd1036
commit 0de4a1f7af
4 changed files with 163 additions and 49 deletions

View File

@@ -69,7 +69,7 @@ export const useCompanyStock = (options = {}) => {
/**
* 处理键盘事件 - 回车键触发搜索
*/
const handleKeyPress = useCallback((e) => {
const handleKeyDown = useCallback((e) => {
if (e.key === 'Enter') {
handleSearch();
}
@@ -83,7 +83,7 @@ export const useCompanyStock = (options = {}) => {
// 操作方法
setInputCode, // 更新输入框
handleSearch, // 执行搜索
handleKeyPress, // 处理回车键
handleKeyDown, // 处理回车键(改用 onKeyDown
};
};