fix: 调整AI合成UI
This commit is contained in:
@@ -16,13 +16,14 @@ import {
|
|||||||
useColorModeValue,
|
useColorModeValue,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { StarIcon } from '@chakra-ui/icons';
|
import { StarIcon } from '@chakra-ui/icons';
|
||||||
|
import { Tag } from 'antd';
|
||||||
|
import { RobotOutlined } from '@ant-design/icons';
|
||||||
import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart';
|
import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart';
|
||||||
import MiniKLineChart from './MiniKLineChart';
|
import MiniKLineChart from './MiniKLineChart';
|
||||||
import TimelineChartModal from '../../../../components/StockChart/TimelineChartModal';
|
import TimelineChartModal from '@components/StockChart/TimelineChartModal';
|
||||||
import KLineChartModal from '../../../../components/StockChart/KLineChartModal';
|
import KLineChartModal from '@components/StockChart/KLineChartModal';
|
||||||
import CitedContent from '../../../../components/Citation/CitedContent';
|
import { getChangeColor } from '@utils/colorUtils';
|
||||||
import { getChangeColor } from '../../../../utils/colorUtils';
|
import { PROFESSIONAL_COLORS } from '@constants/professionalTheme';
|
||||||
import { PROFESSIONAL_COLORS } from '../../../../constants/professionalTheme';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 股票卡片组件
|
* 股票卡片组件
|
||||||
@@ -130,7 +131,7 @@ const StockListItem = ({
|
|||||||
{/* 单行紧凑布局:名称+涨跌幅 | 分时图 | K线图 | 关联描述 */}
|
{/* 单行紧凑布局:名称+涨跌幅 | 分时图 | K线图 | 关联描述 */}
|
||||||
<HStack spacing={2} align="center" flexWrap="wrap">
|
<HStack spacing={2} align="center" flexWrap="wrap">
|
||||||
{/* 左侧:股票信息区 */}
|
{/* 左侧:股票信息区 */}
|
||||||
<HStack spacing={2} flexShrink={0}>
|
<HStack spacing={2} overflow="hidden">
|
||||||
{/* 股票代码 + 名称 + 涨跌幅 */}
|
{/* 股票代码 + 名称 + 涨跌幅 */}
|
||||||
<VStack
|
<VStack
|
||||||
align="stretch"
|
align="stretch"
|
||||||
@@ -298,8 +299,6 @@ const StockListItem = ({
|
|||||||
setIsDescExpanded(!isDescExpanded);
|
setIsDescExpanded(!isDescExpanded);
|
||||||
}}
|
}}
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
px={3}
|
|
||||||
py={2}
|
|
||||||
bg={PROFESSIONAL_COLORS.background.secondary}
|
bg={PROFESSIONAL_COLORS.background.secondary}
|
||||||
borderRadius="md"
|
borderRadius="md"
|
||||||
_hover={{
|
_hover={{
|
||||||
@@ -308,18 +307,30 @@ const StockListItem = ({
|
|||||||
transition="background 0.2s"
|
transition="background 0.2s"
|
||||||
position="relative"
|
position="relative"
|
||||||
>
|
>
|
||||||
<Collapse in={isDescExpanded} startingHeight={40}>
|
<Collapse in={isDescExpanded} startingHeight={56}>
|
||||||
<CitedContent
|
{/* AI 标识 - 行内显示在文字前面 */}
|
||||||
data={stock.relation_desc}
|
<Tag
|
||||||
title=""
|
icon={<RobotOutlined />}
|
||||||
showAIBadge={true}
|
color="purple"
|
||||||
textColor={PROFESSIONAL_COLORS.text.primary}
|
style={{
|
||||||
containerStyle={{
|
fontSize: 12,
|
||||||
backgroundColor: 'transparent',
|
padding: '2px 8px',
|
||||||
borderRadius: '0',
|
marginRight: 8,
|
||||||
padding: '0',
|
verticalAlign: 'middle',
|
||||||
|
display: 'inline-flex',
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
AI合成
|
||||||
|
</Tag>
|
||||||
|
{/* 直接渲染文字内容 */}
|
||||||
|
<Text
|
||||||
|
as="span"
|
||||||
|
fontSize="sm"
|
||||||
|
color={PROFESSIONAL_COLORS.text.primary}
|
||||||
|
lineHeight="1.8"
|
||||||
|
>
|
||||||
|
{stock.relation_desc?.data?.map(item => item.sentences || item.query_part).filter(Boolean).join(',')}
|
||||||
|
</Text>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</Box>
|
</Box>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@@ -339,8 +350,6 @@ const StockListItem = ({
|
|||||||
setIsDescExpanded(!isDescExpanded);
|
setIsDescExpanded(!isDescExpanded);
|
||||||
}}
|
}}
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
px={3}
|
|
||||||
py={2}
|
|
||||||
bg={PROFESSIONAL_COLORS.background.secondary}
|
bg={PROFESSIONAL_COLORS.background.secondary}
|
||||||
borderRadius="md"
|
borderRadius="md"
|
||||||
_hover={{
|
_hover={{
|
||||||
@@ -350,7 +359,7 @@ const StockListItem = ({
|
|||||||
position="relative"
|
position="relative"
|
||||||
>
|
>
|
||||||
{/* 去掉"关联描述"标题 */}
|
{/* 去掉"关联描述"标题 */}
|
||||||
<Collapse in={isDescExpanded} startingHeight={36}>
|
<Collapse in={isDescExpanded} startingHeight={56}>
|
||||||
<Text
|
<Text
|
||||||
fontSize="xs"
|
fontSize="xs"
|
||||||
color={nameColor}
|
color={nameColor}
|
||||||
|
|||||||
Reference in New Issue
Block a user