+ {/* AI 标识 - 行内显示在文字前面 */}
+ {showAIBadge && (
+
}
+ color="purple"
+ style={{
+ fontSize: 12,
+ padding: '2px 8px',
+ marginRight: 8,
+ verticalAlign: 'middle',
+ display: 'inline-flex',
+ }}
+ className="ai-badge-responsive"
+ >
+ AI合成
+
+ )}
{/* 前缀标签(如果有) */}
{prefix && (
-
+
{/* 顶部区域:左侧(标题+时间) + 右侧(按钮) */}
{/* 左侧:标题 + 时间信息(允许折行) */}
-
+
{/* 标题 */}
{
@@ -290,27 +292,28 @@ const HistoricalEvents = ({
{/* 时间 + Badges(允许折行) */}
-
+
{formatDate(getEventDate(event))}
-
+
({getRelativeTime(getEventDate(event))})
{event.importance && (
-
+
重要性: {event.importance}
)}
{event.avg_change_pct !== undefined && event.avg_change_pct !== null && (
0 ? 'red' : event.avg_change_pct < 0 ? 'green' : 'gray'}
- size="sm"
+ fontSize="xs"
+ px={2}
>
涨幅: {event.avg_change_pct > 0 ? '+' : ''}{event.avg_change_pct.toFixed(2)}%
)}
{event.similarity !== undefined && event.similarity !== null && (
-
+
相关度: {event.similarity}
)}
@@ -344,10 +347,9 @@ const HistoricalEvents = ({
data={content}
title=""
showAIBadge={true}
- textColor={PROFESSIONAL_COLORS.text.primary}
+ textColor="#E2E8F0"
containerStyle={{
- backgroundColor: useColorModeValue('#f7fafc', 'rgba(45, 55, 72, 0.6)'),
- borderRadius: '8px',
+ backgroundColor: 'transparent',
padding: '0',
}}
/>
diff --git a/src/views/EventDetail/components/TransmissionChainAnalysis.js b/src/views/EventDetail/components/TransmissionChainAnalysis.js
index ab6896a8..87c4b4a9 100644
--- a/src/views/EventDetail/components/TransmissionChainAnalysis.js
+++ b/src/views/EventDetail/components/TransmissionChainAnalysis.js
@@ -826,8 +826,8 @@ const TransmissionChainAnalysis = ({ eventId }) => {
-
-
+
+
{selectedNode ? '节点详情' : '传导链分析'}
{selectedNode && (
{
)}
-
+
{selectedNode ? (
@@ -1084,11 +1087,15 @@ const TransmissionChainAnalysis = ({ eventId }) => {
prefix="机制:"
prefixStyle={{ fontSize: 12, color: PROFESSIONAL_COLORS.text.secondary, fontWeight: 'bold' }}
textColor={PROFESSIONAL_COLORS.text.primary}
- containerStyle={{ marginTop: 8 }}
+ containerStyle={{
+ marginTop: 8,
+ backgroundColor: 'transparent',
+ padding: 0,
+ }}
showAIBadge={false}
/>
) : parent.transmission_mechanism ? (
-
+
机制: {parent.transmission_mechanism}(AI合成)
) : null}
@@ -1105,23 +1112,42 @@ const TransmissionChainAnalysis = ({ eventId }) => {
{/* 影响输出 */}
{(() => {
const targetsFromAPI = nodeDetail && nodeDetail.children && nodeDetail.children.length > 0;
-
+
if (targetsFromAPI) {
return (
-
- 影响输出 ({nodeDetail.children.length})
+
+ 影响输出 ({nodeDetail.children.length})(AI合成)
{nodeDetail.children.map((child, index) => (
-
+
{child.direction && (
@@ -1132,7 +1158,7 @@ const TransmissionChainAnalysis = ({ eventId }) => {
)}
- {child.name}
+ {child.name}
{child.transmission_mechanism?.data ? (
{
prefix="机制:"
prefixStyle={{ fontSize: 12, color: PROFESSIONAL_COLORS.text.secondary, fontWeight: 'bold' }}
textColor={PROFESSIONAL_COLORS.text.primary}
- containerStyle={{ marginTop: 8 }}
+ containerStyle={{
+ marginTop: 8,
+ backgroundColor: 'transparent',
+ padding: 0,
+ }}
showAIBadge={false}
/>
) : child.transmission_mechanism ? (
-
+
机制: {child.transmission_mechanism}(AI合成)
) : null}
@@ -1169,7 +1199,14 @@ const TransmissionChainAnalysis = ({ eventId }) => {
-
+
From cf4fdf6a683b417d526e1b3c188ee7f512d5c98b Mon Sep 17 00:00:00 2001
From: zdl <3489966805@qq.com>
Date: Fri, 28 Nov 2025 07:14:52 +0800
Subject: [PATCH 13/13] =?UTF-8?q?feat:=20=E4=BC=A0=E5=AF=BC=E7=BB=83UI?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/TransmissionChainAnalysis.js | 245 ++++++++++--------
1 file changed, 135 insertions(+), 110 deletions(-)
diff --git a/src/views/EventDetail/components/TransmissionChainAnalysis.js b/src/views/EventDetail/components/TransmissionChainAnalysis.js
index 87c4b4a9..cfe86023 100644
--- a/src/views/EventDetail/components/TransmissionChainAnalysis.js
+++ b/src/views/EventDetail/components/TransmissionChainAnalysis.js
@@ -1,18 +1,18 @@
import React, { useEffect, useState, useRef } from 'react';
-import {
- Box,
- Button,
- Flex,
- Spinner,
- Alert,
- AlertIcon,
- Text,
- Stat,
- StatLabel,
- StatNumber,
- HStack,
- VStack,
- Tag,
+import {
+ Box,
+ Button,
+ Flex,
+ Spinner,
+ Alert,
+ AlertIcon,
+ Text,
+ Stat,
+ StatLabel,
+ StatNumber,
+ HStack,
+ VStack,
+ Tag,
Badge,
List,
ListItem,
@@ -28,9 +28,11 @@ import {
ModalCloseButton,
Icon,
useColorModeValue,
- Tooltip
+ Tooltip,
+ Center
} from '@chakra-ui/react';
import { InfoIcon, ViewIcon } from '@chakra-ui/icons';
+import { Share2, GitBranch, Inbox } from 'lucide-react';
import ReactECharts from 'echarts-for-react';
import { eventService } from '../../../services/eventService';
import CitedContent from '../../../components/Citation/CitedContent';
@@ -637,7 +639,7 @@ const TransmissionChainAnalysis = ({ eventId }) => {
};
return (
-
+
{/* 统计信息条 */}
{
borderColor={PROFESSIONAL_COLORS.border.default}
bg={PROFESSIONAL_COLORS.background.secondary}
>
-
-
- 总节点数
- {stats.totalNodes}
+
+
+ 总节点数
+ {stats.totalNodes}
-
- 涉及行业
- {stats.involvedIndustries}
+
+ 涉及行业
+ {stats.involvedIndustries}
-
- 相关公司
- {stats.relatedCompanies}
+
+ 相关公司
+ {stats.relatedCompanies}
-
- 正向影响
- {stats.positiveImpact}
+
+ 正向影响
+ {stats.positiveImpact}
-
- 负向影响
- {stats.negativeImpact}
+
+ 负向影响
+ {stats.negativeImpact}
-
- 循环效应
- {stats.circularEffect}
+
+ 循环效应
+ {stats.circularEffect}
-
+
{/* 自定义图例 */}
-
-
- {Object.entries(NODE_STYLES).map(([type, style]) => (
-
-
- {NODE_TYPE_LABELS[type] || type}
-
- ))}
-
-
+
+ {Object.entries(NODE_STYLES).map(([type, style]) => (
+
+
+ {NODE_TYPE_LABELS[type] || type}
+
+ ))}
+
{/* 视图切换按钮 */}
}
bg={viewMode === 'graph' ? PROFESSIONAL_COLORS.gold[500] : PROFESSIONAL_COLORS.background.secondary}
color={viewMode === 'graph' ? 'black' : PROFESSIONAL_COLORS.text.primary}
_hover={{
@@ -710,6 +713,7 @@ const TransmissionChainAnalysis = ({ eventId }) => {
力导向图
}
bg={viewMode === 'sankey' ? PROFESSIONAL_COLORS.gold[500] : PROFESSIONAL_COLORS.background.secondary}
color={viewMode === 'sankey' ? 'black' : PROFESSIONAL_COLORS.text.primary}
_hover={{
@@ -722,7 +726,6 @@ const TransmissionChainAnalysis = ({ eventId }) => {
>
桑基图
-
{loading && (
@@ -748,79 +751,101 @@ const TransmissionChainAnalysis = ({ eventId }) => {
{!loading && !error && (
- {/* 提示信息 */}
-
-
-
-
- 点击图表中的节点可以查看详细信息
-
-
-
- {/* 图表容器 */}
+ {/* 图表容器 - 宽高比 2:1,H5 自适应 */}
+
+ {/* 提示信息 - 固定在左上角 */}
+
+
+ 点击节点查看详情
+
{chartReady && (
<>
- {viewMode === 'graph' ? (
- {
- // 减少不必要的重新渲染
- return JSON.stringify(prevProps.option) !== JSON.stringify(props.option);
- }}
- />
+ {/* 空状态提示 */}
+ {(viewMode === 'graph' && (!graphData || !graphData.nodes || graphData.nodes.length === 0)) ||
+ (viewMode === 'sankey' && (!sankeyData || !sankeyData.nodes || sankeyData.nodes.length === 0)) ? (
+
+
+
+ 暂无传导链数据
+
+
) : (
- {
- // 减少不必要的重新渲染
- return JSON.stringify(prevProps.option) !== JSON.stringify(props.option);
- }}
- />
+ <>
+ {viewMode === 'graph' ? (
+ {
+ // 减少不必要的重新渲染
+ return JSON.stringify(prevProps.option) !== JSON.stringify(props.option);
+ }}
+ />
+ ) : (
+ {
+ // 减少不必要的重新渲染
+ return JSON.stringify(prevProps.option) !== JSON.stringify(props.option);
+ }}
+ />
+ )}
+ >
)}
>
)}
+
)}
-
+
{/* 节点详情弹窗 */}
{isModalOpen && (