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:
@@ -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>;
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user