卡片的自适应修改
This commit is contained in:
@@ -279,25 +279,62 @@ const WorkOrderPage = () => {
|
||||
</div>
|
||||
|
||||
{/* 统计卡片 */}
|
||||
<Row gutter={16} style={{ marginBottom: 16 }}>
|
||||
{/* 统一风格统计卡片 —— 宽高一致 + 自动换行 + 最小宽度168px */}
|
||||
<Row
|
||||
gutter={[16, 16]}
|
||||
style={{
|
||||
marginBottom: 16,
|
||||
flexWrap: 'wrap',
|
||||
}}
|
||||
>
|
||||
{stats.map((item, index) => (
|
||||
<Col span={4} key={index}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<div>
|
||||
<Text type="secondary" style={{ fontSize: 13 }}>{item.title}</Text>
|
||||
<div style={{ margin: '4px 0' }}>
|
||||
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>{item.value}</Text>
|
||||
{item.unit && <Text style={{ fontSize: 14, marginLeft: 4 }}>{item.unit}</Text>}
|
||||
<Col key={index} style={{ minWidth: '168px', flex: '1 0 auto' }}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
style={{ borderRadius: 8, height: 120 }}
|
||||
>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', height: '100%' }}>
|
||||
{/* 左侧文字 */}
|
||||
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
|
||||
<div style={{ fontSize: 13, color: '#86909C' }}>{item.title}</div>
|
||||
|
||||
<div style={{ display: 'flex', alignItems: 'baseline', gap: 4, margin: '4px 0' }}>
|
||||
<span style={{ fontSize: 24, fontWeight: 700, color: '#333' }}>{item.value}</span>
|
||||
{item.unit && <span style={{ fontSize: 14, color: '#666' }}>{item.unit}</span>}
|
||||
</div>
|
||||
|
||||
<div style={{ fontSize: 12 }}>
|
||||
<Text type="secondary">{item.subText}</Text>
|
||||
<Text style={{ marginLeft: 4, color: item.subValue.startsWith('+') ? '#52c41a' : item.subValue.startsWith('-') ? '#ff4d4f' : '#1890ff', fontWeight: 'bold' }}>
|
||||
<span style={{ color: '#86909C' }}>{item.subText}</span>
|
||||
<span
|
||||
style={{
|
||||
marginLeft: 4,
|
||||
fontWeight: 'bold',
|
||||
color: item.subValue.startsWith('+')
|
||||
? '#52c41a'
|
||||
: item.subValue.startsWith('-')
|
||||
? '#ff4d4f'
|
||||
: '#1890ff',
|
||||
}}
|
||||
>
|
||||
{item.subValue}
|
||||
</Text>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ width: 48, height: 48, borderRadius: '50%', background: item.bg, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
|
||||
{/* 右侧图标 */}
|
||||
<div
|
||||
style={{
|
||||
width: 48,
|
||||
height: 48,
|
||||
borderRadius: '50%',
|
||||
background: item.bg,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
{item.icon}
|
||||
</div>
|
||||
</div>
|
||||
@@ -305,7 +342,6 @@ const WorkOrderPage = () => {
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
{/* 筛选栏 */}
|
||||
<Card bordered={false} bodyStyle={{ padding: '12px 16px' }} style={{ borderRadius: 8, marginBottom: 16 }}>
|
||||
<Row gutter={16} align="middle">
|
||||
|
||||
Reference in New Issue
Block a user