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,8 +245,23 @@ const StockListItem = ({
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</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
|
<Tooltip
|
||||||
label={isDescExpanded ? "点击收起" : "点击展开完整描述"}
|
label={isDescExpanded ? "点击收起" : "点击展开完整描述"}
|
||||||
placement="top"
|
placement="top"
|
||||||
@@ -252,8 +271,6 @@ const StockListItem = ({
|
|||||||
fontSize="xs"
|
fontSize="xs"
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
flex={1}
|
|
||||||
minW={0}
|
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setIsDescExpanded(!isDescExpanded);
|
setIsDescExpanded(!isDescExpanded);
|
||||||
@@ -267,6 +284,7 @@ const StockListItem = ({
|
|||||||
bg: useColorModeValue('gray.100', 'gray.600'),
|
bg: useColorModeValue('gray.100', 'gray.600'),
|
||||||
}}
|
}}
|
||||||
transition="background 0.2s"
|
transition="background 0.2s"
|
||||||
|
position="relative"
|
||||||
>
|
>
|
||||||
{/* 去掉"关联描述"标题 */}
|
{/* 去掉"关联描述"标题 */}
|
||||||
<Collapse in={isDescExpanded} startingHeight={40}>
|
<Collapse in={isDescExpanded} startingHeight={40}>
|
||||||
@@ -278,6 +296,8 @@ const StockListItem = ({
|
|||||||
{relationText}
|
{relationText}
|
||||||
</Text>
|
</Text>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
|
|
||||||
|
{/* 提示信息 */}
|
||||||
{isDescExpanded && (
|
{isDescExpanded && (
|
||||||
<Text
|
<Text
|
||||||
fontSize="xs"
|
fontSize="xs"
|
||||||
@@ -291,6 +311,8 @@ const StockListItem = ({
|
|||||||
</Box>
|
</Box>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
</HStack>
|
</HStack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user