feat: 相关股票添加合规

This commit is contained in:
zdl
2025-11-07 19:29:19 +08:00
parent 44b8c64907
commit 2da71a3c03

View File

@@ -12,12 +12,14 @@ import {
IconButton,
Collapse,
Tooltip,
Badge,
useColorModeValue,
} from '@chakra-ui/react';
import { StarIcon } from '@chakra-ui/icons';
import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart';
import MiniKLineChart from './MiniKLineChart';
import StockChartModal from '../../../../components/StockChart/StockChartModal';
import CitedContent from '../../../../components/Citation/CitedContent';
import { getChangeColor } from '../../../../utils/colorUtils';
/**
@@ -104,7 +106,7 @@ const StockListItem = ({
borderRadius="lg"
p={3}
position="relative"
overflow="hidden"
overflow="visible"
_before={{
content: '""',
position: 'absolute',
@@ -113,6 +115,8 @@ const StockListItem = ({
right: 0,
height: '3px',
bgGradient: 'linear(to-r, blue.400, purple.500, pink.500)',
borderTopLeftRadius: 'lg',
borderTopRightRadius: 'lg',
}}
_hover={{
boxShadow: 'lg',
@@ -241,8 +245,23 @@ const StockListItem = ({
/>
</Box>
{/* 关联描述(单行显示,点击展开)- 占据更多空间 */}
{relationText && relationText !== '--' && (
{/* 关联描述 - 升级和降级处理 */}
{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"
@@ -252,8 +271,6 @@ const StockListItem = ({
fontSize="xs"
>
<Box
flex={1}
minW={0}
onClick={(e) => {
e.stopPropagation();
setIsDescExpanded(!isDescExpanded);
@@ -267,6 +284,7 @@ const StockListItem = ({
bg: useColorModeValue('gray.100', 'gray.600'),
}}
transition="background 0.2s"
position="relative"
>
{/* 去掉"关联描述"标题 */}
<Collapse in={isDescExpanded} startingHeight={40}>
@@ -278,6 +296,8 @@ const StockListItem = ({
{relationText}
</Text>
</Collapse>
{/* 提示信息 */}
{isDescExpanded && (
<Text
fontSize="xs"
@@ -291,6 +311,8 @@ const StockListItem = ({
</Box>
</Tooltip>
)}
</Box>
)}
</HStack>
</Box>