feat: 相关股票添加合规
This commit is contained in:
@@ -12,12 +12,14 @@ import {
|
|||||||
IconButton,
|
IconButton,
|
||||||
Collapse,
|
Collapse,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
Badge,
|
||||||
useColorModeValue,
|
useColorModeValue,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { StarIcon } from '@chakra-ui/icons';
|
import { StarIcon } from '@chakra-ui/icons';
|
||||||
import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart';
|
import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart';
|
||||||
import MiniKLineChart from './MiniKLineChart';
|
import MiniKLineChart from './MiniKLineChart';
|
||||||
import StockChartModal from '../../../../components/StockChart/StockChartModal';
|
import StockChartModal from '../../../../components/StockChart/StockChartModal';
|
||||||
|
import CitedContent from '../../../../components/Citation/CitedContent';
|
||||||
import { getChangeColor } from '../../../../utils/colorUtils';
|
import { getChangeColor } from '../../../../utils/colorUtils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,7 +106,7 @@ const StockListItem = ({
|
|||||||
borderRadius="lg"
|
borderRadius="lg"
|
||||||
p={3}
|
p={3}
|
||||||
position="relative"
|
position="relative"
|
||||||
overflow="hidden"
|
overflow="visible"
|
||||||
_before={{
|
_before={{
|
||||||
content: '""',
|
content: '""',
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
@@ -113,6 +115,8 @@ const StockListItem = ({
|
|||||||
right: 0,
|
right: 0,
|
||||||
height: '3px',
|
height: '3px',
|
||||||
bgGradient: 'linear(to-r, blue.400, purple.500, pink.500)',
|
bgGradient: 'linear(to-r, blue.400, purple.500, pink.500)',
|
||||||
|
borderTopLeftRadius: 'lg',
|
||||||
|
borderTopRightRadius: 'lg',
|
||||||
}}
|
}}
|
||||||
_hover={{
|
_hover={{
|
||||||
boxShadow: 'lg',
|
boxShadow: 'lg',
|
||||||
@@ -241,55 +245,73 @@ const StockListItem = ({
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* 关联描述(单行显示,点击展开)- 占据更多空间 */}
|
{/* 关联描述 - 升级和降级处理 */}
|
||||||
{relationText && relationText !== '--' && (
|
{stock.relation_desc && (
|
||||||
<Tooltip
|
<Box flex={1} minW={0}>
|
||||||
label={isDescExpanded ? "点击收起" : "点击展开完整描述"}
|
{stock.relation_desc?.data ? (
|
||||||
placement="top"
|
// 升级:带引用来源的版本
|
||||||
hasArrow
|
<CitedContent
|
||||||
bg="gray.600"
|
data={stock.relation_desc}
|
||||||
color="white"
|
title=""
|
||||||
fontSize="xs"
|
showAIBadge={true}
|
||||||
>
|
containerStyle={{
|
||||||
<Box
|
backgroundColor: useColorModeValue('#f7fafc', 'rgba(45, 55, 72, 0.6)'),
|
||||||
flex={1}
|
borderRadius: '8px',
|
||||||
minW={0}
|
padding: '0',
|
||||||
onClick={(e) => {
|
}}
|
||||||
e.stopPropagation();
|
/>
|
||||||
setIsDescExpanded(!isDescExpanded);
|
) : (
|
||||||
}}
|
// 降级:纯文本版本(保留展开/收起功能)
|
||||||
cursor="pointer"
|
<Tooltip
|
||||||
px={3}
|
label={isDescExpanded ? "点击收起" : "点击展开完整描述"}
|
||||||
py={2}
|
placement="top"
|
||||||
bg={useColorModeValue('gray.50', 'gray.700')}
|
hasArrow
|
||||||
borderRadius="md"
|
bg="gray.600"
|
||||||
_hover={{
|
color="white"
|
||||||
bg: useColorModeValue('gray.100', 'gray.600'),
|
fontSize="xs"
|
||||||
}}
|
>
|
||||||
transition="background 0.2s"
|
<Box
|
||||||
>
|
onClick={(e) => {
|
||||||
{/* 去掉"关联描述"标题 */}
|
e.stopPropagation();
|
||||||
<Collapse in={isDescExpanded} startingHeight={40}>
|
setIsDescExpanded(!isDescExpanded);
|
||||||
<Text
|
}}
|
||||||
fontSize="sm"
|
cursor="pointer"
|
||||||
color={nameColor}
|
px={3}
|
||||||
lineHeight="1.6"
|
py={2}
|
||||||
|
bg={useColorModeValue('gray.50', 'gray.700')}
|
||||||
|
borderRadius="md"
|
||||||
|
_hover={{
|
||||||
|
bg: useColorModeValue('gray.100', 'gray.600'),
|
||||||
|
}}
|
||||||
|
transition="background 0.2s"
|
||||||
|
position="relative"
|
||||||
>
|
>
|
||||||
{relationText}
|
{/* 去掉"关联描述"标题 */}
|
||||||
</Text>
|
<Collapse in={isDescExpanded} startingHeight={40}>
|
||||||
</Collapse>
|
<Text
|
||||||
{isDescExpanded && (
|
fontSize="sm"
|
||||||
<Text
|
color={nameColor}
|
||||||
fontSize="xs"
|
lineHeight="1.6"
|
||||||
color="gray.500"
|
>
|
||||||
mt={2}
|
{relationText}
|
||||||
fontStyle="italic"
|
</Text>
|
||||||
>
|
</Collapse>
|
||||||
⚠️ AI生成,仅供参考
|
|
||||||
</Text>
|
{/* 提示信息 */}
|
||||||
)}
|
{isDescExpanded && (
|
||||||
</Box>
|
<Text
|
||||||
</Tooltip>
|
fontSize="xs"
|
||||||
|
color="gray.500"
|
||||||
|
mt={2}
|
||||||
|
fontStyle="italic"
|
||||||
|
>
|
||||||
|
⚠️ AI生成,仅供参考
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
)}
|
)}
|
||||||
</HStack>
|
</HStack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user