From 542e1c622566f78306184e97338a80befc4686ca Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Wed, 17 Dec 2025 17:45:42 +0800 Subject: [PATCH] update pay ui --- .../components/CompanyHeader/index.tsx | 17 +++++++++------- src/views/Company/config.ts | 20 ++++++++++++++++--- src/views/Company/index.tsx | 14 +++++++------ 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/views/Company/components/CompanyHeader/index.tsx b/src/views/Company/components/CompanyHeader/index.tsx index fda56186..7d1de48c 100644 --- a/src/views/Company/components/CompanyHeader/index.tsx +++ b/src/views/Company/components/CompanyHeader/index.tsx @@ -106,15 +106,18 @@ const SearchActions = memo<{ onWatchlistToggle, }) => { // 股票搜索 Hook - const { - searchResults, - isSearching, - handleSearch: doSearch, - clearSearch, - } = useStockSearch({ + const searchHook = useStockSearch({ limit: 10, debounceMs: 300, - }); + onSearch: () => {}, // 空回调,追踪在父组件处理 + }) as { + searchResults: StockSearchResult[]; + isSearching: boolean; + handleSearch: (query: string) => void; + clearSearch: () => void; + }; + + const { searchResults, isSearching, handleSearch: doSearch, clearSearch } = searchHook; // 转换为 AutoComplete options const stockOptions = useMemo(() => { diff --git a/src/views/Company/config.ts b/src/views/Company/config.ts index a78305d1..ee011a28 100644 --- a/src/views/Company/config.ts +++ b/src/views/Company/config.ts @@ -5,7 +5,7 @@ */ import { lazy } from 'react'; -import { Building2, TrendingUp, Wallet, FileBarChart } from 'lucide-react'; +import { Building2, Brain, TrendingUp, Wallet, FileBarChart, Newspaper } from 'lucide-react'; import type { CompanyTheme, TabConfig } from './types'; // ============================================ @@ -43,9 +43,11 @@ export const THEME: CompanyTheme = { // ============================================ const CompanyOverview = lazy(() => import('./components/CompanyOverview')); -const MarketDataView = lazy(() => import('./MarketDataView')); +const DeepAnalysis = lazy(() => import('./components/DeepAnalysis')); +const MarketDataView = lazy(() => import('./components/MarketDataView')); const FinancialPanorama = lazy(() => import('./components/FinancialPanorama')); -const ForecastReport = lazy(() => import('./ForecastReport')); +const ForecastReport = lazy(() => import('./components/ForecastReport')); +const DynamicTracking = lazy(() => import('./components/DynamicTracking')); // ============================================ // Tab 配置 @@ -58,6 +60,12 @@ export const TAB_CONFIG: TabConfig[] = [ icon: Building2, component: CompanyOverview, }, + { + key: 'analysis', + name: '深度分析', + icon: Brain, + component: DeepAnalysis, + }, { key: 'market', name: '股票行情', @@ -76,6 +84,12 @@ export const TAB_CONFIG: TabConfig[] = [ icon: FileBarChart, component: ForecastReport, }, + { + key: 'tracking', + name: '动态跟踪', + icon: Newspaper, + component: DynamicTracking, + }, ]; // ============================================ diff --git a/src/views/Company/index.tsx b/src/views/Company/index.tsx index a183ae74..24ad2110 100644 --- a/src/views/Company/index.tsx +++ b/src/views/Company/index.tsx @@ -83,12 +83,14 @@ const CompanyIndex: React.FC = () => { } = useCompanyData({ stockCode }); // 事件追踪 Hook - const { - trackStockSearched, - trackTabChanged, - trackWatchlistAdded, - trackWatchlistRemoved, - } = useCompanyEvents({ stockCode }); + const companyEvents = useCompanyEvents({ stockCode }) as { + trackStockSearched: (newCode: string, oldCode: string | null) => void; + trackTabChanged: (index: number, name: string, prevIndex: number) => void; + trackWatchlistAdded: (code: string) => void; + trackWatchlistRemoved: (code: string) => void; + }; + + const { trackStockSearched, trackTabChanged, trackWatchlistAdded, trackWatchlistRemoved } = companyEvents; // 股票代码变化追踪 useEffect(() => {