diff --git a/src/views/EventDetail/components/HistoricalEvents.js b/src/views/EventDetail/components/HistoricalEvents.js index b594670f..5ba45fa9 100644 --- a/src/views/EventDetail/components/HistoricalEvents.js +++ b/src/views/EventDetail/components/HistoricalEvents.js @@ -31,6 +31,7 @@ import { } from 'react-icons/fa'; import { stockService } from '../../../services/eventService'; import { logger } from '../../../utils/logger'; +import CitedContent from '../../../components/Citation/CitedContent'; const HistoricalEvents = ({ events = [], @@ -224,8 +225,8 @@ const HistoricalEvents = ({ )} - {/* 历史事件卡片网格 */} - + {/* 历史事件卡片列表 - 混合布局 */} + {events.map((event) => { const importanceColor = getImportanceColor(event.importance); @@ -235,92 +236,126 @@ const HistoricalEvents = ({ bg={cardBg} borderWidth="1px" borderColor={borderColor} - borderRadius="md" - p={4} + borderRadius="lg" + position="relative" + overflow="visible" cursor="pointer" onClick={() => handleCardClick(event)} + _before={{ + content: '""', + position: 'absolute', + top: 0, + left: 0, + right: 0, + height: '3px', + bgGradient: 'linear(to-r, blue.400, purple.500, pink.500)', + borderTopLeftRadius: 'lg', + borderTopRightRadius: 'lg', + }} _hover={{ boxShadow: 'lg', borderColor: 'blue.400', - transform: 'translateY(-2px)', }} transition="all 0.2s" > - - {/* 事件名称 */} - { - e.stopPropagation(); - handleCardClick(event); - }} - _hover={{ textDecoration: 'underline' }} - > - {event.title || '未命名事件'} - - - {/* 日期 + Badges */} - - - {formatDate(getEventDate(event))} - - - ({getRelativeTime(getEventDate(event))}) - - {event.relevance && ( - - 相关度: {event.relevance} - - )} - {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" + + {/* 顶部区域:左侧(标题+时间) + 右侧(按钮) */} + + {/* 左侧:标题 + 时间信息(允许折行) */} + + {/* 标题 */} + { + e.stopPropagation(); + handleCardClick(event); + }} + _hover={{ textDecoration: 'underline' }} > - 涨幅: {event.avg_change_pct > 0 ? '+' : ''}{event.avg_change_pct.toFixed(2)}% - - )} + {event.title || '未命名事件'} + + + {/* 时间 + 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" + > + 涨幅: {event.avg_change_pct > 0 ? '+' : ''}{event.avg_change_pct.toFixed(2)}% + + )} + + + + {/* 右侧:相关股票按钮 */} + - {/* 事件描述 */} - - {getEventContent(event) ? `${getEventContent(event)}(AI合成)` : '暂无内容'} - - - {/* 相关股票按钮 */} - + {/* 底部:描述(独占整行)- 升级和降级处理 */} + + {(() => { + const content = getEventContent(event); + // 检查是否有 data 结构(升级版本) + if (content && typeof content === 'object' && content.data) { + return ( + + ); + } + // 降级版本:纯文本 + return ( + + {content ? `${content}(AI合成)` : '暂无内容'} + + ); + })()} + ); })} - + {/* 相关股票 Modal - 条件渲染 */} {stocksModalOpen && (