卡片的自适应修改

This commit is contained in:
mmc
2026-05-14 09:37:15 +08:00
parent c0e8a1cd3e
commit 2ae097eed0
10 changed files with 874 additions and 790 deletions

View File

@@ -94,26 +94,67 @@ export default function ReportCenterPage() {
</Tabs>
{/* 顶部统计卡片 */}
<Row gutter={16} style={{ marginBottom: 20 }}>
{/* 概览统计卡片 —— 统一风格 + 自动换行 + 宽高一致 */}
<Row
gutter={[16, 16]}
style={{
marginBottom: 20,
flexWrap: 'wrap',
}}
>
{overviewCards.map((card, idx) => (
<Col span={4} key={idx}>
<Card bordered={false} style={{ borderRadius: 8, height: 120 }}>
<Col key={idx} style={{ minWidth: '168px', flex: '1 0 auto' }}>
<Card
bordered={false}
bodyStyle={{ padding: '16px' }}
style={{
borderRadius: 8,
height: 120,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center'
}}
>
<Statistic
title={card.title}
title={
<span style={{ fontSize: 14, color: '#666', fontWeight: 500 }}>
{card.title}
</span>
}
value={card.value}
precision={card.title === 'PR均值' ? 1 : 1}
suffix={card.unit}
valueStyle={{ color: card.color, fontSize: 28, fontWeight: 700 }}
suffix={
card.unit && (
<span style={{ fontSize: 16, marginLeft: 4 }}>{card.unit}</span>
)
}
valueStyle={{
color: card.color,
fontSize: 28,
fontWeight: 700,
marginBottom: 4
}}
/>
{card.rate && (
<Text type="secondary" style={{ fontSize: 12 }}>
环比 <span style={{ color: card.rateUp ? '#52c41a' : '#ff4d4f' }}>{card.rate}</span>
</Text>
<div style={{ fontSize: 12, color: '#999', marginTop: 2 }}>
环比
<span
style={{
marginLeft: 4,
color: card.rateUp ? '#52c41a' : '#ff4d4f',
fontWeight: 600
}}
>
{card.rate}
</span>
</div>
)}
{card.desc && (
<Text type="secondary" style={{ fontSize: 12, display: 'block' }}>
<div style={{ fontSize: 12, color: '#999', marginTop: 2 }}>
{card.desc}
</Text>
</div>
)}
</Card>
</Col>