update pay ui
This commit is contained in:
@@ -521,5 +521,184 @@ export const conceptHandlers = [
|
||||
query: query,
|
||||
mode: mode
|
||||
});
|
||||
}),
|
||||
|
||||
// ============ 层级结构 API ============
|
||||
|
||||
// 获取完整层级结构
|
||||
http.get('/concept-api/hierarchy', async () => {
|
||||
await delay(300);
|
||||
|
||||
console.log('[Mock Concept] 获取层级结构');
|
||||
|
||||
// 模拟层级结构数据
|
||||
const hierarchy = [
|
||||
{
|
||||
id: 'lv1_1',
|
||||
name: '人工智能',
|
||||
concept_count: 98,
|
||||
children: [
|
||||
{
|
||||
id: 'lv2_1_1',
|
||||
name: 'AI基础设施',
|
||||
concept_count: 52,
|
||||
children: [
|
||||
{ id: 'lv3_1_1_1', name: 'AI算力硬件', concept_count: 16, concepts: ['AI芯片', 'GPU概念股', '服务器', 'AI一体机'] },
|
||||
{ id: 'lv3_1_1_2', name: 'AI关键组件', concept_count: 24, concepts: ['HBM', 'PCB', '光通信', '存储芯片'] },
|
||||
{ id: 'lv3_1_1_3', name: 'AI配套设施', concept_count: 12, concepts: ['数据中心', '液冷', '电力设备'] }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'lv2_1_2',
|
||||
name: 'AI模型与软件',
|
||||
concept_count: 13,
|
||||
concepts: ['DeepSeek', 'KIMI', 'SORA概念', '国产大模型']
|
||||
},
|
||||
{
|
||||
id: 'lv2_1_3',
|
||||
name: 'AI应用',
|
||||
concept_count: 17,
|
||||
children: [
|
||||
{ id: 'lv3_1_3_1', name: '智能体与陪伴', concept_count: 11, concepts: ['AI伴侣', 'AI智能体', 'AI陪伴'] },
|
||||
{ id: 'lv3_1_3_2', name: '行业应用', concept_count: 6, concepts: ['AI编程', '低代码'] }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'lv1_2',
|
||||
name: '半导体',
|
||||
concept_count: 45,
|
||||
children: [
|
||||
{ id: 'lv2_2_1', name: '半导体设备', concept_count: 10, concepts: ['光刻机', 'EDA', '半导体设备'] },
|
||||
{ id: 'lv2_2_2', name: '半导体材料', concept_count: 8, concepts: ['光刻胶', '半导体材料', '石英砂'] },
|
||||
{ id: 'lv2_2_3', name: '芯片设计与制造', concept_count: 10, concepts: ['第三代半导体', '碳化硅', '功率半导体'] },
|
||||
{ id: 'lv2_2_4', name: '先进封装', concept_count: 5, concepts: ['玻璃基板', '半导体封测'] }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'lv1_3',
|
||||
name: '机器人',
|
||||
concept_count: 42,
|
||||
children: [
|
||||
{ id: 'lv2_3_1', name: '人形机器人整机', concept_count: 20, concepts: ['特斯拉机器人', '人形机器人', '智元机器人'] },
|
||||
{ id: 'lv2_3_2', name: '机器人核心零部件', concept_count: 12, concepts: ['滚柱丝杆', '电子皮肤', '轴向磁通电机'] },
|
||||
{ id: 'lv2_3_3', name: '其他类型机器人', concept_count: 10, concepts: ['工业机器人', '机器狗', '外骨骼机器人'] }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'lv1_4',
|
||||
name: '消费电子',
|
||||
concept_count: 38,
|
||||
children: [
|
||||
{ id: 'lv2_4_1', name: '智能终端', concept_count: 8, concepts: ['AI PC', 'AI手机'] },
|
||||
{ id: 'lv2_4_2', name: 'XR与空间计算', concept_count: 14, concepts: ['AR眼镜', 'MR', '智能眼镜'] },
|
||||
{ id: 'lv2_4_3', name: '华为产业链', concept_count: 16, concepts: ['华为Mate70', '鸿蒙', '华为昇腾'] }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'lv1_5',
|
||||
name: '智能驾驶与汽车',
|
||||
concept_count: 35,
|
||||
children: [
|
||||
{ id: 'lv2_5_1', name: '自动驾驶解决方案', concept_count: 12, concepts: ['Robotaxi', '无人驾驶', '特斯拉FSD'] },
|
||||
{ id: 'lv2_5_2', name: '智能汽车产业链', concept_count: 15, concepts: ['比亚迪产业链', '小米汽车产业链'] },
|
||||
{ id: 'lv2_5_3', name: '车路协同', concept_count: 8, concepts: ['车路云一体化', '车路协同'] }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'lv1_6',
|
||||
name: '新能源与电力',
|
||||
concept_count: 52,
|
||||
children: [
|
||||
{ id: 'lv2_6_1', name: '新型电池技术', concept_count: 18, concepts: ['固态电池', '钠离子电池', '硅基负极'] },
|
||||
{ id: 'lv2_6_2', name: '电力设备与电网', concept_count: 20, concepts: ['电力', '变压器出海', '燃料电池'] },
|
||||
{ id: 'lv2_6_3', name: '清洁能源', concept_count: 14, concepts: ['光伏', '核电', '可控核聚变'] }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'lv1_7',
|
||||
name: '空天经济',
|
||||
concept_count: 28,
|
||||
children: [
|
||||
{ id: 'lv2_7_1', name: '低空经济', concept_count: 14, concepts: ['低空经济', 'eVTOL', '飞行汽车'] },
|
||||
{ id: 'lv2_7_2', name: '商业航天', concept_count: 14, concepts: ['卫星互联网', '商业航天', '北斗导航'] }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'lv1_8',
|
||||
name: '国防军工',
|
||||
concept_count: 25,
|
||||
children: [
|
||||
{ id: 'lv2_8_1', name: '无人作战与信息化', concept_count: 10, concepts: ['AI军工', '无人机蜂群', '军工信息化'] },
|
||||
{ id: 'lv2_8_2', name: '海军装备', concept_count: 8, concepts: ['国产航母', '电磁弹射'] },
|
||||
{ id: 'lv2_8_3', name: '军贸出海', concept_count: 7, concepts: ['军贸', '巴黎航展'] }
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
return HttpResponse.json({
|
||||
hierarchy,
|
||||
total_lv1: hierarchy.length,
|
||||
total_concepts: hierarchy.reduce((acc, h) => acc + h.concept_count, 0)
|
||||
});
|
||||
}),
|
||||
|
||||
// 获取层级统计数据(包含涨跌幅)
|
||||
http.get('/concept-api/statistics/hierarchy', async () => {
|
||||
await delay(300);
|
||||
|
||||
console.log('[Mock Concept] 获取层级统计数据');
|
||||
|
||||
const statistics = [
|
||||
{ lv1: '人工智能', concept_count: 98, avg_change_pct: 3.56, top_gainer: 'DeepSeek', top_gainer_change: 15.23 },
|
||||
{ lv1: '半导体', concept_count: 45, avg_change_pct: 2.12, top_gainer: '光刻机', top_gainer_change: 8.76 },
|
||||
{ lv1: '机器人', concept_count: 42, avg_change_pct: 4.28, top_gainer: '人形机器人', top_gainer_change: 12.45 },
|
||||
{ lv1: '消费电子', concept_count: 38, avg_change_pct: 1.45, top_gainer: 'AR眼镜', top_gainer_change: 6.78 },
|
||||
{ lv1: '智能驾驶与汽车', concept_count: 35, avg_change_pct: 2.89, top_gainer: 'Robotaxi', top_gainer_change: 9.32 },
|
||||
{ lv1: '新能源与电力', concept_count: 52, avg_change_pct: -0.56, top_gainer: '固态电池', top_gainer_change: 5.67 },
|
||||
{ lv1: '空天经济', concept_count: 28, avg_change_pct: 3.12, top_gainer: '低空经济', top_gainer_change: 11.23 },
|
||||
{ lv1: '国防军工', concept_count: 25, avg_change_pct: 1.78, top_gainer: 'AI军工', top_gainer_change: 7.89 }
|
||||
];
|
||||
|
||||
return HttpResponse.json({
|
||||
statistics,
|
||||
total_lv1: statistics.length,
|
||||
total_concepts: statistics.reduce((acc, s) => acc + s.concept_count, 0),
|
||||
market_avg_change: 2.34,
|
||||
update_time: new Date().toISOString()
|
||||
});
|
||||
}),
|
||||
|
||||
// 获取指定层级的概念列表
|
||||
http.get('/concept-api/hierarchy/:lv1Id', async ({ params, request }) => {
|
||||
await delay(300);
|
||||
|
||||
const { lv1Id } = params;
|
||||
const url = new URL(request.url);
|
||||
const lv2Id = url.searchParams.get('lv2_id');
|
||||
|
||||
console.log('[Mock Concept] 获取层级概念列表:', { lv1Id, lv2Id });
|
||||
|
||||
// 返回该层级下的概念列表
|
||||
let concepts = generatePopularConcepts(20);
|
||||
|
||||
// 添加层级信息
|
||||
concepts = concepts.map(c => ({
|
||||
...c,
|
||||
hierarchy: {
|
||||
lv1: '人工智能',
|
||||
lv1_id: lv1Id,
|
||||
lv2: lv2Id ? 'AI基础设施' : null,
|
||||
lv2_id: lv2Id
|
||||
}
|
||||
}));
|
||||
|
||||
return HttpResponse.json({
|
||||
concepts,
|
||||
total: concepts.length,
|
||||
lv1_id: lv1Id,
|
||||
lv2_id: lv2Id
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user