fix: 个股中心bug修复

This commit is contained in:
zdl
2025-12-10 13:29:08 +08:00
parent 1adbeda168
commit 7c00763999
2 changed files with 14 additions and 6 deletions

View File

@@ -544,11 +544,19 @@ const InvestmentCalendar = () => {
render: (concepts) => (
<Space wrap>
{concepts && concepts.length > 0 ? (
concepts.slice(0, 3).map((concept, index) => (
<Tag key={index} icon={<TagsOutlined />}>
{Array.isArray(concept) ? concept[0] : concept}
</Tag>
))
concepts.slice(0, 3).map((concept, index) => {
// 兼容多种数据格式:字符串、数组、对象
const conceptName = typeof concept === 'string'
? concept
: Array.isArray(concept)
? concept[0]
: concept?.concept || concept?.name || '';
return (
<Tag key={index} icon={<TagsOutlined />}>
{conceptName}
</Tag>
);
})
) : (
<Text type="secondary"></Text>
)}

View File

@@ -2426,7 +2426,7 @@ const CompanyAnalysisComplete = ({ stockCode: propStockCode }) => {
<>
{event.keywords.slice(0, 4).map((keyword, kidx) => (
<Tag key={kidx} size="sm" colorScheme="cyan" variant="subtle">
{keyword}
{typeof keyword === 'string' ? keyword : keyword.concept}
</Tag>
))}
</>