From 11544909d3efdef8589f604a21b6b71cc680d692 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Fri, 19 Dec 2025 17:02:01 +0800 Subject: [PATCH] =?UTF-8?q?style(MarketDataView):=20=E7=BC=A9=E5=B0=8F?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Container py: 6 → 4 - VStack spacing: 6 → 4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/SubTabContainer/index.tsx | 31 ++++++++++++++----- .../CompanyOverview/BasicInfoTab/index.tsx | 1 + .../CompanyOverview/DeepAnalysisTab/index.tsx | 2 ++ .../components/DynamicTracking/index.js | 1 + .../components/FinancialPanorama/index.tsx | 1 + .../components/MarketDataView/index.tsx | 5 +-- 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/components/SubTabContainer/index.tsx b/src/components/SubTabContainer/index.tsx index a946d439..668f835a 100644 --- a/src/components/SubTabContainer/index.tsx +++ b/src/components/SubTabContainer/index.tsx @@ -95,6 +95,16 @@ export interface SubTabTheme { tabHoverBg: string; } +/** + * 尺寸配置 + */ +const SIZE_CONFIG = { + sm: { fontSize: '13px', px: 4, py: 2, gap: 1.5, iconSize: 3.5 }, + md: { fontSize: '15px', px: 6, py: 3, gap: 2, iconSize: 4 }, +} as const; + +export type SubTabSize = keyof typeof SIZE_CONFIG; + /** * 预设主题 - 深空 FUI 风格 */ @@ -140,6 +150,8 @@ export interface SubTabContainerProps { rightElement?: React.ReactNode; /** 紧凑模式 - 移除 TabList 的外边距 */ compact?: boolean; + /** Tab 尺寸: sm=小号(二级导航), md=正常(一级导航) */ + size?: SubTabSize; } const SubTabContainer: React.FC = memo(({ @@ -154,7 +166,10 @@ const SubTabContainer: React.FC = memo(({ isLazy = true, rightElement, compact = false, + size = 'md', }) => { + // 获取尺寸配置 + const sizeConfig = SIZE_CONFIG[size]; // 内部状态(非受控模式) const [internalIndex, setInternalIndex] = useState(defaultIndex); @@ -239,9 +254,9 @@ const SubTabContainer: React.FC = memo(({ {tabs.map((tab, idx) => { const isSelected = idx === currentIndex; @@ -251,9 +266,9 @@ const SubTabContainer: React.FC = memo(({ key={tab.key} color={theme.tabUnselectedColor} borderRadius={DEEP_SPACE.radius} - px={6} - py={3} - fontSize="15px" + px={sizeConfig.px} + py={sizeConfig.py} + fontSize={sizeConfig.fontSize} fontWeight="500" whiteSpace="nowrap" flexShrink={0} @@ -291,11 +306,11 @@ const SubTabContainer: React.FC = memo(({ transform: 'translateY(0)', }} > - + {tab.icon && ( @@ -314,7 +329,7 @@ const SubTabContainer: React.FC = memo(({ flexShrink={0} pr={3} pl={2} - py={compact ? 2 : 3} + py={compact ? 2 : sizeConfig.py} borderLeft="1px solid" borderColor={DEEP_SPACE.borderGold} > diff --git a/src/views/Company/components/CompanyOverview/BasicInfoTab/index.tsx b/src/views/Company/components/CompanyOverview/BasicInfoTab/index.tsx index 81537370..03d8a5fb 100644 --- a/src/views/Company/components/CompanyOverview/BasicInfoTab/index.tsx +++ b/src/views/Company/components/CompanyOverview/BasicInfoTab/index.tsx @@ -72,6 +72,7 @@ const BasicInfoTab: React.FC = ({ onTabChange={onTabChange} themePreset="blackGold" compact + size="sm" contentPadding={0} /> ); diff --git a/src/views/Company/components/CompanyOverview/DeepAnalysisTab/index.tsx b/src/views/Company/components/CompanyOverview/DeepAnalysisTab/index.tsx index 858e6575..fa2642d4 100644 --- a/src/views/Company/components/CompanyOverview/DeepAnalysisTab/index.tsx +++ b/src/views/Company/components/CompanyOverview/DeepAnalysisTab/index.tsx @@ -75,6 +75,7 @@ const DeepAnalysisTab: React.FC = ({ onTabChange={onTabChange} componentProps={{}} themePreset="blackGold" + size="sm" /> @@ -99,6 +100,7 @@ const DeepAnalysisTab: React.FC = ({ onToggleSegment, }} themePreset="blackGold" + size="sm" /> diff --git a/src/views/Company/components/DynamicTracking/index.js b/src/views/Company/components/DynamicTracking/index.js index fa9f1a9d..71b14540 100644 --- a/src/views/Company/components/DynamicTracking/index.js +++ b/src/views/Company/components/DynamicTracking/index.js @@ -59,6 +59,7 @@ const DynamicTracking = ({ stockCode: propStockCode }) => { index={activeTab} onTabChange={(index) => setActiveTab(index)} isLazy + size="sm" /> ); diff --git a/src/views/Company/components/FinancialPanorama/index.tsx b/src/views/Company/components/FinancialPanorama/index.tsx index ed569d9c..f9e5964c 100644 --- a/src/views/Company/components/FinancialPanorama/index.tsx +++ b/src/views/Company/components/FinancialPanorama/index.tsx @@ -213,6 +213,7 @@ const FinancialPanorama: React.FC = ({ stockCode: propSt componentProps={componentProps} themePreset="blackGold" isLazy + size="sm" onTabChange={handleTabChange} rightElement={ = ({ stockCode: propStockCod return ( - - + + {/* 股票概览 */} {summary && } @@ -153,6 +153,7 @@ const MarketDataView: React.FC = ({ stockCode: propStockCod index={activeTab} onTabChange={handleTabChange} isLazy + size="sm" />