feat: 历史股票增加相关度数据
This commit is contained in:
@@ -126,6 +126,14 @@ const HistoricalEvents = ({
|
||||
return 'green';
|
||||
};
|
||||
|
||||
// 获取相关度颜色(1-10)
|
||||
const getSimilarityColor = (similarity) => {
|
||||
if (similarity >= 8) return 'green';
|
||||
if (similarity >= 6) return 'blue';
|
||||
if (similarity >= 4) return 'orange';
|
||||
return 'gray';
|
||||
};
|
||||
|
||||
// 格式化日期
|
||||
const formatDate = (dateString) => {
|
||||
if (!dateString) return '日期未知';
|
||||
@@ -300,6 +308,11 @@ const HistoricalEvents = ({
|
||||
涨幅: {event.avg_change_pct > 0 ? '+' : ''}{event.avg_change_pct.toFixed(2)}%
|
||||
</Badge>
|
||||
)}
|
||||
{event.similarity !== undefined && event.similarity !== null && (
|
||||
<Badge colorScheme={getSimilarityColor(event.similarity)} size="sm">
|
||||
相关度: {event.similarity}
|
||||
</Badge>
|
||||
)}
|
||||
</HStack>
|
||||
</VStack>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user