diff --git a/src/views/EventDetail/components/TransmissionChainAnalysis.js b/src/views/EventDetail/components/TransmissionChainAnalysis.js index 92006cfb..34009aa0 100644 --- a/src/views/EventDetail/components/TransmissionChainAnalysis.js +++ b/src/views/EventDetail/components/TransmissionChainAnalysis.js @@ -35,6 +35,7 @@ import ReactECharts from 'echarts-for-react'; import { eventService } from '../../../services/eventService'; import CitedContent from '../../../components/Citation/CitedContent'; import { logger } from '../../../utils/logger'; +import { PROFESSIONAL_COLORS } from '../../../constants/professionalTheme'; // 节点样式配置 - 完全复刻Flask版本 const NODE_STYLES = { @@ -402,8 +403,8 @@ const TransmissionChainAnalysis = ({ eventId }) => { }); const containerRef = useRef(null); - const modalBgColor = useColorModeValue('white', 'gray.800'); - const modalBorderColor = useColorModeValue('gray.200', 'gray.600'); + const modalBgColor = PROFESSIONAL_COLORS.background.card; + const modalBorderColor = PROFESSIONAL_COLORS.border.default; // 关闭弹窗并清空状态 const handleCloseModal = () => { @@ -638,31 +639,38 @@ const TransmissionChainAnalysis = ({ eventId }) => { return ( {/* 统计信息条 */} - + - 总节点数 - {stats.totalNodes} + 总节点数 + {stats.totalNodes} - 涉及行业 - {stats.involvedIndustries} + 涉及行业 + {stats.involvedIndustries} - 相关公司 - {stats.relatedCompanies} + 相关公司 + {stats.relatedCompanies} - 正向影响 - {stats.positiveImpact} + 正向影响 + {stats.positiveImpact} - 负向影响 - {stats.negativeImpact} + 负向影响 + {stats.negativeImpact} - 循环效应 - {stats.circularEffect} + 循环效应 + {stats.circularEffect} @@ -671,7 +679,14 @@ const TransmissionChainAnalysis = ({ eventId }) => { {Object.entries(NODE_STYLES).map(([type, style]) => ( - + {NODE_TYPE_LABELS[type] || type} @@ -682,16 +697,28 @@ const TransmissionChainAnalysis = ({ eventId }) => { {/* 视图切换按钮 */} @@ -705,7 +732,15 @@ const TransmissionChainAnalysis = ({ eventId }) => { )} {error && ( - + {error} @@ -714,22 +749,30 @@ const TransmissionChainAnalysis = ({ eventId }) => { {!loading && !error && ( {/* 提示信息 */} - + - + 点击图表中的节点可以查看详细信息 - + {/* 图表容器 */} - @@ -785,9 +828,16 @@ const TransmissionChainAnalysis = ({ eventId }) => { - {selectedNode ? '节点详情' : '传导链分析'} + {selectedNode ? '节点详情' : '传导链分析'} {selectedNode && ( - {NODE_TYPE_LABELS[selectedNode.extra?.node_type] || selectedNode.extra?.node_type} + + {NODE_TYPE_LABELS[selectedNode.extra?.node_type] || selectedNode.extra?.node_type} + )} @@ -798,50 +848,103 @@ const TransmissionChainAnalysis = ({ eventId }) => { {/* 节点基本信息 */} - 基本信息 + 基本信息 - 名称: {selectedNode.name} + + 名称: {selectedNode.name} + {selectedNode.extra?.is_main_event && ( - 主事件 + + 主事件 + )} - - 类型: {NODE_TYPE_LABELS[selectedNode.extra?.node_type] || selectedNode.extra?.node_type} - 重要性评分: {selectedNode.extra?.importance_score || 'N/A'} - + + + 类型: {NODE_TYPE_LABELS[selectedNode.extra?.node_type] || selectedNode.extra?.node_type} + + + 重要性评分: {selectedNode.extra?.importance_score || 'N/A'} + + {selectedNode.extra?.stock_code && ( - 股票代码: - {selectedNode.extra.stock_code} + + 股票代码: + + {selectedNode.extra.stock_code} + )} {nodeDetail ? ( - + 总连接: {nodeDetail.node.total_connections || 0} - + 来源: {nodeDetail.node.incoming_connections || 0} - + 目标: {nodeDetail.node.outgoing_connections || 0} ) : ( - - 总连接: {graphData ? graphData.edges.filter(e => + + 总连接: {graphData ? graphData.edges.filter(e => String(e.source) === String(selectedNode.id) || String(e.target) === String(selectedNode.id) ).length : 0} - - 来源: {graphData ? graphData.edges.filter(e => + + 来源: {graphData ? graphData.edges.filter(e => String(e.target) === String(selectedNode.id) ).length : 0} - - 目标: {graphData ? graphData.edges.filter(e => + + 目标: {graphData ? graphData.edges.filter(e => String(e.source) === String(selectedNode.id) ).length : 0} @@ -853,14 +956,14 @@ const TransmissionChainAnalysis = ({ eventId }) => { {/* 节点描述 */} {selectedNode.extra?.description && ( - 描述 + 描述 { {/* 传导路径 */} {transmissionPath && transmissionPath.length > 0 && ( - 传导路径 - + 传导路径 + {transmissionPath.map((node, index) => ( - + {index === 0 && '🚀 '} {index === transmissionPath.length - 1 && '🎯 '} {index > 0 && index < transmissionPath.length - 1 && '➡️ '} @@ -906,19 +1015,38 @@ const TransmissionChainAnalysis = ({ eventId }) => { if (sourcesFromAPI) { return ( - + 影响来源 ({nodeDetail.parents.length})(AI合成) {nodeDetail.parents.map((parent, index) => ( - + {parent.direction && ( @@ -928,11 +1056,26 @@ const TransmissionChainAnalysis = ({ eventId }) => { )} {parent.is_circular && ( - 🔄 循环 + + 🔄 循环 + )} - {parent.name} + + {parent.name} + {parent.transmission_mechanism?.data ? (