事件中心的涨停原因里面和事件相关
This commit is contained in:
@@ -510,6 +510,8 @@ const DetailModal = ({ isOpen, onClose, selectedDate, ztDetail, events, loading
|
|||||||
name,
|
name,
|
||||||
count: data.count,
|
count: data.count,
|
||||||
stocks: data.stock_codes || [],
|
stocks: data.stock_codes || [],
|
||||||
|
// 新增:关联事件数据(涨停归因)
|
||||||
|
related_events: data.related_events || [],
|
||||||
}))
|
}))
|
||||||
.sort((a, b) => b.count - a.count);
|
.sort((a, b) => b.count - a.count);
|
||||||
}, [ztDetail]);
|
}, [ztDetail]);
|
||||||
@@ -1134,6 +1136,105 @@ const DetailModal = ({ isOpen, onClose, selectedDate, ztDetail, events, loading
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '涨停归因',
|
||||||
|
dataIndex: 'related_events',
|
||||||
|
key: 'related_events',
|
||||||
|
width: 280,
|
||||||
|
render: (events, record) => {
|
||||||
|
if (!events || events.length === 0) {
|
||||||
|
return <AntText style={{ color: '#666', fontSize: '12px' }}>-</AntText>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取相关度最高的事件
|
||||||
|
const sortedEvents = [...events].sort((a, b) => (b.relevance_score || 0) - (a.relevance_score || 0));
|
||||||
|
const topEvent = sortedEvents[0];
|
||||||
|
|
||||||
|
// 相关度颜色
|
||||||
|
const getRelevanceColor = (score) => {
|
||||||
|
if (score >= 80) return '#10B981';
|
||||||
|
if (score >= 60) return '#F59E0B';
|
||||||
|
return '#6B7280';
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<VStack align="start" spacing={1}>
|
||||||
|
<Tooltip
|
||||||
|
title={
|
||||||
|
<Box maxW="300px">
|
||||||
|
<Text fontWeight="bold" mb={1}>{topEvent.title}</Text>
|
||||||
|
{topEvent.relevance_reason && (
|
||||||
|
<Text fontSize="12px" color="#ccc">{topEvent.relevance_reason}</Text>
|
||||||
|
)}
|
||||||
|
{topEvent.matched_concepts?.length > 0 && (
|
||||||
|
<Box mt={2}>
|
||||||
|
<Text fontSize="11px" color="#888" mb={1}>匹配概念:</Text>
|
||||||
|
<HStack flexWrap="wrap" spacing={1}>
|
||||||
|
{topEvent.matched_concepts.slice(0, 5).map((c, i) => (
|
||||||
|
<Tag key={i} style={{ fontSize: '10px', margin: '1px', background: 'rgba(139, 92, 246, 0.2)', border: 'none', color: '#A78BFA' }}>
|
||||||
|
{c}
|
||||||
|
</Tag>
|
||||||
|
))}
|
||||||
|
</HStack>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
}
|
||||||
|
placement="left"
|
||||||
|
overlayStyle={{ maxWidth: 350 }}
|
||||||
|
>
|
||||||
|
<Box
|
||||||
|
cursor="pointer"
|
||||||
|
p={1.5}
|
||||||
|
borderRadius="md"
|
||||||
|
bg="rgba(96, 165, 250, 0.1)"
|
||||||
|
_hover={{ bg: 'rgba(96, 165, 250, 0.2)' }}
|
||||||
|
transition="background 0.2s"
|
||||||
|
maxW="260px"
|
||||||
|
>
|
||||||
|
<HStack spacing={1.5} align="start">
|
||||||
|
<FileText size={14} color="#60A5FA" style={{ flexShrink: 0, marginTop: 2 }} />
|
||||||
|
<VStack align="start" spacing={0.5} flex={1}>
|
||||||
|
<AntText
|
||||||
|
style={{
|
||||||
|
color: '#E0E0E0',
|
||||||
|
fontSize: '12px',
|
||||||
|
lineHeight: '1.3',
|
||||||
|
display: '-webkit-box',
|
||||||
|
WebkitLineClamp: 2,
|
||||||
|
WebkitBoxOrient: 'vertical',
|
||||||
|
overflow: 'hidden',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{topEvent.title}
|
||||||
|
</AntText>
|
||||||
|
<HStack spacing={2}>
|
||||||
|
<Tag
|
||||||
|
style={{
|
||||||
|
fontSize: '10px',
|
||||||
|
padding: '0 6px',
|
||||||
|
background: `${getRelevanceColor(topEvent.relevance_score || 0)}20`,
|
||||||
|
border: 'none',
|
||||||
|
color: getRelevanceColor(topEvent.relevance_score || 0),
|
||||||
|
borderRadius: '4px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
相关度 {topEvent.relevance_score || 0}
|
||||||
|
</Tag>
|
||||||
|
{events.length > 1 && (
|
||||||
|
<AntText style={{ fontSize: '10px', color: '#888' }}>
|
||||||
|
+{events.length - 1}条
|
||||||
|
</AntText>
|
||||||
|
)}
|
||||||
|
</HStack>
|
||||||
|
</VStack>
|
||||||
|
</HStack>
|
||||||
|
</Box>
|
||||||
|
</Tooltip>
|
||||||
|
</VStack>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// 涨停股票详情表格列 - 精致风格 + K线图 + 加自选
|
// 涨停股票详情表格列 - 精致风格 + K线图 + 加自选
|
||||||
|
|||||||
Reference in New Issue
Block a user