update pay ui

This commit is contained in:
2025-12-17 17:45:42 +08:00
parent 697c366e88
commit 542e1c6225
3 changed files with 35 additions and 16 deletions

View File

@@ -106,15 +106,18 @@ const SearchActions = memo<{
onWatchlistToggle, onWatchlistToggle,
}) => { }) => {
// 股票搜索 Hook // 股票搜索 Hook
const { const searchHook = useStockSearch({
searchResults,
isSearching,
handleSearch: doSearch,
clearSearch,
} = useStockSearch({
limit: 10, limit: 10,
debounceMs: 300, debounceMs: 300,
}); onSearch: () => {}, // 空回调,追踪在父组件处理
}) as {
searchResults: StockSearchResult[];
isSearching: boolean;
handleSearch: (query: string) => void;
clearSearch: () => void;
};
const { searchResults, isSearching, handleSearch: doSearch, clearSearch } = searchHook;
// 转换为 AutoComplete options // 转换为 AutoComplete options
const stockOptions = useMemo(() => { const stockOptions = useMemo(() => {

View File

@@ -5,7 +5,7 @@
*/ */
import { lazy } from 'react'; 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'; import type { CompanyTheme, TabConfig } from './types';
// ============================================ // ============================================
@@ -43,9 +43,11 @@ export const THEME: CompanyTheme = {
// ============================================ // ============================================
const CompanyOverview = lazy(() => import('./components/CompanyOverview')); 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 FinancialPanorama = lazy(() => import('./components/FinancialPanorama'));
const ForecastReport = lazy(() => import('./ForecastReport')); const ForecastReport = lazy(() => import('./components/ForecastReport'));
const DynamicTracking = lazy(() => import('./components/DynamicTracking'));
// ============================================ // ============================================
// Tab 配置 // Tab 配置
@@ -58,6 +60,12 @@ export const TAB_CONFIG: TabConfig[] = [
icon: Building2, icon: Building2,
component: CompanyOverview, component: CompanyOverview,
}, },
{
key: 'analysis',
name: '深度分析',
icon: Brain,
component: DeepAnalysis,
},
{ {
key: 'market', key: 'market',
name: '股票行情', name: '股票行情',
@@ -76,6 +84,12 @@ export const TAB_CONFIG: TabConfig[] = [
icon: FileBarChart, icon: FileBarChart,
component: ForecastReport, component: ForecastReport,
}, },
{
key: 'tracking',
name: '动态跟踪',
icon: Newspaper,
component: DynamicTracking,
},
]; ];
// ============================================ // ============================================

View File

@@ -83,12 +83,14 @@ const CompanyIndex: React.FC = () => {
} = useCompanyData({ stockCode }); } = useCompanyData({ stockCode });
// 事件追踪 Hook // 事件追踪 Hook
const { const companyEvents = useCompanyEvents({ stockCode }) as {
trackStockSearched, trackStockSearched: (newCode: string, oldCode: string | null) => void;
trackTabChanged, trackTabChanged: (index: number, name: string, prevIndex: number) => void;
trackWatchlistAdded, trackWatchlistAdded: (code: string) => void;
trackWatchlistRemoved, trackWatchlistRemoved: (code: string) => void;
} = useCompanyEvents({ stockCode }); };
const { trackStockSearched, trackTabChanged, trackWatchlistAdded, trackWatchlistRemoved } = companyEvents;
// 股票代码变化追踪 // 股票代码变化追踪
useEffect(() => { useEffect(() => {