事件中心有引用的相关详情样式调整

This commit is contained in:
2025-11-10 10:18:55 +08:00
parent 800151771c
commit fbf6813615
2 changed files with 71 additions and 31 deletions

View File

@@ -125,7 +125,7 @@ const StockListItem = ({
transition="all 0.2s"
>
{/* 单行紧凑布局:名称+涨跌幅 | 分时图 | K线图 | 关联描述 */}
<HStack spacing={3} align="stretch">
<HStack spacing={3} align="stretch" flexWrap="wrap">
{/* 左侧:股票代码 + 名称 + 涨跌幅(垂直排列) - 收窄 */}
<VStack
align="stretch"
@@ -189,9 +189,11 @@ const StockListItem = ({
</HStack>
</VStack>
{/* 分时图 - 固定宽度 */}
{/* 分时图 - 响应式宽度 */}
<Box
w="160px"
minW="140px"
maxW="160px"
flex="1"
maxH="50px"
h="auto"
borderWidth="1px"
@@ -204,8 +206,9 @@ const StockListItem = ({
setIsModalOpen(true);
}}
cursor="pointer"
flexShrink={0}
flexShrink={1}
alignSelf="center"
overflow="hidden"
_hover={{
borderColor: useColorModeValue('blue.300', 'blue.500'),
boxShadow: 'sm'
@@ -217,18 +220,23 @@ const StockListItem = ({
color={useColorModeValue('blue.700', 'blue.200')}
mb={1}
fontWeight="semibold"
whiteSpace="nowrap"
>
📈 分时
</Text>
<MiniTimelineChart
stockCode={stock.stock_code}
eventTime={eventTime}
/>
<Box overflow="hidden">
<MiniTimelineChart
stockCode={stock.stock_code}
eventTime={eventTime}
/>
</Box>
</Box>
{/* K线图 - 固定宽度 */}
{/* K线图 - 响应式宽度 */}
<Box
w="160px"
minW="140px"
maxW="160px"
flex="1"
maxH="50px"
h="auto"
borderWidth="1px"
@@ -241,8 +249,9 @@ const StockListItem = ({
setIsModalOpen(true);
}}
cursor="pointer"
flexShrink={0}
flexShrink={1}
alignSelf="center"
overflow="hidden"
_hover={{
borderColor: useColorModeValue('purple.300', 'purple.500'),
boxShadow: 'sm'
@@ -254,30 +263,61 @@ const StockListItem = ({
color={useColorModeValue('purple.700', 'purple.200')}
mb={1}
fontWeight="semibold"
whiteSpace="nowrap"
>
📊 日线
</Text>
<MiniKLineChart
stockCode={stock.stock_code}
eventTime={eventTime}
/>
<Box overflow="hidden">
<MiniKLineChart
stockCode={stock.stock_code}
eventTime={eventTime}
/>
</Box>
</Box>
{/* 关联描述 - 升级和降级处理 */}
{stock.relation_desc && (
<Box flex={1} minW={0}>
{stock.relation_desc?.data ? (
// 升级:带引用来源的版本
<CitedContent
data={stock.relation_desc}
title=""
showAIBadge={true}
containerStyle={{
backgroundColor: useColorModeValue('#f7fafc', 'rgba(45, 55, 72, 0.6)'),
borderRadius: '8px',
padding: '0',
}}
/>
// 升级:带引用来源的版本 - 添加折叠功能
<Tooltip
label={isDescExpanded ? "点击收起" : "点击展开完整描述"}
placement="top"
hasArrow
bg="gray.600"
color="white"
fontSize="xs"
>
<Box
onClick={(e) => {
e.stopPropagation();
setIsDescExpanded(!isDescExpanded);
}}
cursor="pointer"
px={3}
py={2}
bg={useColorModeValue('gray.50', 'gray.700')}
borderRadius="md"
_hover={{
bg: useColorModeValue('gray.100', 'gray.600'),
}}
transition="background 0.2s"
position="relative"
>
<Collapse in={isDescExpanded} startingHeight={40}>
<CitedContent
data={stock.relation_desc}
title=""
showAIBadge={true}
containerStyle={{
backgroundColor: 'transparent',
borderRadius: '0',
padding: '0',
}}
/>
</Collapse>
</Box>
</Tooltip>
) : (
// 降级:纯文本版本(保留展开/收起功能)
<Tooltip