feat: 添加合规
This commit is contained in:
@@ -326,6 +326,177 @@ export const mockInvestmentPlans = [
|
||||
|
||||
// ==================== 投资日历事件数据 ====================
|
||||
|
||||
// ==================== 未来事件数据(用于投资日历) ====================
|
||||
|
||||
export const mockFutureEvents = [
|
||||
{
|
||||
id: 501,
|
||||
data_id: 501,
|
||||
title: '美联储FOMC会议',
|
||||
calendar_time: '2025-10-20T14:00:00Z',
|
||||
type: 'event',
|
||||
star: 5,
|
||||
former: {
|
||||
data: [
|
||||
{
|
||||
author: '美联储官网',
|
||||
sentences: '本次会议将重点讨论通胀控制和利率调整策略,美联储将评估当前经济形势,包括就业市场、物价水平和金融稳定性等关键指标,以决定是否调整联邦基金利率目标区间',
|
||||
query_part: '本次会议将重点讨论通胀控制和利率调整策略',
|
||||
report_title: 'FOMC会议议程公告',
|
||||
declare_date: '2025-10-15T00:00:00',
|
||||
match_score: '好'
|
||||
},
|
||||
{
|
||||
author: '彭博社',
|
||||
sentences: '市场普遍预期美联储将维持当前利率水平,根据对50位经济学家的调查,超过80%的受访者认为美联储将在本次会议上保持利率不变,等待更多经济数据以评估政策效果',
|
||||
query_part: '市场普遍预期美联储将维持当前利率水平',
|
||||
report_title: '美联储利率决议前瞻:经济学家调查报告',
|
||||
declare_date: '2025-10-18T00:00:00',
|
||||
match_score: '好'
|
||||
},
|
||||
{
|
||||
author: '路透社',
|
||||
sentences: '鲍威尔的讲话将释放未来货币政策方向的重要信号,市场将密切关注其对经济前景的评估,特别是关于通胀回落速度、就业市场韧性以及未来降息时点的表述',
|
||||
query_part: '鲍威尔的讲话将释放未来货币政策方向的重要信号',
|
||||
report_title: '鲍威尔讲话要点预测',
|
||||
declare_date: '2025-10-19T00:00:00',
|
||||
match_score: '好'
|
||||
}
|
||||
]
|
||||
},
|
||||
forecast: '预计维持利率不变,关注鲍威尔讲话基调',
|
||||
fact: null,
|
||||
related_stocks: [
|
||||
[
|
||||
'600036',
|
||||
'招商银行',
|
||||
{
|
||||
data: [
|
||||
{
|
||||
author: '中信证券',
|
||||
sentences: '作为国内领先的商业银行,招商银行对利率变化敏感度高,美联储货币政策调整将通过汇率、资本流动等渠道影响国内货币政策,进而影响银行净息差和资产质量',
|
||||
query_part: '美联储政策通过汇率和资本流动影响国内银行业',
|
||||
report_title: '美联储政策对中国银行业影响分析',
|
||||
declare_date: '2025-10-18T00:00:00',
|
||||
match_score: '好'
|
||||
}
|
||||
]
|
||||
},
|
||||
0.85
|
||||
],
|
||||
[
|
||||
'601398',
|
||||
'工商银行',
|
||||
{
|
||||
data: [
|
||||
{
|
||||
author: '招商证券',
|
||||
sentences: '工商银行作为国有大行,其经营业绩与宏观经济和货币政策高度相关,美联储利率决策将影响全球流动性和人民币汇率,对大型商业银行的跨境业务和外汇敞口产生直接影响',
|
||||
query_part: '美联储决策影响全球流动性和大行跨境业务',
|
||||
report_title: '货币政策对银行业影响专题研究',
|
||||
declare_date: '2025-10-17T00:00:00',
|
||||
match_score: '好'
|
||||
}
|
||||
]
|
||||
},
|
||||
0.80
|
||||
]
|
||||
],
|
||||
concepts: ['货币政策', '利率', '美联储'],
|
||||
is_following: false
|
||||
},
|
||||
{
|
||||
id: 502,
|
||||
data_id: 502,
|
||||
title: '央行货币政策委员会例会',
|
||||
calendar_time: '2025-10-20T09:00:00Z',
|
||||
type: 'event',
|
||||
star: 4,
|
||||
former: '本次例会将总结前期货币政策执行情况,研究部署下一阶段工作。重点关注经济增长、通胀水平和金融稳定等方面的形势变化。\n\n(AI合成)',
|
||||
forecast: '可能释放适度宽松信号',
|
||||
fact: null,
|
||||
related_stocks: [],
|
||||
concepts: ['货币政策', '央行', '宏观经济'],
|
||||
is_following: true
|
||||
},
|
||||
{
|
||||
id: 503,
|
||||
data_id: 503,
|
||||
title: '宁德时代业绩快报',
|
||||
calendar_time: '2025-10-20T16:00:00Z',
|
||||
type: 'data',
|
||||
star: 5,
|
||||
former: {
|
||||
data: [
|
||||
{
|
||||
author: 'SNE Research',
|
||||
sentences: '公司Q3动力电池装机量持续保持全球第一,市场份额达到37.8%,较去年同期提升2.3个百分点,在全球动力电池市场继续保持领先地位,主要得益于国内新能源汽车市场的强劲增长以及海外客户订单的持续放量',
|
||||
query_part: '公司Q3动力电池装机量持续保持全球第一',
|
||||
report_title: '全球动力电池市场装机量统计报告',
|
||||
declare_date: '2025-10-10T00:00:00',
|
||||
match_score: '好'
|
||||
},
|
||||
{
|
||||
author: '宁德时代',
|
||||
sentences: '储能业务订单饱满,预计全年营收同比增长超过60%,公司储能产品已应用于全球多个大型储能项目,在用户侧储能、电网侧储能等领域均实现突破,随着全球能源转型加速,储能市场需求持续旺盛',
|
||||
query_part: '储能业务订单饱满,预计全年营收同比增长超过60%',
|
||||
report_title: '宁德时代2024年业绩预告',
|
||||
declare_date: '2025-09-30T00:00:00',
|
||||
match_score: '好'
|
||||
}
|
||||
]
|
||||
},
|
||||
forecast: '预计营收和净利润双增长',
|
||||
fact: null,
|
||||
related_stocks: [
|
||||
[
|
||||
'300750',
|
||||
'宁德时代',
|
||||
{
|
||||
data: [
|
||||
{
|
||||
author: '宁德时代公告',
|
||||
sentences: '公司Q3动力电池装机量持续保持全球第一,市场份额达到37.8%,较去年同期提升2.3个百分点,在全球动力电池市场继续保持领先地位,主要得益于国内新能源汽车市场的强劲增长以及海外客户订单的持续放量',
|
||||
query_part: '动力电池装机量全球第一,市场份额37.8%',
|
||||
report_title: '宁德时代2024年Q3业绩快报',
|
||||
declare_date: '2025-10-15T00:00:00',
|
||||
match_score: '优'
|
||||
},
|
||||
{
|
||||
author: '国泰君安证券',
|
||||
sentences: '储能业务订单饱满,预计全年营收同比增长超过60%,公司储能产品已应用于全球多个大型储能项目,在用户侧储能、电网侧储能等领域均实现突破',
|
||||
query_part: '储能业务营收同比增长超60%',
|
||||
report_title: '宁德时代储能业务深度报告',
|
||||
declare_date: '2025-10-12T00:00:00',
|
||||
match_score: '优'
|
||||
}
|
||||
]
|
||||
},
|
||||
0.95
|
||||
],
|
||||
[
|
||||
'002466',
|
||||
'天齐锂业',
|
||||
{
|
||||
data: [
|
||||
{
|
||||
author: '天风证券',
|
||||
sentences: '天齐锂业作为宁德时代的核心供应商,将直接受益于下游动力电池需求的增长,公司锂资源储量丰富,随着宁德时代产能扩张,锂盐需求持续旺盛,公司业绩增长确定性强',
|
||||
query_part: '核心锂供应商直接受益于下游需求增长',
|
||||
report_title: '天齐锂业:受益动力电池产业链景气',
|
||||
declare_date: '2025-10-14T00:00:00',
|
||||
match_score: '好'
|
||||
}
|
||||
]
|
||||
},
|
||||
0.82
|
||||
]
|
||||
],
|
||||
concepts: ['新能源', '动力电池', '储能'],
|
||||
is_following: false
|
||||
}
|
||||
];
|
||||
|
||||
export const mockCalendarEvents = [
|
||||
{
|
||||
id: 401,
|
||||
@@ -497,3 +668,52 @@ export function getCalendarEventsByDateRange(userId, startDate, endDate) {
|
||||
return eventDate >= start && eventDate <= end;
|
||||
});
|
||||
}
|
||||
|
||||
// ==================== 未来事件(投资日历)辅助函数 ====================
|
||||
|
||||
/**
|
||||
* 获取指定日期的未来事件列表
|
||||
* @param {string} dateStr - 日期字符串 'YYYY-MM-DD'
|
||||
* @param {string} type - 事件类型 'event' | 'data' | 'all'
|
||||
* @returns {Array} 事件列表
|
||||
*/
|
||||
export function getMockFutureEvents(dateStr, type = 'all') {
|
||||
const targetDate = new Date(dateStr);
|
||||
|
||||
return mockFutureEvents.filter(event => {
|
||||
const eventDate = new Date(event.calendar_time);
|
||||
const isSameDate =
|
||||
eventDate.getFullYear() === targetDate.getFullYear() &&
|
||||
eventDate.getMonth() === targetDate.getMonth() &&
|
||||
eventDate.getDate() === targetDate.getDate();
|
||||
|
||||
if (!isSameDate) return false;
|
||||
|
||||
if (type === 'all') return true;
|
||||
return event.type === type;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定月份的事件统计
|
||||
* @param {number} year - 年份
|
||||
* @param {number} month - 月份 (1-12)
|
||||
* @returns {Array} 事件统计数组
|
||||
*/
|
||||
export function getMockEventCountsForMonth(year, month) {
|
||||
const counts = {};
|
||||
|
||||
mockFutureEvents.forEach(event => {
|
||||
const eventDate = new Date(event.calendar_time);
|
||||
if (eventDate.getFullYear() === year && eventDate.getMonth() + 1 === month) {
|
||||
const dateStr = eventDate.toISOString().split('T')[0];
|
||||
counts[dateStr] = (counts[dateStr] || 0) + 1;
|
||||
}
|
||||
});
|
||||
|
||||
return Object.entries(counts).map(([date, count]) => ({
|
||||
date,
|
||||
count,
|
||||
className: count >= 3 ? 'high-activity' : count >= 2 ? 'medium-activity' : 'low-activity'
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -91,8 +91,18 @@ export function generateWechatSessionId() {
|
||||
// 设置当前登录用户
|
||||
export function setCurrentUser(user) {
|
||||
if (user) {
|
||||
localStorage.setItem('mock_current_user', JSON.stringify(user));
|
||||
console.log('[Mock State] 设置当前登录用户:', user);
|
||||
// 数据兼容处理:确保用户数据包含订阅信息字段
|
||||
const normalizedUser = {
|
||||
...user,
|
||||
// 如果缺少订阅信息,添加默认值
|
||||
subscription_type: user.subscription_type || 'free',
|
||||
subscription_status: user.subscription_status || 'active',
|
||||
subscription_end_date: user.subscription_end_date || null,
|
||||
is_subscription_active: user.is_subscription_active !== false,
|
||||
subscription_days_left: user.subscription_days_left || 0
|
||||
};
|
||||
localStorage.setItem('mock_current_user', JSON.stringify(normalizedUser));
|
||||
console.log('[Mock State] 设置当前登录用户:', normalizedUser);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,13 @@ export const authHandlers = [
|
||||
email: null,
|
||||
avatar_url: `https://i.pravatar.cc/150?img=${id}`,
|
||||
has_wechat: false,
|
||||
created_at: new Date().toISOString()
|
||||
created_at: new Date().toISOString(),
|
||||
// 默认订阅信息 - 免费用户
|
||||
subscription_type: 'free',
|
||||
subscription_status: 'active',
|
||||
subscription_end_date: null,
|
||||
is_subscription_active: true,
|
||||
subscription_days_left: 0
|
||||
};
|
||||
mockUsers[credential] = user;
|
||||
console.log('[Mock] 创建新用户:', user);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { getEventRelatedStocks } from '../data/events';
|
||||
import { getMockFutureEvents, getMockEventCountsForMonth } from '../data/account';
|
||||
|
||||
// 模拟网络延迟
|
||||
const delay = (ms = 300) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
@@ -36,4 +37,718 @@ export const eventHandlers = [
|
||||
);
|
||||
}
|
||||
}),
|
||||
|
||||
// 获取事件传导链分析数据
|
||||
http.get('/api/events/:eventId/transmission', async ({ params }) => {
|
||||
await delay(500);
|
||||
|
||||
const { eventId } = params;
|
||||
|
||||
console.log('[Mock] 获取事件传导链分析, eventId:', eventId);
|
||||
|
||||
// Mock数据:事件传导链
|
||||
const mockTransmissionData = {
|
||||
success: true,
|
||||
data: {
|
||||
nodes: [
|
||||
{
|
||||
id: '1',
|
||||
name: '主要事件',
|
||||
category: '事件',
|
||||
value: 50,
|
||||
extra: {
|
||||
node_type: 'event',
|
||||
description: '这是主要事件节点',
|
||||
importance_score: 50,
|
||||
is_main_event: true
|
||||
}
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '半导体行业',
|
||||
category: '行业',
|
||||
value: 40,
|
||||
extra: {
|
||||
node_type: 'industry',
|
||||
description: '受影响的半导体行业',
|
||||
importance_score: 40,
|
||||
is_main_event: false
|
||||
}
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '芯片制造',
|
||||
category: '行业',
|
||||
value: 35,
|
||||
extra: {
|
||||
node_type: 'industry',
|
||||
description: '芯片制造产业链',
|
||||
importance_score: 35,
|
||||
is_main_event: false
|
||||
}
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: 'A公司',
|
||||
category: '公司',
|
||||
value: 30,
|
||||
extra: {
|
||||
node_type: 'company',
|
||||
description: '龙头企业A',
|
||||
importance_score: 30,
|
||||
stock_code: '600000',
|
||||
is_main_event: false
|
||||
}
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: 'B公司',
|
||||
category: '公司',
|
||||
value: 25,
|
||||
extra: {
|
||||
node_type: 'company',
|
||||
description: '龙头企业B',
|
||||
importance_score: 25,
|
||||
stock_code: '600001',
|
||||
is_main_event: false
|
||||
}
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: '相关政策',
|
||||
category: '政策',
|
||||
value: 30,
|
||||
extra: {
|
||||
node_type: 'policy',
|
||||
description: '国家产业政策支持',
|
||||
importance_score: 30,
|
||||
is_main_event: false
|
||||
}
|
||||
}
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
source: '1',
|
||||
target: '2',
|
||||
value: 0.8,
|
||||
extra: {
|
||||
transmission_strength: 0.8,
|
||||
transmission_type: '直接影响',
|
||||
description: '主事件对半导体行业的直接影响'
|
||||
}
|
||||
},
|
||||
{
|
||||
source: '2',
|
||||
target: '3',
|
||||
value: 0.7,
|
||||
extra: {
|
||||
transmission_strength: 0.7,
|
||||
transmission_type: '产业链传导',
|
||||
description: '半导体到芯片制造的传导'
|
||||
}
|
||||
},
|
||||
{
|
||||
source: '3',
|
||||
target: '4',
|
||||
value: 0.6,
|
||||
extra: {
|
||||
transmission_strength: 0.6,
|
||||
transmission_type: '企业影响',
|
||||
description: '对龙头企业A的影响'
|
||||
}
|
||||
},
|
||||
{
|
||||
source: '3',
|
||||
target: '5',
|
||||
value: 0.5,
|
||||
extra: {
|
||||
transmission_strength: 0.5,
|
||||
transmission_type: '企业影响',
|
||||
description: '对龙头企业B的影响'
|
||||
}
|
||||
},
|
||||
{
|
||||
source: '6',
|
||||
target: '1',
|
||||
value: 0.7,
|
||||
extra: {
|
||||
transmission_strength: 0.7,
|
||||
transmission_type: '政策驱动',
|
||||
description: '政策对主事件的推动作用'
|
||||
}
|
||||
},
|
||||
{
|
||||
source: '6',
|
||||
target: '2',
|
||||
value: 0.6,
|
||||
extra: {
|
||||
transmission_strength: 0.6,
|
||||
transmission_type: '政策支持',
|
||||
description: '政策对行业的支持'
|
||||
}
|
||||
}
|
||||
],
|
||||
categories: ['事件', '行业', '公司', '政策', '技术', '市场', '其他']
|
||||
},
|
||||
message: '获取成功'
|
||||
};
|
||||
|
||||
return HttpResponse.json(mockTransmissionData);
|
||||
}),
|
||||
|
||||
// 获取桑基图数据
|
||||
http.get('/api/events/:eventId/sankey-data', async ({ params }) => {
|
||||
await delay(300);
|
||||
const { eventId } = params;
|
||||
console.log('[Mock] 获取桑基图数据, eventId:', eventId);
|
||||
|
||||
const mockSankeyData = {
|
||||
success: true,
|
||||
data: {
|
||||
nodes: [
|
||||
{
|
||||
name: '相关政策',
|
||||
type: 'policy',
|
||||
level: 0,
|
||||
color: '#10ac84'
|
||||
},
|
||||
{
|
||||
name: '主要事件',
|
||||
type: 'event',
|
||||
level: 0,
|
||||
color: '#ff4757'
|
||||
},
|
||||
{
|
||||
name: '半导体行业',
|
||||
type: 'industry',
|
||||
level: 1,
|
||||
color: '#00d2d3'
|
||||
},
|
||||
{
|
||||
name: '芯片制造',
|
||||
type: 'industry',
|
||||
level: 2,
|
||||
color: '#00d2d3'
|
||||
},
|
||||
{
|
||||
name: 'A公司',
|
||||
type: 'company',
|
||||
level: 3,
|
||||
color: '#54a0ff'
|
||||
},
|
||||
{
|
||||
name: 'B公司',
|
||||
type: 'company',
|
||||
level: 3,
|
||||
color: '#54a0ff'
|
||||
}
|
||||
],
|
||||
links: [
|
||||
{ source: 0, target: 1, value: 7 }, // 相关政策 -> 主要事件
|
||||
{ source: 0, target: 2, value: 6 }, // 相关政策 -> 半导体行业
|
||||
{ source: 1, target: 2, value: 8 }, // 主要事件 -> 半导体行业
|
||||
{ source: 2, target: 3, value: 7 }, // 半导体行业 -> 芯片制造
|
||||
{ source: 3, target: 4, value: 6 }, // 芯片制造 -> A公司
|
||||
{ source: 3, target: 5, value: 5 } // 芯片制造 -> B公司
|
||||
]
|
||||
},
|
||||
message: '获取成功'
|
||||
};
|
||||
|
||||
return HttpResponse.json(mockSankeyData);
|
||||
}),
|
||||
|
||||
// 获取传导链节点详情
|
||||
http.get('/api/events/:eventId/chain-node/:nodeId', async ({ params }) => {
|
||||
await delay(300);
|
||||
|
||||
const { eventId, nodeId } = params;
|
||||
|
||||
console.log('[Mock] 获取节点详情, eventId:', eventId, 'nodeId:', nodeId);
|
||||
|
||||
// 根据节点ID返回不同的详细信息
|
||||
const nodeDetailsMap = {
|
||||
'1': {
|
||||
success: true,
|
||||
data: {
|
||||
node: {
|
||||
id: '1',
|
||||
name: '主要事件',
|
||||
type: 'event',
|
||||
description: '这是影响整个产业链的重大事件,涉及政策调整和技术突破,对下游产业产生深远影响。',
|
||||
importance_score: 50,
|
||||
total_connections: 2,
|
||||
incoming_connections: 1,
|
||||
outgoing_connections: 1
|
||||
},
|
||||
parents: [
|
||||
{
|
||||
id: '6',
|
||||
name: '相关政策',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "国务院",
|
||||
sentences: "为加快实施创新驱动发展战略,推动产业转型升级,国家将对重点领域给予财政补贴支持,单个项目最高补贴金额可达5000万元,同时享受研发费用加计扣除175%的税收优惠政策",
|
||||
query_part: "国家财政补贴最高5000万元,研发费用加计扣除175%",
|
||||
match_score: "好",
|
||||
declare_date: "2024-01-15T00:00:00",
|
||||
report_title: "关于促进产业高质量发展的若干政策措施"
|
||||
},
|
||||
{
|
||||
author: "工信部",
|
||||
sentences: "根据《重点产业扶持目录》,对符合条件的企业和项目,将优先纳入政府采购名单,并提供专项资金支持,确保政策红利直接惠及实体经济",
|
||||
query_part: "政府采购优先支持,专项资金直达企业",
|
||||
match_score: "好",
|
||||
declare_date: "2024-01-20T00:00:00",
|
||||
report_title: "工业和信息化部关于落实产业扶持政策的通知"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 70,
|
||||
is_circular: false
|
||||
}
|
||||
],
|
||||
children: [
|
||||
{
|
||||
id: '2',
|
||||
name: '半导体行业',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "中国电子信息产业发展研究院",
|
||||
sentences: "在技术突破和应用场景快速扩张的双重驱动下,国内半导体市场呈现爆发式增长态势。据统计,2024年上半年半导体市场规模达到1.2万亿元,同比增长32%,其中新能源汽车和AI算力芯片需求贡献了超过60%的增量",
|
||||
query_part: "技术突破和需求激增推动半导体市场增长32%",
|
||||
match_score: "好",
|
||||
declare_date: "2024-07-10T00:00:00",
|
||||
report_title: "2024年上半年中国半导体产业发展报告"
|
||||
},
|
||||
{
|
||||
author: "工信部电子信息司",
|
||||
sentences: "随着5G、人工智能、物联网等新一代信息技术的快速发展,半导体作为数字经济的基石,正迎来前所未有的发展机遇。预计未来三年,国内半导体市场年均增速将保持在25%以上",
|
||||
query_part: "新兴技术推动半导体产业高速增长",
|
||||
match_score: "好",
|
||||
declare_date: "2024-05-20T00:00:00",
|
||||
report_title: "新一代信息技术产业发展白皮书"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 80,
|
||||
is_circular: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
'2': {
|
||||
success: true,
|
||||
data: {
|
||||
node: {
|
||||
id: '2',
|
||||
name: '半导体行业',
|
||||
type: 'industry',
|
||||
description: '半导体行业是现代科技产业的基础,受到主事件和政策的双重推动,迎来新一轮发展机遇。',
|
||||
importance_score: 40,
|
||||
total_connections: 3,
|
||||
incoming_connections: 2,
|
||||
outgoing_connections: 1
|
||||
},
|
||||
parents: [
|
||||
{
|
||||
id: '1',
|
||||
name: '主要事件',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "中国半导体行业协会",
|
||||
sentences: "受益于新能源汽车、5G通信等新兴应用领域的爆发式增长,国内半导体市场需求持续旺盛,2024年Q1市场规模同比增长28%,创历史新高",
|
||||
query_part: "新兴应用推动半导体需求增长28%",
|
||||
match_score: "好",
|
||||
declare_date: "2024-04-05T00:00:00",
|
||||
report_title: "2024年Q1中国半导体行业景气度报告"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 80,
|
||||
is_circular: false
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: '相关政策',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "国家发改委",
|
||||
sentences: "《国家集成电路产业发展推进纲要》明确提出,到2025年半导体产业自给率要达到70%以上,国家将设立专项基金规模超过3000亿元,重点支持半导体设备、材料、设计等关键环节",
|
||||
query_part: "半导体自给率目标70%,专项基金3000亿",
|
||||
match_score: "好",
|
||||
declare_date: "2024-02-01T00:00:00",
|
||||
report_title: "国家集成电路产业发展推进纲要(2024-2030)"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 60,
|
||||
is_circular: false
|
||||
}
|
||||
],
|
||||
children: [
|
||||
{
|
||||
id: '3',
|
||||
name: '芯片制造',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "张明",
|
||||
sentences: "在半导体行业景气度持续提升的背景下,下游芯片制造企业订单饱满,产能利用率达到历史新高,预计2024年产能扩张将达到30%以上,技术工艺也将从28nm向14nm升级",
|
||||
query_part: "半导体行业繁荣带动芯片制造产能扩张30%",
|
||||
match_score: "好",
|
||||
declare_date: "2024-03-15T00:00:00",
|
||||
report_title: "半导体行业深度报告:产业链景气度传导分析"
|
||||
},
|
||||
{
|
||||
author: "李华",
|
||||
sentences: "芯片制造环节作为半导体产业链核心,受益于上游材料供应稳定和下游应用需求旺盛,技术迭代速度明显加快,先进制程占比持续提升",
|
||||
query_part: "技术迭代加快,先进制程占比提升",
|
||||
match_score: "好",
|
||||
declare_date: "2024-02-28T00:00:00",
|
||||
report_title: "芯片制造行业跟踪报告"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 70,
|
||||
is_circular: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
'3': {
|
||||
success: true,
|
||||
data: {
|
||||
node: {
|
||||
id: '3',
|
||||
name: '芯片制造',
|
||||
type: 'industry',
|
||||
description: '芯片制造作为半导体产业链的核心环节,在上游需求推动下,产能利用率提升,技术迭代加快。',
|
||||
importance_score: 35,
|
||||
total_connections: 3,
|
||||
incoming_connections: 1,
|
||||
outgoing_connections: 2
|
||||
},
|
||||
parents: [
|
||||
{
|
||||
id: '2',
|
||||
name: '半导体行业',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "张明",
|
||||
sentences: "在半导体行业景气度持续提升的背景下,下游芯片制造企业订单饱满,产能利用率达到历史新高,预计2024年产能扩张将达到30%以上,技术工艺也将从28nm向14nm升级",
|
||||
query_part: "半导体行业繁荣带动芯片制造产能扩张30%",
|
||||
match_score: "好",
|
||||
declare_date: "2024-03-15T00:00:00",
|
||||
report_title: "半导体行业深度报告:产业链景气度传导分析"
|
||||
},
|
||||
{
|
||||
author: "李华",
|
||||
sentences: "芯片制造环节作为半导体产业链核心,受益于上游材料供应稳定和下游应用需求旺盛,技术迭代速度明显加快,先进制程占比持续提升",
|
||||
query_part: "技术迭代加快,先进制程占比提升",
|
||||
match_score: "好",
|
||||
declare_date: "2024-02-28T00:00:00",
|
||||
report_title: "芯片制造行业跟踪报告"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 70,
|
||||
is_circular: false
|
||||
}
|
||||
],
|
||||
children: [
|
||||
{
|
||||
id: '4',
|
||||
name: 'A公司',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "王芳",
|
||||
sentences: "A公司作为国内芯片制造龙头企业,在手订单已排至2024年Q4,预计全年营收增长45%,净利润增长60%以上。公司28nm及以下先进制程产能占比已达到40%,技术实力行业领先",
|
||||
query_part: "A公司在手订单充足,预计营收增长45%",
|
||||
match_score: "好",
|
||||
declare_date: "2024-04-10T00:00:00",
|
||||
report_title: "A公司深度研究:受益芯片制造景气周期"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 60,
|
||||
is_circular: false
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: 'B公司',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "赵强",
|
||||
sentences: "随着芯片制造产能的大规模扩张,上游设备和材料供应商迎来历史性机遇。B公司作为核心配套企业,订单量同比增长55%,产品供不应求,预计2024年营收将突破百亿大关。公司在封装测试领域的市场份额已提升至国内第二位",
|
||||
query_part: "B公司订单增长55%,营收将破百亿",
|
||||
match_score: "好",
|
||||
declare_date: "2024-05-08T00:00:00",
|
||||
report_title: "B公司跟踪报告:芯片产业链配套龙头崛起"
|
||||
},
|
||||
{
|
||||
author: "国信证券",
|
||||
sentences: "B公司深度受益于芯片制造产业链的景气度传导。公司凭借先进的封装技术和完善的产能布局,成功绑定多家头部芯片制造企业,形成稳定的供应关系。随着下游客户产能持续扩张,公司业绩增长确定性强",
|
||||
query_part: "B公司受益产业链景气度,业绩增长确定性强",
|
||||
match_score: "好",
|
||||
declare_date: "2024-06-01T00:00:00",
|
||||
report_title: "半导体封装测试行业专题:产业链景气度传导分析"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 50,
|
||||
is_circular: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
'4': {
|
||||
success: true,
|
||||
data: {
|
||||
node: {
|
||||
id: '4',
|
||||
name: 'A公司',
|
||||
type: 'company',
|
||||
description: 'A公司是行业龙头企业,拥有先进的芯片制造技术和完整的产业链布局,在本轮产业升级中占据有利位置。',
|
||||
importance_score: 30,
|
||||
stock_code: '600000',
|
||||
total_connections: 1,
|
||||
incoming_connections: 1,
|
||||
outgoing_connections: 0
|
||||
},
|
||||
parents: [
|
||||
{
|
||||
id: '3',
|
||||
name: '芯片制造',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "王芳",
|
||||
sentences: "A公司作为国内芯片制造龙头企业,在手订单已排至2024年Q4,预计全年营收增长45%,净利润增长60%以上。公司28nm及以下先进制程产能占比已达到40%,技术实力行业领先",
|
||||
query_part: "A公司在手订单充足,预计营收增长45%",
|
||||
match_score: "好",
|
||||
declare_date: "2024-04-10T00:00:00",
|
||||
report_title: "A公司深度研究:受益芯片制造景气周期"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 60,
|
||||
is_circular: false
|
||||
}
|
||||
],
|
||||
children: []
|
||||
}
|
||||
},
|
||||
'5': {
|
||||
success: true,
|
||||
data: {
|
||||
node: {
|
||||
id: '5',
|
||||
name: 'B公司',
|
||||
type: 'company',
|
||||
description: 'B公司专注于芯片封装测试领域,随着上游制造产能释放,公司订单饱满,业绩稳步增长。',
|
||||
importance_score: 25,
|
||||
stock_code: '600001',
|
||||
total_connections: 1,
|
||||
incoming_connections: 1,
|
||||
outgoing_connections: 0
|
||||
},
|
||||
parents: [
|
||||
{
|
||||
id: '3',
|
||||
name: '芯片制造',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "赵强",
|
||||
sentences: "随着芯片制造产能的大规模扩张,上游设备和材料供应商迎来历史性机遇。B公司作为核心配套企业,订单量同比增长55%,产品供不应求,预计2024年营收将突破百亿大关",
|
||||
query_part: "B公司订单增长55%,营收将破百亿",
|
||||
match_score: "好",
|
||||
declare_date: "2024-05-08T00:00:00",
|
||||
report_title: "B公司跟踪报告:芯片产业链配套龙头崛起"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 50,
|
||||
is_circular: false
|
||||
}
|
||||
],
|
||||
children: []
|
||||
}
|
||||
},
|
||||
'6': {
|
||||
success: true,
|
||||
data: {
|
||||
node: {
|
||||
id: '6',
|
||||
name: '相关政策',
|
||||
type: 'policy',
|
||||
description: '国家出台了一系列产业扶持政策,包括财政补贴、税收减免和研发支持,旨在推动产业自主创新和进口替代。',
|
||||
importance_score: 30,
|
||||
total_connections: 2,
|
||||
incoming_connections: 0,
|
||||
outgoing_connections: 2
|
||||
},
|
||||
parents: [],
|
||||
children: [
|
||||
{
|
||||
id: '1',
|
||||
name: '主要事件',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "国务院",
|
||||
sentences: "为加快实施创新驱动发展战略,推动产业转型升级,国家将对重点领域给予财政补贴支持,单个项目最高补贴金额可达5000万元,同时享受研发费用加计扣除175%的税收优惠政策",
|
||||
query_part: "国家财政补贴最高5000万元,研发费用加计扣除175%",
|
||||
match_score: "好",
|
||||
declare_date: "2024-01-15T00:00:00",
|
||||
report_title: "关于促进产业高质量发展的若干政策措施"
|
||||
},
|
||||
{
|
||||
author: "工信部",
|
||||
sentences: "将重点支持关键核心技术攻关和产业化应用,建立产业发展专项基金,规模达到1000亿元,引导社会资本共同参与产业发展",
|
||||
query_part: "设立1000亿元产业发展专项基金",
|
||||
match_score: "好",
|
||||
declare_date: "2024-02-01T00:00:00",
|
||||
report_title: "产业发展专项基金管理办法"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 70,
|
||||
is_circular: false
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '半导体行业',
|
||||
transmission_mechanism: {
|
||||
data: [
|
||||
{
|
||||
author: "国家发改委",
|
||||
sentences: "《国家集成电路产业发展推进纲要》明确提出,到2025年半导体产业自给率要达到70%以上,国家将设立专项基金规模超过3000亿元,重点支持半导体设备、材料、设计等关键环节。同时,通过进口替代战略,加快培育本土产业链",
|
||||
query_part: "半导体自给率目标70%,专项基金3000亿",
|
||||
match_score: "好",
|
||||
declare_date: "2024-02-01T00:00:00",
|
||||
report_title: "国家集成电路产业发展推进纲要(2024-2030)"
|
||||
},
|
||||
{
|
||||
author: "工信部",
|
||||
sentences: "将重点支持关键核心技术攻关和产业化应用,建立产业发展专项基金,规模达到1000亿元,引导社会资本共同参与产业发展。通过税收优惠、研发补贴等政策工具,为半导体行业创造良好的发展环境",
|
||||
query_part: "设立1000亿元产业发展专项基金",
|
||||
match_score: "好",
|
||||
declare_date: "2024-02-01T00:00:00",
|
||||
report_title: "产业发展专项基金管理办法"
|
||||
}
|
||||
]
|
||||
},
|
||||
direction: 'positive',
|
||||
strength: 60,
|
||||
is_circular: false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 返回对应节点的详情,如果不存在则返回默认数据
|
||||
const nodeDetail = nodeDetailsMap[nodeId] || {
|
||||
success: true,
|
||||
data: {
|
||||
node: {
|
||||
id: nodeId,
|
||||
name: '未知节点',
|
||||
type: 'other',
|
||||
description: '该节点暂无详细信息',
|
||||
importance_score: 0,
|
||||
total_connections: 0,
|
||||
incoming_connections: 0,
|
||||
outgoing_connections: 0
|
||||
},
|
||||
parents: [],
|
||||
children: []
|
||||
}
|
||||
};
|
||||
|
||||
return HttpResponse.json(nodeDetail);
|
||||
}),
|
||||
|
||||
// ==================== 投资日历相关 ====================
|
||||
|
||||
// 获取月度事件统计
|
||||
http.get('/api/v1/calendar/event-counts', async ({ request }) => {
|
||||
await delay(300);
|
||||
|
||||
const url = new URL(request.url);
|
||||
const year = parseInt(url.searchParams.get('year'));
|
||||
const month = parseInt(url.searchParams.get('month'));
|
||||
|
||||
console.log('[Mock] 获取月度事件统计:', { year, month });
|
||||
|
||||
const eventCounts = getMockEventCountsForMonth(year, month);
|
||||
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
data: eventCounts
|
||||
});
|
||||
}),
|
||||
|
||||
// 获取指定日期的事件列表
|
||||
http.get('/api/v1/calendar/events', async ({ request }) => {
|
||||
await delay(300);
|
||||
|
||||
const url = new URL(request.url);
|
||||
const dateStr = url.searchParams.get('date');
|
||||
const type = url.searchParams.get('type') || 'all';
|
||||
|
||||
console.log('[Mock] 获取日历事件列表:', { date: dateStr, type });
|
||||
|
||||
if (!dateStr) {
|
||||
return HttpResponse.json({
|
||||
success: false,
|
||||
error: 'Date parameter required'
|
||||
}, { status: 400 });
|
||||
}
|
||||
|
||||
const events = getMockFutureEvents(dateStr, type);
|
||||
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
data: events
|
||||
});
|
||||
}),
|
||||
|
||||
// 切换未来事件关注状态
|
||||
http.post('/api/v1/calendar/events/:eventId/follow', async ({ params }) => {
|
||||
await delay(300);
|
||||
|
||||
const { eventId } = params;
|
||||
|
||||
console.log('[Mock] 切换事件关注状态, eventId:', eventId);
|
||||
|
||||
// 简单返回成功,实际状态管理可以后续完善
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
data: {
|
||||
is_following: true,
|
||||
message: '关注成功'
|
||||
}
|
||||
});
|
||||
}),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user