自适应

This commit is contained in:
mmc
2026-05-14 10:47:56 +08:00
parent 4ac279139b
commit c34c09a3cc
5 changed files with 587 additions and 745 deletions

View File

@@ -346,96 +346,92 @@ export default function AlarmCenterPage() {
</Row>
{/* 统计卡片 */}
<Row gutter={[16, 16]} style={{ marginBottom: 16 }}>
<Col xs={24} sm={12} md={8} lg={6} xl={4.8} style={{ flex: '1 0 200px' }}>
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col>
<div style={{ width: 48, height: 48, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<BellOutlined style={{ fontSize: 24, color: '#FF4D4F' }} />
</div>
</Col>
<Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>告警总数</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#FF4D4F', lineHeight: '36px' }}>
{statData.total || 0}
</div>
</Col>
</Row>
</Card>
</Col>
<Col xs={24} sm={12} md={8} lg={6} xl={4.8} style={{ flex: '1 0 200px' }}>
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col>
<div style={{ width: 48, height: 48, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<ExclamationCircleOutlined style={{ fontSize: 24, color: '#FF4D4F' }} />
</div>
</Col>
<Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>严重告警</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#FF4D4F', lineHeight: '36px' }}>
{statData.levelStats?.[1] || 0}
</div>
</Col>
</Row>
</Card>
</Col>
<Col xs={24} sm={12} md={8} lg={6} xl={4.8} style={{ flex: '1 0 200px' }}>
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col>
<div style={{ width: 48, height: 48, background: '#FFF7E8', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<ClockCircleOutlined style={{ fontSize: 24, color: '#FA8C16' }} />
</div>
</Col>
<Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>待处理</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#FA8C16', lineHeight: '36px' }}>
{statData.pending || 0}
</div>
</Col>
</Row>
</Card>
</Col>
<Col xs={24} sm={12} md={8} lg={6} xl={4.8} style={{ flex: '1 0 200px' }}>
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col>
<div style={{ width: 48, height: 48, background: '#E8F3FF', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<ReloadOutlined style={{ fontSize: 24, color: '#1890FF' }} />
</div>
</Col>
<Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>处理中</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#1890FF', lineHeight: '36px' }}>
{statData.processing || 0}
</div>
</Col>
</Row>
</Card>
</Col>
<Col xs={24} sm={12} md={8} lg={6} xl={4.8} style={{ flex: '1 0 200px' }}>
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col>
<div style={{ width: 48, height: 48, background: '#E8FFEA', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<CheckCircleOutlined style={{ fontSize: 24, color: '#00B42A' }} />
</div>
</Col>
<Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>已关闭</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#00B42A', lineHeight: '36px' }}>
{statData.closed || 0}
</div>
</Col>
</Row>
</Card>
</Col>
<Row gutter={[16, 16]} style={{ marginBottom: 16, flexWrap: 'wrap' }}>
{[
{
title: '今日告警总数',
value: statData.total || 0,
unit: '',
trend: '较昨日 +28.6% ↑',
trendColor: '#FF4D4F',
subText: `昨日 ${statData.yesterdayTotal || 0}`,
icon: <BellOutlined />,
color: '#FF4D4F',
bg: '#FFF1F0'
},
{
title: '严重告警',
value: statData.levelStats?.[1] || 0,
unit: '',
trend: '较昨日 +33.3% ↑',
trendColor: '#FF4D4F',
subText: `昨日 ${statData.yesterdayCritical || 0}`,
icon: <ExclamationCircleOutlined />,
color: '#FF4D4F',
bg: '#FFF1F0'
},
{
title: '处理中',
value: statData.processing || 0,
unit: '',
trend: '较昨日 +20.0% ↑',
trendColor: '#FF4D4F',
subText: `昨日 ${statData.yesterdayProcessing || 0}`,
icon: <ClockCircleOutlined />,
color: '#FA8C16',
bg: '#FFF7E8'
},
{
title: '已关闭',
value: statData.closed || 0,
unit: '',
trend: '较昨日 +45.5% ↑',
trendColor: '#00B42A',
subText: `昨日 ${statData.yesterdayClosed || 0}`,
icon: <CheckCircleOutlined />,
color: '#00B42A',
bg: '#E8FFEA'
},
].map((item, idx) => (
<Col key={idx} style={{ minWidth: '200px', flex: '1 0 auto' }}>
<Card
bordered={false}
bodyStyle={{ padding: '16px 20px' }}
style={{ borderRadius: 8, height: 120 }}
>
<Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col>
<div style={{
width: 48,
height: 48,
background: item.bg,
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
}}>
{React.cloneElement(item.icon, { style: { fontSize: 24, color: item.color } })}
</div>
</Col>
<Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969', marginBottom: 4 }}>{item.title}</div>
<div style={{ fontSize: 28, fontWeight: 700, color: item.color, lineHeight: '36px' }}>
{item.value}
</div>
<div style={{ fontSize: 12, marginTop: 4 }}>
<span style={{ color: '#86909C' }}>{item.trend.split(' ')[0]}</span>
<span style={{ color: item.trendColor, fontWeight: 600, marginLeft: 4 }}>
{item.trend.split(' ').slice(1).join(' ')}
</span>
</div>
<div style={{ fontSize: 12, color: '#86909C', marginTop: 2 }}>
{item.subText}
</div>
</Col>
</Row>
</Card>
</Col>
))}
</Row>
{/* 表格 */}