feat(MarketDataView): 添加股票行情骨架屏

- 创建 MarketDataSkeleton 组件(摘要卡片 + K线图表 + Tab)
- 配置 Suspense fallback,点击时直接显示骨架屏

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-19 15:47:59 +08:00
parent 7fd1dc34f4
commit d394c25d7e
7 changed files with 190 additions and 13 deletions

View File

@@ -108,8 +108,9 @@ const UnifiedFinancialTableInner: React.FC<UnifiedFinancialTableProps> = ({
);
}
// 限制显示列数
const maxColumns = type === 'metrics' ? 6 : 8;
// 固定显示期数: 财务指标 6 期, 财务报表 8 期
const FIXED_PERIODS = { metrics: 6, statement: 8 };
const maxColumns = FIXED_PERIODS[type];
const displayData = data.slice(0, Math.min(data.length, maxColumns));
// 构建表格数据

View File

@@ -106,6 +106,14 @@ export const useFinancialData = (
const coreDataControllerRef = useRef<AbortController | null>(null);
const tabDataControllerRef = useRef<AbortController | null>(null);
// 记录每种数据类型加载时使用的期数(用于 Tab 切换时判断是否需要重新加载)
const dataPeriodsRef = useRef<Record<string, number>>({
balance: 0,
income: 0,
cashflow: 0,
metrics: 0,
});
// 判断 Tab key 对应的数据类型
const getDataTypeForTab = (tabKey: DataTypeKey): 'balance' | 'income' | 'cashflow' | 'metrics' => {
switch (tabKey) {

View File

@@ -20,8 +20,10 @@ export const BLACK_GOLD_TABLE_THEME: ThemeConfig = {
headerColor: '#D4AF37',
rowHoverBg: 'rgba(212, 175, 55, 0.1)',
borderColor: 'rgba(212, 175, 55, 0.15)',
cellPaddingBlock: 8,
cellPaddingInline: 12,
cellPaddingBlock: 6,
cellPaddingInline: 8,
// 表头紧凑样式
headerSplitColor: 'transparent',
},
},
};
@@ -40,6 +42,15 @@ export const getTableStyles = (className: string): string => `
border-bottom: 1px solid rgba(212, 175, 55, 0.3) !important;
font-weight: 600;
font-size: 13px;
padding: 4px 8px !important;
margin: 0 !important;
}
.${className} .ant-table-thead > tr {
margin: 0 !important;
}
.${className} .ant-table-header {
margin: 0 !important;
padding: 0 !important;
}
.${className} .ant-table-tbody > tr > td {
border-bottom: 1px solid rgba(212, 175, 55, 0.1) !important;