From 1f592b6775b61051fc2fe9e9603b116a69da2c6c Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Wed, 3 Dec 2025 08:34:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E8=82=A1=E7=A5=A8=E9=BB=98=E8=AE=A4=E5=B1=95=E5=BC=80=E5=92=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B6=85=E9=A2=84=E6=9C=9F=E5=BE=97=E5=88=86?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复事件切换时相关股票被设为折叠的问题,改为默认展开 - 在事件详情面板中添加超预期得分显示(带进度条和配色) - 超预期得分显示在事件描述下方、相关股票上方 --- .../DynamicNewsDetailPanel.js | 78 ++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/src/views/Community/components/DynamicNewsDetail/DynamicNewsDetailPanel.js b/src/views/Community/components/DynamicNewsDetail/DynamicNewsDetailPanel.js index 686b7e1e..a96594bb 100644 --- a/src/views/Community/components/DynamicNewsDetail/DynamicNewsDetailPanel.js +++ b/src/views/Community/components/DynamicNewsDetail/DynamicNewsDetailPanel.js @@ -8,14 +8,18 @@ import { Card, CardBody, VStack, + HStack, Text, Spinner, Center, Wrap, WrapItem, + Icon, + Progress, useColorModeValue, useToast, } from '@chakra-ui/react'; +import { FaChartLine } from 'react-icons/fa'; import { getImportanceConfig } from '../../../../constants/importanceLevels'; import { eventService } from '../../../../services/eventService'; import { useEventStocks } from '../StockDetailPanel/hooks/useEventStocks'; @@ -225,8 +229,8 @@ const DynamicNewsDetailPanel = ({ event, showHeader = true }) => { setHasLoadedHistorical(false); setHasLoadedTransmission(false); - // 相关股票默认折叠,但预加载股票列表(显示数量吸引点击) - setIsStocksOpen(false); + // 相关股票默认展开,预加载股票列表 + setIsStocksOpen(true); if (canAccessStocks) { console.log('%c📊 [相关股票] 事件切换,预加载股票列表(获取数量)', 'color: #10B981; font-weight: bold;', { eventId: event?.id }); loadStocksData(); @@ -332,6 +336,76 @@ const DynamicNewsDetailPanel = ({ event, showHeader = true }) => { {/* 事件描述 */} + {/* 超预期得分显示 - 参考历史事件对比的样式 */} + {expectationScore != null && expectationScore > 0 && ( + = 60 ? 'red.50' : expectationScore >= 40 ? 'orange.50' : 'yellow.50', + expectationScore >= 60 ? 'red.900' : expectationScore >= 40 ? 'orange.900' : 'yellow.900' + )} + borderColor={useColorModeValue( + expectationScore >= 60 ? 'red.200' : expectationScore >= 40 ? 'orange.200' : 'yellow.200', + expectationScore >= 60 ? 'red.700' : expectationScore >= 40 ? 'orange.700' : 'yellow.700' + )} + borderWidth="1px" + borderRadius="md" + > + + + = 60 ? 'red.600' : expectationScore >= 40 ? 'orange.600' : 'yellow.600', + expectationScore >= 60 ? 'red.300' : expectationScore >= 40 ? 'orange.300' : 'yellow.300' + )} + boxSize="18px" + /> + = 60 ? 'red.700' : expectationScore >= 40 ? 'orange.700' : 'yellow.800', + expectationScore >= 60 ? 'red.200' : expectationScore >= 40 ? 'orange.200' : 'yellow.200' + )} + > + 超预期得分 + + + + = 60 ? 'red' : expectationScore >= 40 ? 'orange' : 'yellow'} + borderRadius="full" + bg={useColorModeValue('gray.200', 'gray.600')} + /> + = 60 ? 'red.600' : expectationScore >= 40 ? 'orange.600' : 'yellow.700', + expectationScore >= 60 ? 'red.300' : expectationScore >= 40 ? 'orange.300' : 'yellow.300' + )} + minW="40px" + textAlign="right" + > + {expectationScore} + + + + + 基于历史事件判断当前事件的超预期情况,满分100分 + + + )} + {/* 相关股票(可折叠) - 懒加载 - 需要 PRO 权限 - 支持精简/详细模式 */}