fix(FinancialPanorama): 修复Mock数据结构 + 移除业绩预告Tab

- financial.js: 修复字段名 code→stock_code, name→stock_name
 - financial.js: 财务报表改为嵌套结构匹配类型定义
 - 移除业绩预告Tab(迁移至DynamicTracking)
This commit is contained in:
zdl
2025-12-16 16:13:25 +08:00
parent 67340e9b82
commit 6738a09e3a
3 changed files with 229 additions and 94 deletions

View File

@@ -24,7 +24,7 @@ export const IndustryRankingView: React.FC<IndustryRankingViewProps> = ({
bgColor,
borderColor,
}) => {
if (!industryRank || industryRank.length === 0) {
if (!industryRank || !Array.isArray(industryRank) || industryRank.length === 0) {
return (
<Card>
<CardBody>

View File

@@ -57,8 +57,6 @@ import {
CashflowTable,
FinancialMetricsTable,
MainBusinessAnalysis,
IndustryRankingView,
StockComparison,
ComparisonAnalysis,
} from './components';
import type { FinancialPanoramaProps } from './types';
@@ -267,9 +265,6 @@ const FinancialPanorama: React.FC<FinancialPanoramaProps> = ({ stockCode: propSt
<Tab></Tab>
<Tab></Tab>
<Tab></Tab>
<Tab></Tab>
<Tab></Tab>
<Tab></Tab>
</TabList>
<TabPanels>
@@ -371,59 +366,6 @@ const FinancialPanorama: React.FC<FinancialPanoramaProps> = ({ stockCode: propSt
<TabPanel>
<MainBusinessAnalysis mainBusiness={mainBusiness} />
</TabPanel>
{/* 行业排名 */}
<TabPanel>
<IndustryRankingView
industryRank={industryRank}
bgColor={bgColor}
borderColor={borderColor}
/>
</TabPanel>
{/* 业绩预告 */}
<TabPanel>
{forecast && (
<VStack spacing={4} align="stretch">
{forecast.forecasts?.map((item, idx) => (
<Card key={idx}>
<CardBody>
<HStack justify="space-between" mb={2}>
<Badge colorScheme="blue">{item.forecast_type}</Badge>
<Text fontSize="sm" color="gray.500">
: {item.report_date}
</Text>
</HStack>
<Text mb={2}>{item.content}</Text>
{item.reason && (
<Text fontSize="sm" color="gray.600">
{item.reason}
</Text>
)}
{item.change_range?.lower && (
<HStack mt={2}>
<Text fontSize="sm">:</Text>
<Badge colorScheme="green">
{item.change_range.lower}% ~ {item.change_range.upper}%
</Badge>
</HStack>
)}
</CardBody>
</Card>
))}
</VStack>
)}
</TabPanel>
{/* 股票对比 */}
<TabPanel>
<StockComparison
currentStock={currentStockCode}
stockInfo={stockInfo}
positiveColor={positiveColor}
negativeColor={negativeColor}
/>
</TabPanel>
</TabPanels>
</Tabs>
)}