卡片的自适应修改

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

@@ -13,7 +13,6 @@ import {
message, message,
Typography, Typography,
Space, Space,
Modal,
} from 'antd'; } from 'antd';
import { import {
CloudOutlined, CloudOutlined,
@@ -22,7 +21,6 @@ import {
DatabaseOutlined, DatabaseOutlined,
CalendarOutlined, CalendarOutlined,
CheckCircleOutlined, CheckCircleOutlined,
SyncOutlined,
DownloadOutlined, DownloadOutlined,
FileTextOutlined, FileTextOutlined,
DeleteOutlined, DeleteOutlined,
@@ -101,305 +99,306 @@ const BasicSettings = () => {
{ name: '最近错误', value: '-' }, { name: '最近错误', value: '-' },
]; ];
// 顶部卡片数据
const topCards = [
{
title: '当前版本',
value: 'v2.8.1',
tag: '最新版',
tagColor: 'blue',
icon: <CloudOutlined />,
color: '#1677ff',
bg: '#e6f4ff'
},
{
title: '在线用户',
value: '12',
trend: '↑ 2',
trendColor: '#52c41a',
icon: <TeamOutlined />,
color: '#52c41a',
bg: '#f6ffed'
},
{
title: '告警通道',
value: '3 / 4',
trend: '正常',
trendColor: '#52c41a',
icon: <BellOutlined />,
color: '#ff4d4f',
bg: '#fff2f0'
},
{
title: '数据备份状态',
value: '正常',
trend: '●',
trendColor: '#52c41a',
icon: <DatabaseOutlined />,
color: '#13c2c2',
bg: '#e6fffb'
},
{
title: '最近更新',
value: '2025-05-20',
icon: <CalendarOutlined />,
color: '#722ed1',
bg: '#f9f0ff'
},
];
return ( return (
<div style={{ padding: 24, background: '#f0f2f5', minHeight: '100vh' }}> <div style={{ padding: 24, background: '#f0f2f5', minHeight: '100vh' }}>
{/* 顶部卡片 */}
<Row gutter={16} style={{ marginBottom: 24 }}> {/* 顶部卡片 —— 统一风格 + 自动换行 + 圆角8px */}
<Col span={5}> <Row gutter={[16, 16]} style={{ marginBottom: 24, flexWrap: 'wrap' }}>
<AntdCard size="small"> {topCards.map((item, idx) => (
<Space> <Col key={idx} style={{ minWidth: '160px', flex: '1 0 auto' }}>
<div style={{ background: '#e6f4ff', borderRadius: 8, padding: 8 }}> <AntdCard
<CloudOutlined style={{ color: '#1677ff', fontSize: 20 }} /> size="small"
</div> style={{ borderRadius: 8, width: '100%' }}
<div> bodyStyle={{ padding: '12px' }}
<div style={{ fontSize: 13, color: '#666' }}>当前版本</div> >
<div style={{ fontWeight: 600 }}>v2.8.1 <Tag color="blue">最新版</Tag></div> <Space>
</div> <div style={{ background: item.bg, borderRadius: 8, padding: 8 }}>
</Space> {item.icon}
</AntdCard> </div>
</Col> <div>
<Col span={5}> <div style={{ fontSize: 13, color: '#666' }}>{item.title}</div>
<AntdCard size="small"> <div style={{ fontWeight: 600, display: 'flex', alignItems: 'center', gap: 6 }}>
<Space> {item.value}
<div style={{ background: '#f6ffed', borderRadius: 8, padding: 8 }}> {item.tag && <Tag color={item.tagColor} style={{ margin: 0 }}>{item.tag}</Tag>}
<TeamOutlined style={{ color: '#52c41a', fontSize: 20 }} /> {item.trend && (
</div> <span style={{ color: item.trendColor, fontSize: 12 }}>
<div> {item.trend}
<div style={{ fontSize: 13, color: '#666' }}>在线用户</div> </span>
<div style={{ fontWeight: 600 }}>12 <span style={{ color: '#52c41a', fontSize: 12 }}>↑ 2</span></div> )}
</div> </div>
</Space> </div>
</AntdCard> </Space>
</Col> </AntdCard>
<Col span={5}> </Col>
<AntdCard size="small"> ))}
<Space>
<div style={{ background: '#fff2f0', borderRadius: 8, padding: 8 }}>
<BellOutlined style={{ color: '#ff4d4f', fontSize: 20 }} />
</div>
<div>
<div style={{ fontSize: 13, color: '#666' }}>告警通道</div>
<div style={{ fontWeight: 600 }}>3 / 4 <span style={{ color: '#52c41a', fontSize: 12 }}>正常</span></div>
</div>
</Space>
</AntdCard>
</Col>
<Col span={5}>
<AntdCard size="small">
<Space>
<div style={{ background: '#e6fffb', borderRadius: 8, padding: 8 }}>
<DatabaseOutlined style={{ color: '#13c2c2', fontSize: 20 }} />
</div>
<div>
<div style={{ fontSize: 13, color: '#666' }}>数据备份状态</div>
<div style={{ fontWeight: 600 }}>正常 <span style={{ color: '#52c41a', fontSize: 12 }}>●</span></div>
</div>
</Space>
</AntdCard>
</Col>
<Col span={4}>
<AntdCard size="small">
<Space>
<div style={{ background: '#f9f0ff', borderRadius: 8, padding: 8 }}>
<CalendarOutlined style={{ color: '#722ed1', fontSize: 20 }} />
</div>
<div>
<div style={{ fontSize: 13, color: '#666' }}>最近更新</div>
<div style={{ fontWeight: 600 }}>2025-05-20</div>
</div>
</Space>
</AntdCard>
</Col>
</Row> </Row>
<Row <Row gutter={16}>
gutter={16}
style={{
display: 'flex',
alignItems: 'stretch', // 关键:等高
}}
>
{/* 左侧主内容 */} {/* 左侧主内容 */}
<Col span={16} style={{ display: 'flex', flexDirection: 'column' }}> <Col span={16}>
<div style={{ flex: 1 }}>
{/* 平台参数 */} {/* 平台参数 */}
<AntdCard title="平台参数" style={{ marginBottom: 16 }}> <AntdCard title="平台参数" style={{ marginBottom: 16, borderRadius: 8 }}>
<Form form={form} layout="vertical"> <Form form={form} layout="vertical">
<Row gutter={16}> <Row gutter={16}>
<Col span={12}> <Col span={12}>
<Form.Item label="系统名称" name="systemName"> <Form.Item label="系统名称" name="systemName">
<Input defaultValue="光伏场站智能监控与运维系统" /> <Input defaultValue="光伏场站智能监控与运维系统" />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item label="默认电站" name="defaultSite"> <Form.Item label="默认电站" name="defaultSite">
<Select defaultValue="1MW 光伏电站"> <Select defaultValue="1MW 光伏电站">
<Select.Option value="1MW">1MW 光伏电站</Select.Option> <Select.Option value="1MW">1MW 光伏电站</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
<Row gutter={16}> <Row gutter={16}>
<Col span={12}> <Col span={12}>
<Form.Item label="数据刷新频率" name="refreshRate"> <Form.Item label="数据刷新频率" name="refreshRate">
<Select defaultValue="5分钟"> <Select defaultValue="5分钟">
<Select.Option value="5">5分钟</Select.Option> <Select.Option value="5">5分钟</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item label="地图服务" name="mapService"> <Form.Item label="地图服务" name="mapService">
<Select defaultValue="高德地图"> <Select defaultValue="高德地图">
<Select.Option value="amap">高德地图</Select.Option> <Select.Option value="amap">高德地图</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
<Form.Item label="AI建议自动生成" valuePropName="checked"> <Form.Item label="AI建议自动生成" valuePropName="checked">
<Switch defaultChecked />
</Form.Item>
</Form>
</AntdCard>
{/* 通知与告警策略 */}
<AntdCard title="通知与告警策略" style={{ marginBottom: 16, borderRadius: 8 }}>
<Row gutter={16} style={{ marginBottom: 16 }}>
<Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>短信</Text>
<Switch defaultChecked /> <Switch defaultChecked />
</Form.Item> </div>
</Form> </Col>
</AntdCard> <Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>邮件</Text>
<Switch defaultChecked />
</div>
</Col>
<Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>企业微信</Text>
<Switch defaultChecked />
</div>
</Col>
</Row>
<Row gutter={16}>
<Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>系统通知</Text>
<Switch defaultChecked />
</div>
</Col>
<Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>严重告警立即通知</Text>
<Switch defaultChecked />
</div>
</Col>
<Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>通信中断通知</Text>
<Switch defaultChecked />
</div>
</Col>
</Row>
</AntdCard>
{/* 通知与告警策略 */} {/* 用户与权限预览 */}
<AntdCard title="通知与告警策略" style={{ marginBottom: 16 }}> <AntdCard title="用户与权限预览" style={{ marginBottom: 16, borderRadius: 8 }}>
<Row gutter={16} style={{ marginBottom: 16 }}> <Table
<Col span={8}> size="small"
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}> pagination={false}
<Text strong>短信</Text> columns={[
<Switch defaultChecked /> { title: '用户名', dataIndex: 'name' },
</div> { title: '角色', dataIndex: 'role' },
</Col> { title: '手机号', dataIndex: 'phone' },
<Col span={8}> { title: '状态', dataIndex: 'status', render: (text) => <span style={{ color: '#52c41a' }}>{text}</span> },
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}> ]}
<Text strong>邮件</Text> dataSource={[
<Switch defaultChecked /> { name: '张运维', role: '超级管理员', phone: '138****0001', status: '在线' },
</div> { name: '李工程师', role: '运维工程师', phone: '139****0002', status: '在线' },
</Col> { name: '王班长', role: '巡检主管', phone: '137****0003', status: '在线' },
<Col span={8}> { name: '赵分析师', role: '数据分析师', phone: '136****0004', status: '在线' },
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}> ]}
<Text strong>企业微信</Text> />
<Switch defaultChecked /> </AntdCard>
</div>
</Col>
</Row>
<Row gutter={16}>
<Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>系统通知</Text>
<Switch defaultChecked />
</div>
</Col>
<Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>严重告警立即通知</Text>
<Switch defaultChecked />
</div>
</Col>
<Col span={8}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', border: '1px solid #e8e8e8', borderRadius: 8 }}>
<Text strong>通信中断通知</Text>
<Switch defaultChecked />
</div>
</Col>
</Row>
</AntdCard>
{/* 用户与权限预览 */} {/* MQTT接入状态 */}
<AntdCard title="用户与权限预览" style={{ marginBottom: 16 }}> <AntdCard title="MQTT接入状态" style={{ marginBottom: 16, borderRadius: 8 }}>
<Table <div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>来自 /pv/mqtt/status,后端未登录时显示预览兜底数据</div>
size="small" <Row gutter={16}>
pagination={false} {mqttStatusData.map((item, index) => (
columns={[ <Col span={12} key={index}>
{ title: '用户名', dataIndex: 'name' }, <div style={{ border: '1px solid #e8e8e8', borderRadius: 8, padding: 12, marginBottom: 16 }}>
{ title: '角色', dataIndex: 'role' }, <div style={{ fontSize: 13, color: '#666', marginBottom: 4 }}>{item.name}</div>
{ title: '手机号', dataIndex: 'phone' }, <div style={{ fontSize: 16, fontWeight: 600, color: item.statusColor || '#333' }}>{item.value}</div>
{ title: '状态', dataIndex: 'status', render: (text) => <span style={{ color: '#52c41a' }}>{text}</span> }, </div>
]} </Col>
dataSource={[ ))}
{ name: '张运维', role: '超级管理员', phone: '138****0001', status: '在线' }, </Row>
{ name: '李工程师', role: '运维工程师', phone: '139****0002', status: '在线' }, </AntdCard>
{ name: '王班长', role: '巡检主管', phone: '137****0003', status: '在线' },
{ name: '赵分析师', role: '数据分析师', phone: '136****0004', status: '在线' }, {/* MQTT消息日志 */}
]} <AntdCard title="MQTT消息日志" style={{ marginBottom: 16, borderRadius: 8 }}>
/> <div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>阶段3A用于验证遥测原始消息落库</div>
</AntdCard> <Table
{/* MQTT接入状态 */} size="small"
<AntdCard title="MQTT接入状态" style={{ marginBottom: 16 }}> pagination={false}
<div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>来自 /pv/mqtt/status,后端未登录时显示预览兜底数据</div> columns={[
<Row gutter={16}> { title: 'Topic', dataIndex: 'topic' },
{mqttStatusData.map((item, index) => ( { title: '设备', dataIndex: 'device' },
<Col span={12} key={index}> { title: '类型', dataIndex: 'type' },
<div style={{ border: '1px solid #e8e8e8', borderRadius: 8, padding: 12, marginBottom: 16 }}> { title: '解析', dataIndex: 'parse' },
<div style={{ fontSize: 13, color: '#666', marginBottom: 4 }}>{item.name}</div> ]}
<div style={{ fontSize: 16, fontWeight: 600, color: item.statusColor || '#333' }}>{item.value}</div> dataSource={mqttLogData}
</div> />
</Col> </AntdCard>
))}
</Row> <AntdCard title="系统维护" style={{ marginBottom: 0, borderRadius: 8 }}>
</AntdCard> <Row gutter={16}>
<Col span={12} style={{ marginBottom: 16 }}>
<Button style={{ width: '100%' }} icon={<DeleteOutlined />}>清理缓存</Button>
</Col>
<Col span={12} style={{ marginBottom: 16 }}>
<Button style={{ width: '100%' }} icon={<RestOutlined />}>重启服务</Button>
</Col>
<Col span={12}>
<Button style={{ width: '100%' }} icon={<DownloadOutlined />}>备份下载</Button>
</Col>
<Col span={12}>
<Button style={{ width: '100%' }} icon={<FileTextOutlined />}>日志导出</Button>
</Col>
</Row>
</AntdCard>
{/* MQTT消息日志 */}
<AntdCard title="MQTT消息日志" style={{ marginBottom: 16 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>阶段3A用于验证遥测原始消息落库</div>
<Table
size="small"
pagination={false}
columns={[
{ title: 'Topic', dataIndex: 'topic' },
{ title: '设备', dataIndex: 'device' },
{ title: '类型', dataIndex: 'type' },
{ title: '解析', dataIndex: 'parse' },
]}
dataSource={mqttLogData}
/>
</AntdCard>
<AntdCard title="系统维护" style={{ marginBottom: 0 }}>
<Row gutter={16}>
<Col span={12} style={{ marginBottom: 16 }}>
<Button style={{ width: '100%' }} icon={<DeleteOutlined />}>清理缓存</Button>
</Col>
<Col span={12} style={{ marginBottom: 16 }}>
<Button style={{ width: '100%' }} icon={<RestOutlined />}>重启服务</Button>
</Col>
<Col span={12}>
<Button style={{ width: '100%' }} icon={<DownloadOutlined />}>备份下载</Button>
</Col>
<Col span={12}>
<Button style={{ width: '100%' }} icon={<FileTextOutlined />}>日志导出</Button>
</Col>
</Row>
</AntdCard>
</div>
</Col> </Col>
{/* 右侧边栏 */} {/* 右侧边栏 */}
<Col span={8} style={{ display: 'flex', flexDirection: 'column' }}> <Col span={8}>
<div style={{ flex: 1 }}>
{/* 设备接入状态 */}
<AntdCard title="设备接入状态" style={{ marginBottom: 16 }}>
<Row gutter={16}>
{deviceStatusData.map((item, index) => (
<Col span={12} key={index}>
<div style={{ border: '1px solid #e8e8e8', borderRadius: 8, padding: 12, marginBottom: 16 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 4 }}>{item.name}</div>
<div style={{ fontSize: 16, fontWeight: 600, marginBottom: 4 }}>{item.count}</div>
<div style={{ color: item.color, fontSize: 13 }}>{item.status}</div>
</div>
</Col>
))}
</Row>
</AntdCard>
{/* 服务配置展示 */} {/* 设备接入状态 */}
<AntdCard title="服务配置展示" style={{ marginBottom: 16 }}> <AntdCard title="设备接入状态" style={{ marginBottom: 16, borderRadius: 8 }}>
{serviceConfigData.map((item, index) => ( <Row gutter={16}>
<div key={index} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 0', borderBottom: index !== serviceConfigData.length - 1 ? '1px solid #e8e8e8' : 'none' }}> {deviceStatusData.map((item, index) => (
<div> <Col span={12} key={index}>
<div style={{ fontWeight: 500, marginBottom: 4 }}>{item.name}</div> <div style={{ border: '1px solid #e8e8e8', borderRadius: 8, padding: 12, marginBottom: 16 }}>
<div style={{ fontSize: 13 }}>{item.value}</div> <div style={{ fontSize: 13, color: '#666', marginBottom: 4 }}>{item.name}</div>
<div style={{ fontSize: 16, fontWeight: 600, marginBottom: 4 }}>{item.count}</div>
<div style={{ color: item.color, fontSize: 13 }}>{item.status}</div>
</div> </div>
<Tag color={item.statusColor === '#52c41a' ? 'success' : item.statusColor === '#fa8c16' ? 'warning' : 'default'}>{item.status}</Tag> </Col>
</div>
))} ))}
</AntdCard> </Row>
</AntdCard>
{/* 视频服务配置状态 */} {/* 服务配置展示 */}
<AntdCard title="视频服务配置状态" style={{ marginBottom: 16 }}> <AntdCard title="服务配置展示" style={{ marginBottom: 16, borderRadius: 8 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>来自 /pv/video/summary 与 /pv/video/media-server/list</div> {serviceConfigData.map((item, index) => (
<Row gutter={16}> <div key={index} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 0', borderBottom: index !== serviceConfigData.length - 1 ? '1px solid #e8e8e8' : 'none' }}>
{videoServiceData.map((item, index) => ( <div>
<Col span={12} key={index}> <div style={{ fontWeight: 500, marginBottom: 4 }}>{item.name}</div>
<div style={{ border: '1px solid #e8e8e8', borderRadius: 8, padding: 12, marginBottom: 16 }}> <div style={{ fontSize: 13 }}>{item.value}</div>
<div style={{ fontSize: 13, color: '#666', marginBottom: 4 }}>{item.name}</div> </div>
<div style={{ fontSize: 16, fontWeight: 600, color: item.statusColor || '#333' }}>{item.value}</div> <Tag color={item.statusColor === '#52c41a' ? 'success' : item.statusColor === '#fa8c16' ? 'warning' : 'default'}>{item.status}</Tag>
</div> </div>
</Col> ))}
))} </AntdCard>
</Row>
<Button type="primary" style={{ width: '100%' }} onClick={() => message.info('检测视频服务')}>检测视频服务</Button>
</AntdCard>
{/* 视频服务配置状态 */}
<AntdCard title="视频服务配置状态" style={{ marginBottom: 16, borderRadius: 8 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>来自 /pv/video/summary 与 /pv/video/media-server/list</div>
<Row gutter={16}>
{videoServiceData.map((item, index) => (
<Col span={12} key={index}>
<div style={{ border: '1px solid #e8e8e8', borderRadius: 8, padding: 12, marginBottom: 16 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 4 }}>{item.name}</div>
<div style={{ fontSize: 16, fontWeight: 600, color: item.statusColor || '#333' }}>{item.value}</div>
</div>
</Col>
))}
</Row>
<Button type="primary" style={{ width: '100%' }} onClick={() => message.info('检测视频服务')}>检测视频服务</Button>
</AntdCard>
{/* WebSocket实时推送 */}
<AntdCard title="WebSocket实时推送" style={{ marginBottom: 16, borderRadius: 8 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>来自 /pv/ws/status,并显示前端本地连接状态</div>
<Row gutter={16}>
{wsStatusData.map((item, index) => (
<Col span={12} key={index}>
<div style={{ border: '1px solid #e8e8e8', borderRadius: 8, padding: 12, marginBottom: 16 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 4 }}>{item.name}</div>
<div style={{ fontSize: 16, fontWeight: 600, color: item.statusColor || '#333' }}>{item.value}</div>
</div>
</Col>
))}
</Row>
</AntdCard>
{/* WebSocket实时推送 */}
<AntdCard title="WebSocket实时推送" style={{ marginBottom: 16 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>来自 /pv/ws/status,并显示前端本地连接状态</div>
<Row gutter={16}>
{wsStatusData.map((item, index) => (
<Col span={12} key={index}>
<div style={{ border: '1px solid #e8e8e8', borderRadius: 8, padding: 12, marginBottom: 16 }}>
<div style={{ fontSize: 13, color: '#666', marginBottom: 4 }}>{item.name}</div>
<div style={{ fontSize: 16, fontWeight: 600, color: item.statusColor || '#333' }}>{item.value}</div>
</div>
</Col>
))}
</Row>
</AntdCard>
{/* 系统维护 */}
</div>
</Col> </Col>
</Row> </Row>
</div> </div>

View File

@@ -346,16 +346,16 @@ export default function AlarmCenterPage() {
</Row> </Row>
{/* 统计卡片 */} {/* 统计卡片 */}
<Row gutter={16} style={{ marginBottom: 16, flexWrap: 'wrap' }}> <Row gutter={[16, 16]} style={{ marginBottom: 16 }}>
<Col xs={24} sm={12} md={8} lg={4} xl={4}> <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, whiteSpace: 'nowrap' }}> <Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16}> <Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col> <Col>
<div style={{ width: 48, height: 48, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <div style={{ width: 48, height: 48, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<BellOutlined style={{ fontSize: 24, color: '#FF4D4F' }} /> <BellOutlined style={{ fontSize: 24, color: '#FF4D4F' }} />
</div> </div>
</Col> </Col>
<Col style={{ overflow: 'hidden' }}> <Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>告警总数</div> <div style={{ fontSize: 14, color: '#4E5969' }}>告警总数</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#FF4D4F', lineHeight: '36px' }}> <div style={{ fontSize: 28, fontWeight: 700, color: '#FF4D4F', lineHeight: '36px' }}>
{statData.total || 0} {statData.total || 0}
@@ -365,15 +365,15 @@ export default function AlarmCenterPage() {
</Card> </Card>
</Col> </Col>
<Col xs={24} sm={12} md={8} lg={4} xl={4}> <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, whiteSpace: 'nowrap' }}> <Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16}> <Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col> <Col>
<div style={{ width: 48, height: 48, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <div style={{ width: 48, height: 48, background: '#FFF1F0', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<ExclamationCircleOutlined style={{ fontSize: 24, color: '#FF4D4F' }} /> <ExclamationCircleOutlined style={{ fontSize: 24, color: '#FF4D4F' }} />
</div> </div>
</Col> </Col>
<Col style={{ overflow: 'hidden' }}> <Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>严重告警</div> <div style={{ fontSize: 14, color: '#4E5969' }}>严重告警</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#FF4D4F', lineHeight: '36px' }}> <div style={{ fontSize: 28, fontWeight: 700, color: '#FF4D4F', lineHeight: '36px' }}>
{statData.levelStats?.[1] || 0} {statData.levelStats?.[1] || 0}
@@ -383,15 +383,15 @@ export default function AlarmCenterPage() {
</Card> </Card>
</Col> </Col>
<Col xs={24} sm={12} md={8} lg={4} xl={4}> <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, whiteSpace: 'nowrap' }}> <Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16}> <Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col> <Col>
<div style={{ width: 48, height: 48, background: '#FFF7E8', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <div style={{ width: 48, height: 48, background: '#FFF7E8', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<ClockCircleOutlined style={{ fontSize: 24, color: '#FA8C16' }} /> <ClockCircleOutlined style={{ fontSize: 24, color: '#FA8C16' }} />
</div> </div>
</Col> </Col>
<Col style={{ overflow: 'hidden' }}> <Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>待处理</div> <div style={{ fontSize: 14, color: '#4E5969' }}>待处理</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#FA8C16', lineHeight: '36px' }}> <div style={{ fontSize: 28, fontWeight: 700, color: '#FA8C16', lineHeight: '36px' }}>
{statData.pending || 0} {statData.pending || 0}
@@ -401,15 +401,15 @@ export default function AlarmCenterPage() {
</Card> </Card>
</Col> </Col>
<Col xs={24} sm={12} md={8} lg={4} xl={4}> <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, whiteSpace: 'nowrap' }}> <Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16}> <Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col> <Col>
<div style={{ width: 48, height: 48, background: '#E8F3FF', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <div style={{ width: 48, height: 48, background: '#E8F3FF', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<ReloadOutlined style={{ fontSize: 24, color: '#1890FF' }} /> <ReloadOutlined style={{ fontSize: 24, color: '#1890FF' }} />
</div> </div>
</Col> </Col>
<Col style={{ overflow: 'hidden' }}> <Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>处理中</div> <div style={{ fontSize: 14, color: '#4E5969' }}>处理中</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#1890FF', lineHeight: '36px' }}> <div style={{ fontSize: 28, fontWeight: 700, color: '#1890FF', lineHeight: '36px' }}>
{statData.processing || 0} {statData.processing || 0}
@@ -419,15 +419,15 @@ export default function AlarmCenterPage() {
</Card> </Card>
</Col> </Col>
<Col xs={24} sm={12} md={8} lg={4} xl={4}> <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, whiteSpace: 'nowrap' }}> <Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, height: '100%' }}>
<Row align="middle" gutter={16}> <Row align="middle" gutter={16} style={{ height: '100%' }}>
<Col> <Col>
<div style={{ width: 48, height: 48, background: '#E8FFEA', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <div style={{ width: 48, height: 48, background: '#E8FFEA', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<CheckCircleOutlined style={{ fontSize: 24, color: '#00B42A' }} /> <CheckCircleOutlined style={{ fontSize: 24, color: '#00B42A' }} />
</div> </div>
</Col> </Col>
<Col style={{ overflow: 'hidden' }}> <Col style={{ flex: 1, overflow: 'hidden' }}>
<div style={{ fontSize: 14, color: '#4E5969' }}>已关闭</div> <div style={{ fontSize: 14, color: '#4E5969' }}>已关闭</div>
<div style={{ fontSize: 28, fontWeight: 700, color: '#00B42A', lineHeight: '36px' }}> <div style={{ fontSize: 28, fontWeight: 700, color: '#00B42A', lineHeight: '36px' }}>
{statData.closed || 0} {statData.closed || 0}

View File

@@ -66,13 +66,44 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
const totalMowers = devicesAll?.filter(d => d.productName?.includes('割草机')).length || 0; const totalMowers = devicesAll?.filter(d => d.productName?.includes('割草机')).length || 0;
const activeMowers = devicesAll?.filter(d => d.productName?.includes('割草机') && d.onlineStatus === 1).length || 0; const activeMowers = devicesAll?.filter(d => d.productName?.includes('割草机') && d.onlineStatus === 1).length || 0;
const washDroneStandby = planedevices?.filter(d => d.productName?.includes('清洗') && d.onlineStatus === 1).length || 0;
return [ return [
{ title: '无人机机场状态', icon: <EnvironmentOutlined />, value: `${onlineDrones} / ${totalDrones}`, desc: onlineDrones > 0 ? '在线' : '离线', sub: `可调度 ${onlineDrones} 架`, color: '#1890ff' }, {
//{ title: '巡检机器人', icon: <RobotOutlined />, value: `${totalRobots} 台`, desc: '', sub: `执行中 ${activeRobots}`, color: '#722ed1' }, title: '无人机机场状态',
{ title: '机器人', icon: <BranchesOutlined />, value: `${totalMowers} 台`, desc: '', sub: `作业中 ${activeMowers}`, color: '#13c2c2' }, icon: <EnvironmentOutlined />,
{ title: '无人机', icon: <CloudOutlined />, value: `${totalDrones} 架`, desc: '', sub: `待命 ${planedevices?.filter(d => d.productName?.includes('清洗') && d.onlineStatus === 1).length || 0}`, color: '#eb2f96' }, value: `${onlineDrones} / ${totalDrones}`,
{ title: '设备平均电量', icon: <ThunderboltOutlined />, value: '86%', desc: '', sub: '', color: '#52c41a' }, sub: `可调度 ${onlineDrones} 架`,
{ title: '今日任务执行', icon: <CheckCircleOutlined />, value: '12 / 15', desc: '', sub: '完成率 80%', color: '#2f54eb' }, color: '#1890ff'
},
{
title: '机器人',
icon: <BranchesOutlined />,
value: `${totalMowers} 台`,
sub: `作业中 ${activeMowers}`,
color: '#13c2c2'
},
{
title: '无人机',
icon: <CloudOutlined />,
value: `${totalDrones} 架`,
sub: `待命 ${washDroneStandby}`,
color: '#eb2f96'
},
{
title: '设备平均电量',
icon: <ThunderboltOutlined />,
value: '86%',
sub: '',
color: '#52c41a'
},
{
title: '今日任务执行',
icon: <CheckCircleOutlined />,
value: '12 / 15',
sub: '完成率 80%',
color: '#2f54eb'
},
]; ];
}, [devicesAll, planedevices]); }, [devicesAll, planedevices]);
@@ -139,24 +170,55 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
return ( return (
<Content style={{ maxWidth: 1800, margin: '0 auto', }}> <Content style={{ maxWidth: 1800, margin: '0 auto', }}>
{/*<AgoraTextTest />*/} {/*<AgoraTextTest />*/}
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', marginBottom: 20 }}> <Row gutter={[16, 16]} style={{ marginBottom: 20, flexWrap: 'wrap' }}>
{dynamicTopCards.map((card, idx) => ( {dynamicTopCards.map((card, idx) => (
<div key={idx} style={{ flex: 1 }}> <Col key={idx} style={{ minWidth: '200px', flex: '0 0 auto' }}>
<Card bordered={false} style={{ borderRadius: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.05)', height: '110px', display: 'flex', alignItems: 'center' }}> <Card
<div style={{ display: 'flex', alignItems: 'center', gap: 12, width: '100%' }}> bordered={false}
<div style={{ width: 48, height: 48, borderRadius: 10, background: `${card.color}15`, color: card.color, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 20 }}> style={{
borderRadius: 12,
boxShadow: '0 2px 8px rgba(0,0,0,0.05)',
width: 200,
height: 110,
}}
bodyStyle={{ padding: '16px', height: '100%' }}
>
<div style={{ display: 'flex', alignItems: 'center', gap: 12, height: '100%' }}>
{/* 左侧图标 */}
<div
style={{
width: 48,
height: 48,
borderRadius: 10,
background: `${card.color}15`,
color: card.color,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: 20,
flexShrink: 0,
}}
>
{card.icon} {card.icon}
</div> </div>
<div style={{ flex: 1 }}>
{/* 右侧文字 */}
<div style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontSize: 13, color: '#666' }}>{card.title}</div> <div style={{ fontSize: 13, color: '#666' }}>{card.title}</div>
<div style={{ fontSize: 24, fontWeight: 700, color: '#222' }}>{card.value}</div> <div style={{ fontSize: 24, fontWeight: 700, color: '#222', lineHeight: '30px' }}>
{card.sub && <div style={{ fontSize: 12, color: '#999' }}>{card.sub}</div>} {card.value}
</div>
{card.sub && (
<div style={{ fontSize: 12, color: '#999', marginTop: 2 }}>
{card.sub}
</div>
)}
</div> </div>
</div> </div>
</Card> </Card>
</div> </Col>
))} ))}
</div> </Row>
<Row gutter={16}> <Row gutter={16}>
<Col xs={24} lg={14}> <Col xs={24} lg={14}>

View File

@@ -135,30 +135,50 @@ export default function AIDiagnosisPage() {
return ( return (
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px' }}> <div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px' }}>
{/* 顶部指标卡片 */} {/* 顶部指标卡片 */}
<Row gutter={12} style={{ marginBottom: 16 }}> {/* 优化版:宽高统一 + 最小168px + 自动换行 + 样式统一 */}
<Row
gutter={[12, 12]}
style={{
marginBottom: 16,
flexWrap: 'wrap',
}}
>
{[ {[
{ title: 'PR值', value: '82.6%', trend: '较昨日 -1.3%', icon: <RiseOutlined />, color: '#00B42A', bg: '#E8FFEA' }, { title: 'PR值', value: '82.6%', trend: '较昨日 -1.3%', icon: <RiseOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F' },
{ title: '发电偏差', value: '-4.35%', trend: '较昨日 -1.02%', icon: <FallOutlined />, color: '#F53F3F', bg: '#FFF1F0' }, { title: '发电偏差', value: '-4.35%', trend: '较昨日 -1.02%', icon: <FallOutlined />, color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F' },
{ title: '异常组串数量', value: '8', trend: '较昨日 +2 ↑', icon: <AppstoreOutlined />, color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F' }, { title: '异常组串数量', value: '8', trend: '较昨日 +2 ↑', icon: <AppstoreOutlined />, color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F' },
{ title: '热斑疑似数量', value: '36', trend: '较昨日 +5 ↑', icon: <BellOutlined />, color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F' }, { title: '热斑疑似数量', value: '36', trend: '较昨日 +5 ↑', icon: <BellOutlined />, color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F' },
{ title: '健康度评分', value: '86.3分', trend: '较昨日 -1.7', icon: <CheckCircleOutlined />, color: '#00B42A', bg: '#E8FFEA' }, { title: '健康度评分', value: '86.3', unit: '分', trend: '较昨日 -1.7', icon: <CheckCircleOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F' },
{ title: '预测发电量', value: '4,821kWh', trend: '较昨日 +2.6% ↑', icon: <ThunderboltOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#00B42A' }, { title: '预测发电量', value: '4,821', unit: 'kWh', trend: '较昨日 +2.6% ↑', icon: <ThunderboltOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#00B42A' },
].map((item, index) => ( ].map((item, index) => (
<Col span={4} key={index}> <Col key={index} style={{ minWidth: '168px', flex: '1 0 auto', }}>
<Card bordered={false} bodyStyle={{ padding: 16 }} style={cardStyle}> <Card
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}> bordered={false}
bodyStyle={{ padding: '16px' }}
style={{ borderRadius: 8, height: 120 }}
>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', height: '100%' }}>
<div> <div>
<div style={{ fontSize: 14, color: '#4E5969', marginBottom: 8 }}>{item.title}</div> <div style={{ fontSize: 14, color: '#4E5969', marginBottom: 8 }}>{item.title}</div>
<div style={{ fontSize: 24, fontWeight: 700, color: item.color }}> <div style={{ fontSize: 24, fontWeight: 700, color: item.color, display: 'flex', alignItems: 'baseline', gap: 4 }}>
{item.value.includes('分') ? <>{item.value.replace('分', '')}<span style={{ fontSize: 14 }}>分</span></> : {item.value}
item.value.includes('kWh') ? <>{item.value.replace('kWh', '')}<span style={{ fontSize: 14 }}>kWh</span></> : item.value} {item.unit && <span style={{ fontSize: 14, fontWeight: 400 }}>{item.unit}</span>}
</div> </div>
<div style={{ fontSize: 12, color: item.trendColor || '#86909C', marginTop: 8 }}> <div style={{ fontSize: 12, color: item.trendColor || '#86909C', marginTop: 8 }}>
{item.trend} {item.trend.includes('-') && <FallOutlined />} {item.trend}
</div> </div>
</div> </div>
<div style={{ width: 48, height: 48, background: item.bg, borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
{React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 24, color: item.color } })} <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> </div>
</div> </div>
</Card> </Card>

View File

@@ -113,120 +113,127 @@ export default function CleanOptimizationPage() {
return ( return (
<div style={{ background: '#f0f2f5', minHeight: '100vh', padding: '16px 24px' }}> <div style={{ background: '#f0f2f5', minHeight: '100vh', padding: '16px 24px' }}>
{/* 顶部指标卡片 */} {/* 顶部指标卡片 */}
<Row gutter={12} style={{ marginBottom: 16 }}> {/* 清洗建议卡片组 —— 宽高统一 + 最小168px + 自动换行 + 风格统一 */}
<Col span={4}> <Row
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}> gutter={[12, 12]}
<div style={{ display: 'flex', justifyContent: 'space-between' }}> style={{
<div> marginBottom: 16,
<Text type="secondary" style={{ fontSize: 13 }}>污染指数</Text> flexWrap: 'wrap',
<div style={{ display: 'flex', alignItems: 'center', gap: 8, margin: '4px 0' }}> }}
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>68.5</Text> >
<Tag color="#52c41a" style={{ borderRadius: 10, margin: 0 }}>中等</Tag> {[
</div> {
<div style={{ fontSize: 12 }}> title: '污染指数',
<Text type="secondary">较昨日</Text> value: '68.5',
<Text style={{ color: '#ff4d4f', marginLeft: 4, fontWeight: 'bold' }}>▼ 5.3</Text> unit: '',
</div> tag: '中等',
</div> tagColor: '#52c41a',
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#fff7e6', display: 'flex', alignItems: 'center', justifyContent: 'center' }}> trend: '较昨日 ▼ 5.3',
<SunOutlined style={{ color: '#faad14', fontSize: 20 }} /> trendColor: '#ff4d4f',
</div> icon: <SunOutlined />,
</div> color: '#faad14',
</Card> bg: '#fff7e6'
</Col> },
<Col span={4}> {
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}> title: '建议清洗区块数',
<div style={{ display: 'flex', justifyContent: 'space-between' }}> value: '8 / 20',
<div> unit: '',
<Text type="secondary" style={{ fontSize: 13 }}>建议清洗区块数</Text> trend: '占比 40%',
<div style={{ margin: '4px 0' }}> icon: <LayoutGrid />,
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>8 / 20</Text> color: '#1890ff',
</div> bg: '#e6f7ff'
<div style={{ fontSize: 12 }}> },
<Text type="secondary">占比 40%</Text> {
</div> title: '预计发电提升',
</div> value: '12,850',
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#e6f7ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}> unit: 'kWh',
<LayoutGrid size={20} color="#1890ff" /> trend: '占当前日发电量 14.2%',
</div> icon: <TrendingUp />,
</div> color: '#1890ff',
</Card> bg: '#f0f5ff'
</Col> },
<Col span={4}> {
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}> title: '预计收益提升',
<div style={{ display: 'flex', justifyContent: 'space-between' }}> value: '¥ 7,286',
<div> unit: '',
<Text type="secondary" style={{ fontSize: 13 }}>预计发电提升</Text> trend: '按电价 0.568 元/kWh 计算',
<div style={{ margin: '4px 0' }}> icon: <DollarSign />,
<Text style={{ fontSize: 24, fontWeight: 'bold', color: '#1890ff' }}>12,850</Text> color: '#faad14',
<Text style={{ fontSize: 14, marginLeft: 4 }}>kWh</Text> bg: '#fff7e6'
</div> },
<div style={{ fontSize: 12 }}> {
<Text type="secondary">占当前日发电量 14.2%</Text> title: '上次清洗时间',
</div> value: '2025-05-12',
</div> unit: '',
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#f0f5ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}> trend: '距今 12 天',
<TrendingUp size={20} color="#1890ff" /> icon: <Calendar />,
</div> color: '#1890ff',
</div> bg: '#f0f5ff'
</Card> },
</Col> {
<Col span={4}> title: '清洗成本预估',
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}> value: '¥ 3,200',
<div style={{ display: 'flex', justifyContent: 'space-between' }}> unit: '',
<div> trend: '预计单次清洗总成本',
<Text type="secondary" style={{ fontSize: 13 }}>预计收益提升</Text> icon: <Droplets />,
<div style={{ margin: '4px 0' }}> color: '#1890ff',
<Text style={{ fontSize: 24, fontWeight: 'bold', color: '#faad14' }}>¥ 7,286</Text> bg: '#e6f7ff'
</div> },
<div style={{ fontSize: 12 }}> ].map((item, index) => (
<Text type="secondary">按电价 0.568 元/kWh 计算</Text> <Col key={index} style={{ minWidth: '168px', flex: '1 0 auto' }}>
</div> <Card
</div> bordered={false}
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#fff7e6', display: 'flex', alignItems: 'center', justifyContent: 'center' }}> bodyStyle={{ padding: '16px' }}
<DollarSign size={20} color="#faad14" /> style={{ borderRadius: 8, height: 120 }}
</div> >
</div> <div style={{ display: 'flex', justifyContent: 'space-between', height: '100%' }}>
</Card> <div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
</Col> <div style={{ fontSize: 13, color: '#86909C', marginBottom: 4 }}>{item.title}</div>
<Col span={4}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>上次清洗时间</Text>
<div style={{ margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>2025-05-12</Text>
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">距今 12 天</Text>
</div>
</div>
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#f0f5ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Calendar size={20} color="#1890ff" />
</div>
</div>
</Card>
</Col>
<Col span={4}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Text type="secondary" style={{ fontSize: 13 }}>清洗成本预估</Text>
<div style={{ margin: '4px 0' }}>
<Text style={{ fontSize: 24, fontWeight: 'bold', color: '#faad14' }}>¥ 3,200</Text>
</div>
<div style={{ fontSize: 12 }}>
<Text type="secondary">预计单次清洗总成本</Text>
</div>
</div>
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#e6f7ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Droplets size={20} color="#1890ff" />
</div>
</div>
</Card>
</Col>
</Row>
<div style={{ display: 'flex', alignItems: 'center', gap: 6, marginBottom: 4 }}>
<div style={{ fontSize: 24, fontWeight: 700, color: item.color }}>
{item.value}
</div>
{item.unit && (
<span style={{ fontSize: 14, color: '#4E5969' }}>{item.unit}</span>
)}
{item.tag && (
<Tag
color={item.tagColor}
style={{
borderRadius: 10,
margin: 0,
padding: '0 8px',
fontSize: 12
}}
>
{item.tag}
</Tag>
)}
</div>
<div style={{ fontSize: 12, color: item.trendColor || '#86909C' }}>
{item.trend}
</div>
</div>
<div style={{
width: 40,
height: 40,
borderRadius: '50%',
background: item.bg,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
{React.cloneElement(item.icon, { style: { fontSize: 20, color: item.color } })}
</div>
</div>
</Card>
</Col>
))}
</Row>
{/* 标题栏 */} {/* 标题栏 */}
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}> <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Card, Row, Col, Statistic, Button, Space, Tag, Typography } from 'antd'; import { Card, Row, Col, Statistic, Button, Space, Tag, Typography, Table } from 'antd';
import { import {
CloudOutlined, ThunderboltOutlined, BarChartOutlined, CloudOutlined, ThunderboltOutlined, BarChartOutlined,
RiseOutlined, BellOutlined, WalletOutlined, RiseOutlined, BellOutlined, WalletOutlined,
@@ -193,10 +193,11 @@ export default function StationDashboard() {
{ device: 'INV-04', efficiency: 96.5 }, { device: 'INV-04', efficiency: 96.5 },
{ device: 'INV-05', efficiency: 95.8 } { device: 'INV-05', efficiency: 95.8 }
], ],
// 关键:纠正坐标轴 // 恢复为竖向柱状图:X轴是设备,Y轴是效率
xField: 'device', xField: 'device',
yField: 'efficiency', yField: 'efficiency',
// 关键:每个柱子不同颜色,效率越高越亮
// 每个柱子不同颜色,效率越高越亮
color: ({ efficiency }) => { color: ({ efficiency }) => {
if (efficiency >= 98) return '#00B42A'; // 亮绿(最高效) if (efficiency >= 98) return '#00B42A'; // 亮绿(最高效)
if (efficiency >= 97) return '#52C41A'; // 草绿 if (efficiency >= 97) return '#52C41A'; // 草绿
@@ -204,9 +205,12 @@ export default function StationDashboard() {
if (efficiency >= 95) return '#4080FF'; // 蓝色 if (efficiency >= 95) return '#4080FF'; // 蓝色
return '#808695'; // 灰色(最低效) return '#808695'; // 灰色(最低效)
}, },
barStyle: { barStyle: {
radius: [4, 4, 0, 0] // 顶部圆角,更美观 radius: [4, 4, 0, 0] // 顶部圆角,和第二张图效果一致
}, },
// 标签放在柱子顶部,显示百分比
label: { label: {
position: 'top', position: 'top',
style: { style: {
@@ -216,22 +220,28 @@ export default function StationDashboard() {
}, },
formatter: (item) => `${item}%` formatter: (item) => `${item}%`
}, },
// 关键:Y轴从90开始,让柱子更饱满
// Y轴从60开始(和第二张图的刻度一致),让柱子更饱满
yAxis: { yAxis: {
min: 90, min: 60,
max: 100, max: 100,
tickCount: 6, tickCount: 5, // 控制刻度数量,显示60/70/80/90/100
label: { label: {
formatter: (v) => `${v}%` formatter: (v) => `${v}`
} }
}, },
// 隐藏X轴上的线,保持简洁
xAxis: {
line: null
},
grid: { grid: {
line: { style: { stroke: '#eee', lineWidth: 0.5 } } line: { style: { stroke: '#eee', lineWidth: 0.5 } }
}, },
animation: { appear: { animation: 'scale-in-y', duration: 1000 } } animation: { appear: { animation: 'scale-in-y', duration: 1000 } }
}; };
const taskProgressConfig = { const taskProgressConfig = {
data: [ data: [
{ type: '已完成', value: 40 }, { type: '已完成', value: 40 },
@@ -250,187 +260,39 @@ export default function StationDashboard() {
const cardStyle = { borderRadius: 8, }; const cardStyle = { borderRadius: 8, };
return ( return (
<div style={{ background: '#f0f2f5', paddingTop: "12px", minHeight: '100vh', width: '100%', boxSizing: 'border-box', overflow: "hidden" }}> <div style={{ background: '#f0f2f5', paddingTop: "12px", minHeight: '100vh', width: '100%', boxSizing: 'border-box', overflow: "auto" }}>
{/* 顶部一排6个卡片 —— 等宽、不换行、自适应 */} {/* 顶部统计卡片 */}
<Row <Row gutter={[16, 16]} style={{ margin: '0 16px 16px 16px' }}>
gutter={[16, 16]} {[
style={{ { title: '今日发电量', value: '4,752', unit: 'kWh', sub: '日目标 5,000 kWh', color: '#00B42A', bg: '#E8FFEA', icon: <ThunderboltOutlined /> },
marginBottom: 16, { title: '当前功率', value: '812.6', unit: 'kW', sub: '装机容量 1,000 kWp', color: '#165DFF', bg: '#E8F3FF', icon: <DashboardOutlined /> },
width: '100%', { title: 'Performance Ratio', value: '82.6%', unit: '', sub: '昨日 81.3% ↑1.3%', color: '#00B42A', bg: '#E8FFEA', icon: <BarChartOutlined /> },
margin: '0 0 16px 0', { title: '系统可用率', value: '99.35%', unit: '', sub: '昨日 99.12% ↑0.23%', color: '#165DFF', bg: '#E8F3FF', icon: <RiseOutlined /> },
flexWrap: 'wrap', { title: '告警数量', value: '8', unit: '', sub: '未处理 5 / 已处理 3', color: '#F53F3F', bg: '#FFF1F0', icon: <BellOutlined /> },
}} { title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: <MoneyCollectOutlined /> },
> ].map((item, idx) => (
{/* 今日发电量 */} <Col key={idx} style={{ flex: "0 0 auto", minWidth: "200px" }}>
<Col flex="1 1 16.666%" style={{ height: '140px' }}> <Card bordered={false} style={{ ...cardStyle, height: "100%", minWidth: "200px" }} bodyStyle={{ padding: '16px' }}>
<Card bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '16px' }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}> <div>
<div> <div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>{item.title}</div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>今日发电量</div> <div style={{ display: 'flex', alignItems: 'baseline' }}>
<div style={{ display: 'flex', alignItems: 'baseline' }}> <span style={{ color: item.color, fontSize: 24, fontWeight: 800 }}>{item.value}</span>
<span style={{ color: '#00B42A', fontSize: 24, fontWeight: 800 }}>4,752</span> {item.unit && <span style={{ color: '#666', fontSize: 14, marginLeft: 4 }}>{item.unit}</span>}
<span style={{ color: '#666', fontSize: 14, marginLeft: 4 }}>kWh</span> </div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>{item.sub}</div>
</div> </div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>日目标 5,000 kWh</div> <div style={{
</div> width: 50, height: 50, background: item.bg, borderRadius: '50%',
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center',
width: 50, boxShadow: `0 2px 8px ${item.color}1A`
height: 50, }}>
background: '#E8FFEA', {React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 28, color: item.color } })}
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(0, 180, 42, 0.1)'
}}>
<ThunderboltOutlined style={{ fontSize: 28, color: '#00B42A' }} />
</div>
</div>
</Card>
</Col>
{/* 当前功率 */}
<Col flex="1 1 16.666%" style={{ height: '140px' }}>
<Card bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>当前功率</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#165DFF', fontSize: 24, fontWeight: 800 }}>812.6</span>
<span style={{ color: '#165DFF', fontSize: 14, marginLeft: 4 }}>kW</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>装机容量 1,000 kWp</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#E8F3FF',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(22, 93, 255, 0.1)'
}}>
<DashboardOutlined style={{ fontSize: 28, color: '#165DFF' }} />
</div>
</div>
</Card>
</Col>
{/* Performance Ratio(PR) */}
<Col flex="1 1 16.666%">
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>Performance Ratio</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#00B42A', fontSize: 24, fontWeight: 800 }}>82.6%</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
昨日 81.3% &nbsp; 环比 <span style={{ color: '#00B42A' }}>↑1.3%</span>
</div> </div>
</div> </div>
<div style={{ </Card>
width: 50, </Col>
height: 50, ))}
background: '#E8FFEA',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(0, 180, 42, 0.1)'
}}>
<BarChartOutlined style={{ fontSize: 28, color: '#00B42A' }} />
</div>
</div>
</Card>
</Col>
{/* 系统可用率 */}
<Col flex="1 1 16.666%">
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>系统可用率</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#165DFF', fontSize: 24, fontWeight: 800 }}>99.35%</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
昨日 99.12% &nbsp; 环比 <span style={{ color: '#00B42A' }}>↑0.23%</span>
</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#E8F3FF',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(22, 93, 255, 0.1)'
}}>
<RiseOutlined style={{ fontSize: 28, color: '#165DFF' }} />
</div>
</div>
</Card>
</Col>
{/* 告警数量 */}
<Col flex="1 1 16.666%">
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>告警数量</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#F53F3F', fontSize: 24, fontWeight: 800 }}>8</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
未处理 <span style={{ color: '#F53F3F' }}>5</span> &nbsp; 已处理 <span style={{ color: '#666' }}>3</span>
</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#FFF1F0',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(245, 63, 63, 0.1)'
}}>
<BellOutlined style={{ fontSize: 28, color: '#F53F3F' }} />
</div>
</div>
</Card>
</Col>
{/* 节省运维成本 */}
<Col flex="1 1 16.666%">
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>节省运维成本</div>
<div style={{ display: 'flex', alignItems: 'baseline' }}>
<span style={{ color: '#FF7D00', fontSize: 24, fontWeight: 800 }}>¥ 36,540</span>
</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>本月累计节省</div>
</div>
<div style={{
width: 50,
height: 50,
background: '#FFF7E8',
borderRadius: '50%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
boxShadow: '0 2px 8px rgba(255, 125, 0, 0.1)'
}}>
<MoneyCollectOutlined style={{ fontSize: 28, color: '#FF7D00' }} />
</div>
</div>
</Card>
</Col>
</Row> </Row>
{/* 主体:左侧图表 + 中间电站 + 右侧告警 —— 强制一行不换行 */} {/* 主体:左侧图表 + 中间电站 + 右侧告警 —— 强制一行不换行 */}

View File

@@ -208,76 +208,104 @@ const RealTimeMonitorPage = () => {
</Col> </Col>
<Col span={10}> <Col span={10}>
<Row gutter={16} style={{ marginBottom: 16 }}> <Row
<Col span={8}> gutter={[8, 8]}
<Card bordered={false} style={{ borderRadius: 8 }}> style={{
<Statistic marginBottom: 16,
title="当前总功率" flexWrap: 'wrap',
value={66.8} }}
suffix="kW" >
prefix={<ThunderboltOutlined />} {[
valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }} {
/> title: '当前总功率',
</Card> value: '812.6',
</Col> unit: 'kW',
<Col span={8}> color: '#165DFF',
<Card bordered={false} style={{ borderRadius: 8 }}> bg: '#E8F3FF',
<Statistic icon: <ThunderboltOutlined />,
title="并网状态" sub: '额定功率 1,000 kW'
value="并网正常" },
prefix={<CheckCircleOutlined />} {
valueStyle={{ color: '#52c41a', fontSize: 20, fontWeight: 700 }} title: '并网状态',
/> value: '并网正常',
</Card> unit: '',
</Col> color: '#00B42A',
<Col span={8}> bg: '#E8FFEA',
<Card bordered={false} style={{ borderRadius: 8 }}> icon: <CheckCircleOutlined />,
<Statistic sub: '频率 50.02 Hz'
title="电网电压" },
value={380.2} {
suffix="v" title: '电网电压',
prefix={<BarChartOutlined />} value: '380.2',
valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }} unit: 'V',
/> color: '#165DFF',
</Card> bg: '#E8F3FF',
</Col> icon: <BarChartOutlined />,
</Row> sub: 'A相 380.1 V'
},
{
title: '今日累计发电量',
value: '4,752',
unit: 'kWh',
color: '#00B42A',
bg: '#E8FFEA',
icon: <RiseOutlined />,
sub: '昨日 5,000 kWh'
},
{
title: '当前辐照度',
value: '815',
unit: 'W/m²',
color: '#165DFF',
bg: '#E8F3FF',
icon: <SunOutlined />,
sub: '较昨日 +5.6%'
},
{
title: '环境温度',
value: '28.0',
unit: '℃',
color: '#165DFF',
bg: '#E8F3FF',
icon: <CloudOutlined />,
sub: '较昨日 +1.2 ℃'
},
].map((item, idx) => (
<Col key={idx} style={{ minWidth: '168px', flex: '0 0 auto' }}>
<Card
bordered={false}
style={{ borderRadius: 8, width: 168, height: 100 }}
bodyStyle={{ padding: '16px', height: '100%' }}
>
<div style={{ display: 'flex', alignItems: 'flex-start', gap: 12 }}>
{/* 左侧图标 */}
<div style={{
width: 30,
height: 30,
borderRadius: '50%',
background: item.bg,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
flexShrink: 0
}}>
{React.cloneElement(item.icon, { style: { fontSize: 20, color: item.color } })}
</div>
<Row gutter={16} style={{ marginBottom: 16 }}> {/* 右侧文字 */}
<Col span={8}> <div style={{ flex: 1, minWidth: 0 }}>
<Card bordered={false} style={{ borderRadius: 8 }}> <div style={{ fontSize: 12, color: '#333', marginBottom: 4 }}>{item.title}</div>
<Statistic <div style={{ display: 'flex', alignItems: 'baseline', marginBottom: 4 }}>
title="今日发电量" <span style={{ color: item.color, fontSize: 20, fontWeight: 600 }}>{item.value}</span>
value={4752} {item.unit && <span style={{ color: item.color, fontSize: 12, marginLeft: 4 }}>{item.unit}</span>}
suffix="kWh" </div>
prefix={<RiseOutlined />} <div style={{ fontSize: 10, color: '#999' }}>{item.sub}</div>
valueStyle={{ color: '#52c41a', fontSize: 24, fontWeight: 700 }} </div>
/> </div>
</Card> </Card>
</Col> </Col>
<Col span={8}> ))}
<Card bordered={false} style={{ borderRadius: 8 }}>
<Statistic
title="辐照度"
value={815}
suffix="W/m²"
prefix={<SunOutlined />}
valueStyle={{ color: '#faad14', fontSize: 24, fontWeight: 700 }}
/>
</Card>
</Col>
<Col span={8}>
<Card bordered={false} style={{ borderRadius: 8 }}>
<Statistic
title="环境温度"
value={28.4}
suffix="℃"
valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }}
/>
</Card>
</Col>
</Row> </Row>
{/* 👇 修改后的实时功率曲线:两天对比 */} {/* 👇 修改后的实时功率曲线:两天对比 */}
<Card title="实时功率曲线" style={{ marginBottom: 16, borderRadius: 8 }}> <Card title="实时功率曲线" style={{ marginBottom: 16, borderRadius: 8 }}>
<Line <Line

View File

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

View File

@@ -1,4 +1,4 @@
import { useState } from 'react'; import React, { useState } from 'react';
import { import {
Card, Row, Col, Button, Space, Input, Select, Table, Tag, Typography, Dropdown, Menu, Card, Row, Col, Button, Space, Input, Select, Table, Tag, Typography, Dropdown, Menu,
Timeline Timeline
@@ -54,71 +54,100 @@ export default function VideoMonitorPage() {
<p style={{ color: '#666', margin: '4px 0 0' }}>实时视频监控、云台控制、录像回放与智能告警一体化管理</p> <p style={{ color: '#666', margin: '4px 0 0' }}>实时视频监控、云台控制、录像回放与智能告警一体化管理</p>
</div> </div>
{/* ========== 顶部统计卡片:统一高度 ========== */} {/* ========== 顶部统计卡片:统一高度 ========== */}
<Row gutter={[16, 16]} style={{ marginBottom: 16, display: 'flex', alignItems: 'stretch' }}> {/* 视频监控统计卡片 —— 宽高统一 + 最小宽度168px + 自动换行 */}
<Col style={{ flex: 1 }}> <Row
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}> gutter={[16, 16]}
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}> style={{
<div> marginBottom: 16,
<div style={{ fontSize: 24, fontWeight: 700 }}>32 台</div> flexWrap: 'wrap',
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>在线摄像头</div> }}
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>在线率 <span style={{ color: '#52c41a' }}>↑ 4.1%</span></div> >
</div> {[
<VideoCameraOutlined style={{ fontSize: 28, color: '#1890ff' }} /> {
</div> title: '在线摄像头',
</Card> value: '32',
</Col> unit: '台',
sub: '在线率 ↑ 4.1%',
subColor: '#52c41a',
icon: <VideoCameraOutlined />,
color: '#1890ff',
bg: '#E8F3FF'
},
{
title: '离线摄像头',
value: '2',
unit: '台',
sub: '离线率 ↑ 5.9%',
subColor: '#ff4d4f',
icon: <VideoCameraOutlined />,
color: '#999',
bg: '#F5F7FA'
},
{
title: '今日告警事件',
value: '6',
unit: '起',
sub: '较昨日 ↑ 50%',
subColor: '#ff4d4f',
icon: <BellOutlined />,
color: '#faad14',
bg: '#FFF7E8'
},
{
title: '周界告警',
value: '2',
unit: '起',
sub: '较昨日 ↑ 100%',
subColor: '#ff4d4f',
icon: <BorderOutlined />,
color: '#ff4d4f',
bg: '#FFF1F0'
},
{
title: '存储使用率',
value: '78.6',
unit: 'TB',
sub: '使用率 65.5%',
subColor: '#52c41a',
icon: <DatabaseOutlined />,
color: '#1890ff',
bg: '#E8F3FF'
},
].map((item, index) => (
<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', alignItems: 'center', height: '100%' }}>
<div>
<div style={{ fontSize: 14, color: '#0837A8', marginBottom: 4 }}>{item.title}</div>
<div style={{ display: 'flex', alignItems: 'baseline', marginBottom: 4 }}>
<span style={{ fontSize: 24, fontWeight: 700, color: '#333' }}>{item.value}</span>
<span style={{ fontSize: 14, marginLeft: 4, color: '#333' }}>{item.unit}</span>
</div>
<div style={{ fontSize: 12, color: '#999' }}>
在线率 <span style={{ color: item.subColor }}>{item.sub.replace('在线率 ', '')}</span>
</div>
</div>
<Col style={{ flex: 1 }}> <div style={{
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}> width: 48,
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}> height: 48,
<div> borderRadius: '50%',
<div style={{ fontSize: 24, fontWeight: 700 }}>2 台</div> background: item.bg,
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>离线摄像头</div> display: 'flex',
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>离线率 <span style={{ color: '#ff4d4f' }}>↑ 5.9%</span></div> alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
{React.cloneElement(item.icon, { style: { fontSize: 24, color: item.color } })}
</div>
</div> </div>
<VideoCameraOutlined style={{ fontSize: 28, color: '#999' }} /> </Card>
</div> </Col>
</Card> ))}
</Col>
<Col style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ fontSize: 24, fontWeight: 700 }}>6 起</div>
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>今日告警事件</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>较昨日 <span style={{ color: '#ff4d4f' }}>↑ 50%</span></div>
</div>
<BellOutlined style={{ fontSize: 28, color: '#faad14' }} />
</div>
</Card>
</Col>
<Col style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ fontSize: 24, fontWeight: 700 }}>2 起</div>
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>周界告警</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>较昨日 <span style={{ color: '#ff4d4f' }}>↑ 100%</span></div>
</div>
<BorderOutlined style={{ fontSize: 28, color: '#ff4d4f' }} />
</div>
</Card>
</Col>
<Col style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 8, height: '100%' }} bodyStyle={{ padding: '16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ fontSize: 24, fontWeight: 700 }}>78.6TB</div>
<div style={{ color: '#0837A8', fontSize: 14, marginTop: 4 }}>存储使用率</div>
<div style={{ fontSize: 12, color: '#999', marginTop: 4 }}>使用率 <span style={{ color: '#52c41a' }}>65.5%</span></div>
</div>
<DatabaseOutlined style={{ fontSize: 28, color: '#1890ff' }} />
</div>
</Card>
</Col>
</Row> </Row>
{/* ========== 视频区域 + AI:高度对齐 ========== */} {/* ========== 视频区域 + AI:高度对齐 ========== */}

View File

@@ -279,25 +279,62 @@ const WorkOrderPage = () => {
</div> </div>
{/* 统计卡片 */} {/* 统计卡片 */}
<Row gutter={16} style={{ marginBottom: 16 }}> {/* 统一风格统计卡片 —— 宽高一致 + 自动换行 + 最小宽度168px */}
<Row
gutter={[16, 16]}
style={{
marginBottom: 16,
flexWrap: 'wrap',
}}
>
{stats.map((item, index) => ( {stats.map((item, index) => (
<Col span={4} key={index}> <Col key={index} style={{ minWidth: '168px', flex: '1 0 auto' }}>
<Card bordered={false} bodyStyle={{ padding: '16px' }} style={{ borderRadius: 8 }}> <Card
<div style={{ display: 'flex', justifyContent: 'space-between' }}> bordered={false}
<div> bodyStyle={{ padding: '16px' }}
<Text type="secondary" style={{ fontSize: 13 }}>{item.title}</Text> style={{ borderRadius: 8, height: 120 }}
<div style={{ margin: '4px 0' }}> >
<Text style={{ fontSize: 24, fontWeight: 'bold' }}>{item.value}</Text> <div style={{ display: 'flex', justifyContent: 'space-between', height: '100%' }}>
{item.unit && <Text style={{ fontSize: 14, marginLeft: 4 }}>{item.unit}</Text>} {/* 左侧文字 */}
<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>
<div style={{ fontSize: 12 }}> <div style={{ fontSize: 12 }}>
<Text type="secondary">{item.subText}</Text> <span style={{ color: '#86909C' }}>{item.subText}</span>
<Text style={{ marginLeft: 4, color: item.subValue.startsWith('+') ? '#52c41a' : item.subValue.startsWith('-') ? '#ff4d4f' : '#1890ff', fontWeight: 'bold' }}> <span
style={{
marginLeft: 4,
fontWeight: 'bold',
color: item.subValue.startsWith('+')
? '#52c41a'
: item.subValue.startsWith('-')
? '#ff4d4f'
: '#1890ff',
}}
>
{item.subValue} {item.subValue}
</Text> </span>
</div> </div>
</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} {item.icon}
</div> </div>
</div> </div>
@@ -305,7 +342,6 @@ const WorkOrderPage = () => {
</Col> </Col>
))} ))}
</Row> </Row>
{/* 筛选栏 */} {/* 筛选栏 */}
<Card bordered={false} bodyStyle={{ padding: '12px 16px' }} style={{ borderRadius: 8, marginBottom: 16 }}> <Card bordered={false} bodyStyle={{ padding: '12px 16px' }} style={{ borderRadius: 8, marginBottom: 16 }}>
<Row gutter={16} align="middle"> <Row gutter={16} align="middle">