feat: 搜索栏交互优化 - 移除查询按钮,选择后直接跳转

- SearchBar: 移除"查询"按钮,简化交互
- SearchBar: 选择股票后直接触发搜索跳转
- useCompanyStock: handleSearch 支持直接传入股票代码参数

🤖 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:52:04 +08:00
parent c8d704363d
commit 0997cd9992
2 changed files with 29 additions and 47 deletions

View File

@@ -50,9 +50,10 @@ export const useCompanyStock = (options = {}) => {
/**
* 执行搜索 - 更新 stockCode 和 URL
* @param {string} [code] - 可选,直接传入股票代码(用于下拉选择)
*/
const handleSearch = useCallback(() => {
const trimmedCode = inputCode?.trim();
const handleSearch = useCallback((code) => {
const trimmedCode = code || inputCode?.trim();
if (trimmedCode && trimmedCode !== stockCode) {
// 触发变化回调(用于追踪)