diff --git a/src/views/Community/components/DynamicNewsDetailPanel.js b/src/views/Community/components/DynamicNewsDetailPanel.js deleted file mode 100644 index 2bb56d21..00000000 --- a/src/views/Community/components/DynamicNewsDetailPanel.js +++ /dev/null @@ -1,201 +0,0 @@ -// src/views/Community/components/DynamicNewsDetailPanel.js -// 动态新闻详情面板组件(固定展示,非弹窗) - -import React from 'react'; -import { - Box, - Card, - CardBody, - VStack, - HStack, - Text, - Badge, - Tag, - Divider, - Heading, - List, - ListItem, - Button, - useColorModeValue, -} from '@chakra-ui/react'; -import moment from 'moment'; -import { getImportanceConfig } from '../../../constants/importanceLevels'; -import HistoricalEvents from '../../EventDetail/components/HistoricalEvents'; -import TransmissionChainAnalysis from '../../EventDetail/components/TransmissionChainAnalysis'; -import { eventService } from '../../../services/eventService'; - -/** - * 动态新闻详情面板组件 - * @param {Object} props - * @param {Object} props.event - 事件对象(包含详情数据) - */ -const DynamicNewsDetailPanel = ({ event }) => { - const cardBg = useColorModeValue('white', 'gray.800'); - const borderColor = useColorModeValue('gray.200', 'gray.700'); - const headingColor = useColorModeValue('gray.700', 'gray.200'); - const textColor = useColorModeValue('gray.600', 'gray.400'); - - if (!event) { - return ( - - - 请选择一个事件查看详情 - - - ); - } - - const importance = getImportanceConfig(event.importance); - - // 渲染涨跌幅标签 - const renderPriceTag = (value, label) => { - if (value === null || value === undefined) return `${label}: --`; - - const color = value > 0 ? 'red' : value < 0 ? 'green' : 'gray'; - const prefix = value > 0 ? '+' : ''; - - return ( - - {label}: {prefix}{value.toFixed(2)}% - - ); - }; - - return ( - - - - {/* 标题 */} - - {event.title} - - - - - {/* 基本信息 */} - - - - 创建时间: - {moment(event.created_at).format('YYYY-MM-DD HH:mm:ss')} - - - 重要性: - - {importance.level}级 - - - - 浏览数:{event.view_count || 0} - - - - {/* 涨跌幅统计 */} - - {renderPriceTag(event.related_avg_chg, '平均涨幅')} - {renderPriceTag(event.related_max_chg, '最大涨幅')} - {renderPriceTag(event.related_week_chg, '周涨幅')} - - - - - - {/* 事件描述 */} - {event.description && ( - - - 事件描述 - - - {event.description} - - - )} - - {/* 相关概念 */} - {event.keywords && event.keywords.length > 0 && ( - - - 相关概念 - - - {event.keywords.map((keyword, index) => ( - - {keyword} - - ))} - - - )} - - {/* 相关股票 */} - {event.related_stocks && event.related_stocks.length > 0 && ( - - - 相关股票 - - - {event.related_stocks.map((stock, index) => ( - - - - - {stock.stock_name} ({stock.stock_code}) - - - {stock.relation_desc || '相关股票'} - - - - - - ))} - - - )} - - {/* 历史事件对比 */} - - - 历史事件对比 - - - - - {/* 传导链分析 */} - - - 传导链分析 - - - - - - - ); -}; - -export default DynamicNewsDetailPanel;