fix: 修复主营业务饼图遮挡和涨幅分析mock数据

饼图优化:
- 饼图半径从50%减小到45%
- 饼图中心从48%上移到45%
- 图例字体从11px减小到10px
- 图例图标从12px减小到10px

涨幅分析mock数据:
- 修复数据结构匹配RiseAnalysis类型
- 添加完整的涨幅分析详情(业绩超预期/政策利好/资金流入/技术突破)
- 添加主营业务、详细分析(Markdown)、相关公告
- 添加研报引用数据(机构、分析师、匹配度)
- 30个交易日数据,任意点击都能看到内容

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-26 16:36:46 +08:00
parent 85e24f64f0
commit 5fbfa0eb42
2 changed files with 80 additions and 18 deletions

View File

@@ -170,22 +170,84 @@ export const generateMarketData = (stockCode) => {
} }
}, },
// 涨分析 - 返回数组格式,每个元素对应一个交易日 // 涨分析 - 匹配 RiseAnalysis 类型,每个交易日一条记录
riseAnalysisData: { riseAnalysisData: {
success: true, success: true,
data: Array(30).fill(null).map((_, i) => { data: Array(30).fill(null).map((_, i) => {
const tradeDate = new Date(Date.now() - (29 - i) * 24 * 60 * 60 * 1000).toISOString().split('T')[0]; const tradeDate = new Date(Date.now() - (29 - i) * 24 * 60 * 60 * 1000).toISOString().split('T')[0];
const isLimitUp = Math.random() < 0.05; // 5%概率涨停 const riseRate = parseFloat(((Math.random() - 0.5) * 10).toFixed(2)); // -5% ~ +5%
const closePrice = parseFloat((basePrice * (1 + riseRate / 100)).toFixed(2));
const volume = Math.floor(Math.random() * 500000000) + 100000000;
const amount = Math.floor(volume * closePrice);
// 涨幅分析详情模板
const riseReasons = [
{
brief: '业绩超预期',
detail: `## 业绩驱动\n\n${stockInfo.name}发布业绩公告,主要经营指标超出市场预期:\n\n- **营业收入**同比增长15.3%环比增长5.2%\n- **净利润**同比增长18.7%,创历史新高\n- **毛利率**提升2.1个百分点至35.8%\n\n### 核心亮点\n\n1. 主营业务增长强劲,市场份额持续提升\n2. 成本管控效果显著,盈利能力改善\n3. 新产品放量,贡献增量收入`,
announcements: `**重要公告**\n\n1. [${stockInfo.name}关于2024年度业绩预告的公告](javascript:void(0))\n2. [${stockInfo.name}:关于获得政府补助的公告](javascript:void(0))`
},
{
brief: '政策利好',
detail: `## 政策催化\n\n近期行业政策密集出台,对${stockInfo.name}形成重大利好:\n\n### 政策要点\n\n- **行业支持政策**:国家出台支持措施,加大对行业的扶持力度\n- **税收优惠**:符合条件的企业可享受税收减免\n- **融资支持**:拓宽企业融资渠道,降低融资成本\n\n### 受益分析\n\n公司作为行业龙头,有望充分受益于政策红利,预计:\n\n1. 订单量将显著增长\n2. 毛利率有望提升\n3. 市场份额进一步扩大`,
announcements: `**相关公告**\n\n1. [${stockInfo.name}:关于行业政策影响的说明公告](javascript:void(0))`
},
{
brief: '资金流入',
detail: `## 资金面分析\n\n今日${stockInfo.name}获得主力资金大幅流入:\n\n### 资金流向\n\n| 指标 | 数值 | 变化 |\n|------|------|------|\n| 主力净流入 | 3.2亿 | +156% |\n| 超大单净流入 | 1.8亿 | +89% |\n| 大单净流入 | 1.4亿 | +67% |\n\n### 分析结论\n\n1. 机构资金持续加仓,看好公司长期价值\n2. 北向资金连续3日净买入\n3. 融资余额创近期新高`,
announcements: ''
},
{
brief: '技术突破',
detail: `## 技术面分析\n\n${stockInfo.name}今日实现技术突破:\n\n### 技术信号\n\n- **突破关键阻力位**:成功站上${(closePrice * 0.95).toFixed(2)}元重要阻力\n- **量价配合良好**成交量较昨日放大1.5倍\n- **均线多头排列**5日、10日、20日均线呈多头排列\n\n### 后市展望\n\n技术面看,股价有望继续向上挑战${(closePrice * 1.05).toFixed(2)}元目标位。建议关注:\n\n1. 能否持续放量\n2. 均线支撑情况\n3. MACD金叉确认`,
announcements: ''
}
];
const reasonIndex = i % riseReasons.length;
const reason = riseReasons[reasonIndex];
// 研报数据
const publishers = ['中信证券', '华泰证券', '国泰君安', '招商证券', '中金公司', '海通证券'];
const authors = ['张三', '李四', '王五', '赵六', '钱七', '孙八'];
const matchScores = ['好', '中', '差'];
return { return {
stock_code: stockCode,
stock_name: stockInfo.name,
trade_date: tradeDate, trade_date: tradeDate,
is_limit_up: isLimitUp, rise_rate: riseRate,
limit_up_price: (basePrice * 1.10).toFixed(2), close_price: closePrice,
current_price: (basePrice + (Math.random() - 0.5) * 0.5).toFixed(2), volume: volume,
distance_to_limit: (Math.random() * 10).toFixed(2), // % amount: amount,
consecutive_days: isLimitUp ? Math.floor(Math.random() * 3) + 1 : 0, main_business: stockInfo.business || '金融服务、零售银行、对公业务、资产管理等',
reason: isLimitUp ? '业绩超预期' : '', rise_reason_brief: reason.brief,
concept_tags: ['银行', '深圳国资', 'MSCI', '沪深300'], rise_reason_detail: reason.detail,
analysis: isLimitUp ? '股价触及涨停板,资金流入明显' : '股价正常波动,交投活跃' announcements: reason.announcements || '',
verification_reports: [
{
publisher: publishers[i % publishers.length],
match_score: matchScores[Math.floor(Math.random() * 3)],
match_ratio: parseFloat((Math.random() * 0.5 + 0.5).toFixed(2)),
declare_date: tradeDate,
report_title: `${stockInfo.name}深度研究:${reason.brief}带来投资机会`,
author: authors[i % authors.length],
verification_item: `${reason.brief}对公司业绩的影响分析`,
content: `我们认为${stockInfo.name}${reason.brief}的背景下,有望实现业绩的持续增长。维持"买入"评级,目标价${(closePrice * 1.2).toFixed(2)}元。`
},
{
publisher: publishers[(i + 1) % publishers.length],
match_score: matchScores[Math.floor(Math.random() * 3)],
match_ratio: parseFloat((Math.random() * 0.4 + 0.3).toFixed(2)),
declare_date: tradeDate,
report_title: `${stockInfo.name}跟踪报告:关注${reason.brief}`,
author: authors[(i + 1) % authors.length],
verification_item: '估值分析与投资建议',
content: `当前估值处于历史中低位,安全边际充足。建议投资者积极关注。`
}
],
update_time: new Date().toISOString().split('T')[0] + ' 18:30:00',
create_time: tradeDate + ' 15:30:00'
}; };
}) })
}, },

View File

@@ -266,27 +266,27 @@ export const getMainBusinessPieOption = (
}, },
legend: { legend: {
orient: 'horizontal', orient: 'horizontal',
bottom: 0, bottom: 5,
left: 'center', left: 'center',
textStyle: { textStyle: {
color: '#E2E8F0', color: '#E2E8F0',
fontSize: 11, fontSize: 10,
}, },
itemWidth: 12, itemWidth: 10,
itemHeight: 12, itemHeight: 10,
itemGap: 8, itemGap: 6,
}, },
color: BLACK_GOLD_PIE_COLORS, color: BLACK_GOLD_PIE_COLORS,
series: [ series: [
{ {
type: 'pie', type: 'pie',
radius: '50%', radius: '45%',
center: ['50%', '48%'], center: ['50%', '45%'],
data: data, data: data,
label: { label: {
show: true, show: true,
color: '#E2E8F0', color: '#E2E8F0',
fontSize: 11, fontSize: 10,
formatter: '{d}%', formatter: '{d}%',
}, },
labelLine: { labelLine: {