fix(DetailTable): PE 和 PEG 指标添加单位"倍"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-29 10:31:53 +08:00
parent 11afcc3478
commit 3cd3686f1c

View File

@@ -89,10 +89,15 @@ const DetailTable: React.FC<DetailTableProps> = ({ data }) => {
const isGrowthMetric = record['指标']?.includes('增长') || record['指标']?.includes('率');
const isPositiveGrowth = isGrowthMetric && !isNaN(numValue) && numValue > 0;
// PE 和 PEG 需要显示单位"倍"
const metricName = record['指标'] as string;
const isPeOrPeg = metricName === 'PE' || metricName === 'PEG';
const displayValue = isPeOrPeg ? `${value}` : value;
// 数值类添加样式类名
const className = `data-cell ${isNegative ? 'negative-value' : ''} ${isPositiveGrowth ? 'positive-growth' : ''}`;
return <span className={className}>{value}</span>;
return <span className={className}>{displayValue}</span>;
},
});
});