卡片的自适应修改
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
||||
message,
|
||||
Typography,
|
||||
Space,
|
||||
Modal,
|
||||
} from 'antd';
|
||||
import {
|
||||
CloudOutlined,
|
||||
@@ -22,7 +21,6 @@ import {
|
||||
DatabaseOutlined,
|
||||
CalendarOutlined,
|
||||
CheckCircleOutlined,
|
||||
SyncOutlined,
|
||||
DownloadOutlined,
|
||||
FileTextOutlined,
|
||||
DeleteOutlined,
|
||||
@@ -101,305 +99,306 @@ const BasicSettings = () => {
|
||||
{ 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 (
|
||||
<div style={{ padding: 24, background: '#f0f2f5', minHeight: '100vh' }}>
|
||||
{/* 顶部卡片 */}
|
||||
<Row gutter={16} style={{ marginBottom: 24 }}>
|
||||
<Col span={5}>
|
||||
<AntdCard size="small">
|
||||
<Space>
|
||||
<div style={{ background: '#e6f4ff', borderRadius: 8, padding: 8 }}>
|
||||
<CloudOutlined style={{ color: '#1677ff', fontSize: 20 }} />
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 13, color: '#666' }}>当前版本</div>
|
||||
<div style={{ fontWeight: 600 }}>v2.8.1 <Tag color="blue">最新版</Tag></div>
|
||||
</div>
|
||||
</Space>
|
||||
</AntdCard>
|
||||
</Col>
|
||||
<Col span={5}>
|
||||
<AntdCard size="small">
|
||||
<Space>
|
||||
<div style={{ background: '#f6ffed', borderRadius: 8, padding: 8 }}>
|
||||
<TeamOutlined style={{ color: '#52c41a', fontSize: 20 }} />
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 13, color: '#666' }}>在线用户</div>
|
||||
<div style={{ fontWeight: 600 }}>12 <span style={{ color: '#52c41a', fontSize: 12 }}>↑ 2</span></div>
|
||||
</div>
|
||||
</Space>
|
||||
</AntdCard>
|
||||
</Col>
|
||||
<Col span={5}>
|
||||
<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>
|
||||
|
||||
{/* 顶部卡片 —— 统一风格 + 自动换行 + 圆角8px */}
|
||||
<Row gutter={[16, 16]} style={{ marginBottom: 24, flexWrap: 'wrap' }}>
|
||||
{topCards.map((item, idx) => (
|
||||
<Col key={idx} style={{ minWidth: '160px', flex: '1 0 auto' }}>
|
||||
<AntdCard
|
||||
size="small"
|
||||
style={{ borderRadius: 8, width: '100%' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
>
|
||||
<Space>
|
||||
<div style={{ background: item.bg, borderRadius: 8, padding: 8 }}>
|
||||
{item.icon}
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 13, color: '#666' }}>{item.title}</div>
|
||||
<div style={{ fontWeight: 600, display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
{item.value}
|
||||
{item.tag && <Tag color={item.tagColor} style={{ margin: 0 }}>{item.tag}</Tag>}
|
||||
{item.trend && (
|
||||
<span style={{ color: item.trendColor, fontSize: 12 }}>
|
||||
{item.trend}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Space>
|
||||
</AntdCard>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
<Row
|
||||
gutter={16}
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'stretch', // 关键:等高
|
||||
}}
|
||||
>
|
||||
<Row gutter={16}>
|
||||
{/* 左侧主内容 */}
|
||||
<Col span={16} style={{ display: 'flex', flexDirection: 'column' }}>
|
||||
<div style={{ flex: 1 }}>
|
||||
{/* 平台参数 */}
|
||||
<AntdCard title="平台参数" style={{ marginBottom: 16 }}>
|
||||
<Form form={form} layout="vertical">
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Form.Item label="系统名称" name="systemName">
|
||||
<Input defaultValue="光伏场站智能监控与运维系统" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="默认电站" name="defaultSite">
|
||||
<Select defaultValue="1MW 光伏电站">
|
||||
<Select.Option value="1MW">1MW 光伏电站</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Form.Item label="数据刷新频率" name="refreshRate">
|
||||
<Select defaultValue="5分钟">
|
||||
<Select.Option value="5">5分钟</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="地图服务" name="mapService">
|
||||
<Select defaultValue="高德地图">
|
||||
<Select.Option value="amap">高德地图</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Form.Item label="AI建议自动生成" valuePropName="checked">
|
||||
<Col span={16}>
|
||||
|
||||
{/* 平台参数 */}
|
||||
<AntdCard title="平台参数" style={{ marginBottom: 16, borderRadius: 8 }}>
|
||||
<Form form={form} layout="vertical">
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Form.Item label="系统名称" name="systemName">
|
||||
<Input defaultValue="光伏场站智能监控与运维系统" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="默认电站" name="defaultSite">
|
||||
<Select defaultValue="1MW 光伏电站">
|
||||
<Select.Option value="1MW">1MW 光伏电站</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Form.Item label="数据刷新频率" name="refreshRate">
|
||||
<Select defaultValue="5分钟">
|
||||
<Select.Option value="5">5分钟</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="地图服务" name="mapService">
|
||||
<Select defaultValue="高德地图">
|
||||
<Select.Option value="amap">高德地图</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<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 />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</AntdCard>
|
||||
</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>
|
||||
<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 }}>
|
||||
<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 />
|
||||
</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>
|
||||
<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, borderRadius: 8 }}>
|
||||
<Table
|
||||
size="small"
|
||||
pagination={false}
|
||||
columns={[
|
||||
{ title: '用户名', dataIndex: 'name' },
|
||||
{ title: '角色', dataIndex: 'role' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '状态', dataIndex: 'status', render: (text) => <span style={{ color: '#52c41a' }}>{text}</span> },
|
||||
]}
|
||||
dataSource={[
|
||||
{ name: '张运维', role: '超级管理员', phone: '138****0001', status: '在线' },
|
||||
{ name: '李工程师', role: '运维工程师', phone: '139****0002', status: '在线' },
|
||||
{ name: '王班长', role: '巡检主管', phone: '137****0003', status: '在线' },
|
||||
{ name: '赵分析师', role: '数据分析师', phone: '136****0004', status: '在线' },
|
||||
]}
|
||||
/>
|
||||
</AntdCard>
|
||||
|
||||
{/* 用户与权限预览 */}
|
||||
<AntdCard title="用户与权限预览" style={{ marginBottom: 16 }}>
|
||||
<Table
|
||||
size="small"
|
||||
pagination={false}
|
||||
columns={[
|
||||
{ title: '用户名', dataIndex: 'name' },
|
||||
{ title: '角色', dataIndex: 'role' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '状态', dataIndex: 'status', render: (text) => <span style={{ color: '#52c41a' }}>{text}</span> },
|
||||
]}
|
||||
dataSource={[
|
||||
{ name: '张运维', role: '超级管理员', phone: '138****0001', status: '在线' },
|
||||
{ name: '李工程师', role: '运维工程师', phone: '139****0002', status: '在线' },
|
||||
{ name: '王班长', role: '巡检主管', phone: '137****0003', status: '在线' },
|
||||
{ name: '赵分析师', role: '数据分析师', phone: '136****0004', status: '在线' },
|
||||
]}
|
||||
/>
|
||||
</AntdCard>
|
||||
{/* MQTT接入状态 */}
|
||||
<AntdCard title="MQTT接入状态" style={{ marginBottom: 16 }}>
|
||||
<div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>来自 /pv/mqtt/status,后端未登录时显示预览兜底数据</div>
|
||||
<Row gutter={16}>
|
||||
{mqttStatusData.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>
|
||||
{/* MQTT接入状态 */}
|
||||
<AntdCard title="MQTT接入状态" style={{ marginBottom: 16, borderRadius: 8 }}>
|
||||
<div style={{ fontSize: 13, color: '#666', marginBottom: 16 }}>来自 /pv/mqtt/status,后端未登录时显示预览兜底数据</div>
|
||||
<Row gutter={16}>
|
||||
{mqttStatusData.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>
|
||||
|
||||
{/* MQTT消息日志 */}
|
||||
<AntdCard title="MQTT消息日志" style={{ marginBottom: 16, borderRadius: 8 }}>
|
||||
<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, borderRadius: 8 }}>
|
||||
<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 span={8} style={{ display: 'flex', flexDirection: 'column' }}>
|
||||
<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>
|
||||
<Col span={8}>
|
||||
|
||||
{/* 服务配置展示 */}
|
||||
<AntdCard title="服务配置展示" style={{ marginBottom: 16 }}>
|
||||
{serviceConfigData.map((item, index) => (
|
||||
<div key={index} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 0', borderBottom: index !== serviceConfigData.length - 1 ? '1px solid #e8e8e8' : 'none' }}>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, marginBottom: 4 }}>{item.name}</div>
|
||||
<div style={{ fontSize: 13 }}>{item.value}</div>
|
||||
{/* 设备接入状态 */}
|
||||
<AntdCard title="设备接入状态" style={{ marginBottom: 16, borderRadius: 8 }}>
|
||||
<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>
|
||||
<Tag color={item.statusColor === '#52c41a' ? 'success' : item.statusColor === '#fa8c16' ? 'warning' : 'default'}>{item.status}</Tag>
|
||||
</div>
|
||||
</Col>
|
||||
))}
|
||||
</AntdCard>
|
||||
</Row>
|
||||
</AntdCard>
|
||||
|
||||
{/* 视频服务配置状态 */}
|
||||
<AntdCard title="视频服务配置状态" style={{ marginBottom: 16 }}>
|
||||
<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>
|
||||
{/* 服务配置展示 */}
|
||||
<AntdCard title="服务配置展示" style={{ marginBottom: 16, borderRadius: 8 }}>
|
||||
{serviceConfigData.map((item, index) => (
|
||||
<div key={index} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 0', borderBottom: index !== serviceConfigData.length - 1 ? '1px solid #e8e8e8' : 'none' }}>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, marginBottom: 4 }}>{item.name}</div>
|
||||
<div style={{ fontSize: 13 }}>{item.value}</div>
|
||||
</div>
|
||||
<Tag color={item.statusColor === '#52c41a' ? 'success' : item.statusColor === '#fa8c16' ? 'warning' : 'default'}>{item.status}</Tag>
|
||||
</div>
|
||||
))}
|
||||
</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>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
@@ -346,16 +346,16 @@ export default function AlarmCenterPage() {
|
||||
</Row>
|
||||
|
||||
{/* 统计卡片 */}
|
||||
<Row gutter={16} style={{ marginBottom: 16, flexWrap: 'wrap' }}>
|
||||
<Col xs={24} sm={12} md={8} lg={4} xl={4}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, whiteSpace: 'nowrap' }}>
|
||||
<Row align="middle" gutter={16}>
|
||||
<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={{ overflow: 'hidden' }}>
|
||||
<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}
|
||||
@@ -365,15 +365,15 @@ export default function AlarmCenterPage() {
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={12} md={8} lg={4} xl={4}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, whiteSpace: 'nowrap' }}>
|
||||
<Row align="middle" gutter={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' }}>
|
||||
<ExclamationCircleOutlined style={{ fontSize: 24, color: '#FF4D4F' }} />
|
||||
</div>
|
||||
</Col>
|
||||
<Col style={{ overflow: 'hidden' }}>
|
||||
<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}
|
||||
@@ -383,15 +383,15 @@ export default function AlarmCenterPage() {
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={12} md={8} lg={4} xl={4}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, whiteSpace: 'nowrap' }}>
|
||||
<Row align="middle" gutter={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: '#FFF7E8', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
||||
<ClockCircleOutlined style={{ fontSize: 24, color: '#FA8C16' }} />
|
||||
</div>
|
||||
</Col>
|
||||
<Col style={{ overflow: 'hidden' }}>
|
||||
<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}
|
||||
@@ -401,15 +401,15 @@ export default function AlarmCenterPage() {
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={12} md={8} lg={4} xl={4}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, whiteSpace: 'nowrap' }}>
|
||||
<Row align="middle" gutter={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: '#E8F3FF', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
||||
<ReloadOutlined style={{ fontSize: 24, color: '#1890FF' }} />
|
||||
</div>
|
||||
</Col>
|
||||
<Col style={{ overflow: 'hidden' }}>
|
||||
<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}
|
||||
@@ -419,15 +419,15 @@ export default function AlarmCenterPage() {
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={12} md={8} lg={4} xl={4}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '16px 20px' }} style={{ borderRadius: 8, whiteSpace: 'nowrap' }}>
|
||||
<Row align="middle" gutter={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: '#E8FFEA', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
||||
<CheckCircleOutlined style={{ fontSize: 24, color: '#00B42A' }} />
|
||||
</div>
|
||||
</Col>
|
||||
<Col style={{ overflow: 'hidden' }}>
|
||||
<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}
|
||||
|
||||
@@ -66,13 +66,44 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
|
||||
const totalMowers = devicesAll?.filter(d => d.productName?.includes('割草机')).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 [
|
||||
{ title: '无人机机场状态', icon: <EnvironmentOutlined />, value: `${onlineDrones} / ${totalDrones}`, desc: onlineDrones > 0 ? '在线' : '离线', sub: `可调度 ${onlineDrones} 架`, color: '#1890ff' },
|
||||
//{ title: '巡检机器人', icon: <RobotOutlined />, value: `${totalRobots} 台`, desc: '', sub: `执行中 ${activeRobots}`, color: '#722ed1' },
|
||||
{ title: '机器人', icon: <BranchesOutlined />, value: `${totalMowers} 台`, desc: '', sub: `作业中 ${activeMowers}`, color: '#13c2c2' },
|
||||
{ title: '无人机', icon: <CloudOutlined />, value: `${totalDrones} 架`, desc: '', sub: `待命 ${planedevices?.filter(d => d.productName?.includes('清洗') && d.onlineStatus === 1).length || 0}`, color: '#eb2f96' },
|
||||
{ title: '设备平均电量', icon: <ThunderboltOutlined />, value: '86%', desc: '', sub: '', color: '#52c41a' },
|
||||
{ title: '今日任务执行', icon: <CheckCircleOutlined />, value: '12 / 15', desc: '', sub: '完成率 80%', color: '#2f54eb' },
|
||||
{
|
||||
title: '无人机机场状态',
|
||||
icon: <EnvironmentOutlined />,
|
||||
value: `${onlineDrones} / ${totalDrones}`,
|
||||
sub: `可调度 ${onlineDrones} 架`,
|
||||
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]);
|
||||
|
||||
@@ -139,24 +170,55 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
|
||||
return (
|
||||
<Content style={{ maxWidth: 1800, margin: '0 auto', }}>
|
||||
{/*<AgoraTextTest />*/}
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', marginBottom: 20 }}>
|
||||
<Row gutter={[16, 16]} style={{ marginBottom: 20, flexWrap: 'wrap' }}>
|
||||
{dynamicTopCards.map((card, idx) => (
|
||||
<div key={idx} style={{ flex: 1 }}>
|
||||
<Card bordered={false} style={{ borderRadius: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.05)', height: '110px', display: 'flex', alignItems: 'center' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12, width: '100%' }}>
|
||||
<div style={{ width: 48, height: 48, borderRadius: 10, background: `${card.color}15`, color: card.color, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 20 }}>
|
||||
<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)',
|
||||
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}
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
|
||||
{/* 右侧文字 */}
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 13, color: '#666' }}>{card.title}</div>
|
||||
<div style={{ fontSize: 24, fontWeight: 700, color: '#222' }}>{card.value}</div>
|
||||
{card.sub && <div style={{ fontSize: 12, color: '#999' }}>{card.sub}</div>}
|
||||
<div style={{ fontSize: 24, fontWeight: 700, color: '#222', lineHeight: '30px' }}>
|
||||
{card.value}
|
||||
</div>
|
||||
{card.sub && (
|
||||
<div style={{ fontSize: 12, color: '#999', marginTop: 2 }}>
|
||||
{card.sub}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</Col>
|
||||
))}
|
||||
</div>
|
||||
</Row>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col xs={24} lg={14}>
|
||||
|
||||
@@ -135,30 +135,50 @@ export default function AIDiagnosisPage() {
|
||||
return (
|
||||
<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: '发电偏差', value: '-4.35%', trend: '较昨日 -1.02%', icon: <FallOutlined />, color: '#F53F3F', bg: '#FFF1F0' },
|
||||
{ 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', 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: '86.3分', trend: '较昨日 -1.7', icon: <CheckCircleOutlined />, color: '#00B42A', bg: '#E8FFEA' },
|
||||
{ title: '预测发电量', value: '4,821kWh', trend: '较昨日 +2.6% ↑', icon: <ThunderboltOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#00B42A' },
|
||||
{ title: '健康度评分', value: '86.3', unit: '分', trend: '较昨日 -1.7', icon: <CheckCircleOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F' },
|
||||
{ title: '预测发电量', value: '4,821', unit: 'kWh', trend: '较昨日 +2.6% ↑', icon: <ThunderboltOutlined />, color: '#00B42A', bg: '#E8FFEA', trendColor: '#00B42A' },
|
||||
].map((item, index) => (
|
||||
<Col span={4} key={index}>
|
||||
<Card bordered={false} bodyStyle={{ padding: 16 }} style={cardStyle}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<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: '#4E5969', marginBottom: 8 }}>{item.title}</div>
|
||||
<div style={{ fontSize: 24, fontWeight: 700, color: item.color }}>
|
||||
{item.value.includes('分') ? <>{item.value.replace('分', '')}<span style={{ fontSize: 14 }}>分</span></> :
|
||||
item.value.includes('kWh') ? <>{item.value.replace('kWh', '')}<span style={{ fontSize: 14 }}>kWh</span></> : item.value}
|
||||
<div style={{ fontSize: 24, fontWeight: 700, color: item.color, display: 'flex', alignItems: 'baseline', gap: 4 }}>
|
||||
{item.value}
|
||||
{item.unit && <span style={{ fontSize: 14, fontWeight: 400 }}>{item.unit}</span>}
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: item.trendColor || '#86909C', marginTop: 8 }}>
|
||||
{item.trend} {item.trend.includes('-') && <FallOutlined />}
|
||||
{item.trend}
|
||||
</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>
|
||||
</Card>
|
||||
|
||||
@@ -113,120 +113,127 @@ export default function CleanOptimizationPage() {
|
||||
return (
|
||||
<div style={{ background: '#f0f2f5', minHeight: '100vh', padding: '16px 24px' }}>
|
||||
{/* 顶部指标卡片 */}
|
||||
<Row gutter={12} style={{ marginBottom: 16 }}>
|
||||
<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={{ 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 }}>
|
||||
<Text type="secondary">较昨日</Text>
|
||||
<Text style={{ color: '#ff4d4f', marginLeft: 4, fontWeight: 'bold' }}>▼ 5.3</Text>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#fff7e6', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<SunOutlined style={{ color: '#faad14', fontSize: 20 }} />
|
||||
</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' }}>8 / 20</Text>
|
||||
</div>
|
||||
<div style={{ fontSize: 12 }}>
|
||||
<Text type="secondary">占比 40%</Text>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#e6f7ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<LayoutGrid 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: '#1890ff' }}>12,850</Text>
|
||||
<Text style={{ fontSize: 14, marginLeft: 4 }}>kWh</Text>
|
||||
</div>
|
||||
<div style={{ fontSize: 12 }}>
|
||||
<Text type="secondary">占当前日发电量 14.2%</Text>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#f0f5ff', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<TrendingUp 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' }}>¥ 7,286</Text>
|
||||
</div>
|
||||
<div style={{ fontSize: 12 }}>
|
||||
<Text type="secondary">按电价 0.568 元/kWh 计算</Text>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ width: 40, height: 40, borderRadius: '50%', background: '#fff7e6', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<DollarSign size={20} color="#faad14" />
|
||||
</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' }}>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>
|
||||
{/* 清洗建议卡片组 —— 宽高统一 + 最小168px + 自动换行 + 风格统一 */}
|
||||
<Row
|
||||
gutter={[12, 12]}
|
||||
style={{
|
||||
marginBottom: 16,
|
||||
flexWrap: 'wrap',
|
||||
}}
|
||||
>
|
||||
{[
|
||||
{
|
||||
title: '污染指数',
|
||||
value: '68.5',
|
||||
unit: '',
|
||||
tag: '中等',
|
||||
tagColor: '#52c41a',
|
||||
trend: '较昨日 ▼ 5.3',
|
||||
trendColor: '#ff4d4f',
|
||||
icon: <SunOutlined />,
|
||||
color: '#faad14',
|
||||
bg: '#fff7e6'
|
||||
},
|
||||
{
|
||||
title: '建议清洗区块数',
|
||||
value: '8 / 20',
|
||||
unit: '',
|
||||
trend: '占比 40%',
|
||||
icon: <LayoutGrid />,
|
||||
color: '#1890ff',
|
||||
bg: '#e6f7ff'
|
||||
},
|
||||
{
|
||||
title: '预计发电提升',
|
||||
value: '12,850',
|
||||
unit: 'kWh',
|
||||
trend: '占当前日发电量 14.2%',
|
||||
icon: <TrendingUp />,
|
||||
color: '#1890ff',
|
||||
bg: '#f0f5ff'
|
||||
},
|
||||
{
|
||||
title: '预计收益提升',
|
||||
value: '¥ 7,286',
|
||||
unit: '',
|
||||
trend: '按电价 0.568 元/kWh 计算',
|
||||
icon: <DollarSign />,
|
||||
color: '#faad14',
|
||||
bg: '#fff7e6'
|
||||
},
|
||||
{
|
||||
title: '上次清洗时间',
|
||||
value: '2025-05-12',
|
||||
unit: '',
|
||||
trend: '距今 12 天',
|
||||
icon: <Calendar />,
|
||||
color: '#1890ff',
|
||||
bg: '#f0f5ff'
|
||||
},
|
||||
{
|
||||
title: '清洗成本预估',
|
||||
value: '¥ 3,200',
|
||||
unit: '',
|
||||
trend: '预计单次清洗总成本',
|
||||
icon: <Droplets />,
|
||||
color: '#1890ff',
|
||||
bg: '#e6f7ff'
|
||||
},
|
||||
].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', height: '100%' }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
|
||||
<div style={{ fontSize: 13, color: '#86909C', marginBottom: 4 }}>{item.title}</div>
|
||||
|
||||
<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', alignItems: 'center', gap: 8 }}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 {
|
||||
CloudOutlined, ThunderboltOutlined, BarChartOutlined,
|
||||
RiseOutlined, BellOutlined, WalletOutlined,
|
||||
@@ -193,10 +193,11 @@ export default function StationDashboard() {
|
||||
{ device: 'INV-04', efficiency: 96.5 },
|
||||
{ device: 'INV-05', efficiency: 95.8 }
|
||||
],
|
||||
// 关键:纠正坐标轴
|
||||
// 恢复为竖向柱状图:X轴是设备,Y轴是效率
|
||||
xField: 'device',
|
||||
yField: 'efficiency',
|
||||
// 关键:每个柱子不同颜色,效率越高越亮
|
||||
|
||||
// 每个柱子不同颜色,效率越高越亮
|
||||
color: ({ efficiency }) => {
|
||||
if (efficiency >= 98) return '#00B42A'; // 亮绿(最高效)
|
||||
if (efficiency >= 97) return '#52C41A'; // 草绿
|
||||
@@ -204,9 +205,12 @@ export default function StationDashboard() {
|
||||
if (efficiency >= 95) return '#4080FF'; // 蓝色
|
||||
return '#808695'; // 灰色(最低效)
|
||||
},
|
||||
|
||||
barStyle: {
|
||||
radius: [4, 4, 0, 0] // 顶部圆角,更美观
|
||||
radius: [4, 4, 0, 0] // 顶部圆角,和第二张图效果一致
|
||||
},
|
||||
|
||||
// 标签放在柱子顶部,显示百分比
|
||||
label: {
|
||||
position: 'top',
|
||||
style: {
|
||||
@@ -216,22 +220,28 @@ export default function StationDashboard() {
|
||||
},
|
||||
formatter: (item) => `${item}%`
|
||||
},
|
||||
// 关键:Y轴从90开始,让柱子更饱满
|
||||
|
||||
// Y轴从60开始(和第二张图的刻度一致),让柱子更饱满
|
||||
yAxis: {
|
||||
min: 90,
|
||||
min: 60,
|
||||
max: 100,
|
||||
tickCount: 6,
|
||||
tickCount: 5, // 控制刻度数量,显示60/70/80/90/100
|
||||
label: {
|
||||
formatter: (v) => `${v}%`
|
||||
formatter: (v) => `${v}`
|
||||
}
|
||||
},
|
||||
|
||||
// 隐藏X轴上的线,保持简洁
|
||||
xAxis: {
|
||||
line: null
|
||||
},
|
||||
|
||||
grid: {
|
||||
line: { style: { stroke: '#eee', lineWidth: 0.5 } }
|
||||
},
|
||||
animation: { appear: { animation: 'scale-in-y', duration: 1000 } }
|
||||
};
|
||||
|
||||
|
||||
const taskProgressConfig = {
|
||||
data: [
|
||||
{ type: '已完成', value: 40 },
|
||||
@@ -250,187 +260,39 @@ export default function StationDashboard() {
|
||||
const cardStyle = { borderRadius: 8, };
|
||||
|
||||
return (
|
||||
<div style={{ background: '#f0f2f5', paddingTop: "12px", minHeight: '100vh', width: '100%', boxSizing: 'border-box', overflow: "hidden" }}>
|
||||
{/* 顶部一排6个卡片 —— 等宽、不换行、自适应 */}
|
||||
<Row
|
||||
gutter={[16, 16]}
|
||||
style={{
|
||||
marginBottom: 16,
|
||||
width: '100%',
|
||||
margin: '0 0 16px 0',
|
||||
flexWrap: 'wrap',
|
||||
}}
|
||||
>
|
||||
{/* 今日发电量 */}
|
||||
<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: '#00B42A', fontSize: 24, fontWeight: 800 }}>4,752</span>
|
||||
<span style={{ color: '#666', fontSize: 14, marginLeft: 4 }}>kWh</span>
|
||||
<div style={{ background: '#f0f2f5', paddingTop: "12px", minHeight: '100vh', width: '100%', boxSizing: 'border-box', overflow: "auto" }}>
|
||||
{/* 顶部统计卡片 */}
|
||||
<Row gutter={[16, 16]} style={{ margin: '0 16px 16px 16px' }}>
|
||||
{[
|
||||
{ title: '今日发电量', value: '4,752', unit: 'kWh', sub: '日目标 5,000 kWh', color: '#00B42A', bg: '#E8FFEA', icon: <ThunderboltOutlined /> },
|
||||
{ title: '当前功率', value: '812.6', unit: 'kW', sub: '装机容量 1,000 kWp', color: '#165DFF', bg: '#E8F3FF', icon: <DashboardOutlined /> },
|
||||
{ title: 'Performance Ratio', value: '82.6%', unit: '', sub: '昨日 81.3% ↑1.3%', color: '#00B42A', bg: '#E8FFEA', icon: <BarChartOutlined /> },
|
||||
{ title: '系统可用率', value: '99.35%', unit: '', sub: '昨日 99.12% ↑0.23%', color: '#165DFF', bg: '#E8F3FF', icon: <RiseOutlined /> },
|
||||
{ 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" }}>
|
||||
<Card bordered={false} style={{ ...cardStyle, height: "100%", minWidth: "200px" }} bodyStyle={{ padding: '16px' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<div>
|
||||
<div style={{ color: '#000', fontSize: 14, fontWeight: 600, marginBottom: 8 }}>{item.title}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'baseline' }}>
|
||||
<span style={{ color: item.color, fontSize: 24, fontWeight: 800 }}>{item.value}</span>
|
||||
{item.unit && <span style={{ color: '#666', fontSize: 14, marginLeft: 4 }}>{item.unit}</span>}
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>{item.sub}</div>
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>日目标 5,000 kWh</div>
|
||||
</div>
|
||||
<div style={{
|
||||
width: 50,
|
||||
height: 50,
|
||||
background: '#E8FFEA',
|
||||
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% 环比 <span style={{ color: '#00B42A' }}>↑1.3%</span>
|
||||
<div style={{
|
||||
width: 50, height: 50, background: item.bg, borderRadius: '50%',
|
||||
display: 'flex', justifyContent: 'center', alignItems: 'center',
|
||||
boxShadow: `0 2px 8px ${item.color}1A`
|
||||
}}>
|
||||
{React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 28, color: item.color } })}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{
|
||||
width: 50,
|
||||
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% 环比 <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> 已处理 <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>
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
{/* 主体:左侧图表 + 中间电站 + 右侧告警 —— 强制一行不换行 */}
|
||||
|
||||
@@ -208,76 +208,104 @@ const RealTimeMonitorPage = () => {
|
||||
</Col>
|
||||
|
||||
<Col span={10}>
|
||||
<Row gutter={16} style={{ marginBottom: 16 }}>
|
||||
<Col span={8}>
|
||||
<Card bordered={false} style={{ borderRadius: 8 }}>
|
||||
<Statistic
|
||||
title="当前总功率"
|
||||
value={66.8}
|
||||
suffix="kW"
|
||||
prefix={<ThunderboltOutlined />}
|
||||
valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card bordered={false} style={{ borderRadius: 8 }}>
|
||||
<Statistic
|
||||
title="并网状态"
|
||||
value="并网正常"
|
||||
prefix={<CheckCircleOutlined />}
|
||||
valueStyle={{ color: '#52c41a', fontSize: 20, fontWeight: 700 }}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card bordered={false} style={{ borderRadius: 8 }}>
|
||||
<Statistic
|
||||
title="电网电压"
|
||||
value={380.2}
|
||||
suffix="v"
|
||||
prefix={<BarChartOutlined />}
|
||||
valueStyle={{ color: '#1890ff', fontSize: 24, fontWeight: 700 }}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row
|
||||
gutter={[8, 8]}
|
||||
style={{
|
||||
marginBottom: 16,
|
||||
flexWrap: 'wrap',
|
||||
}}
|
||||
>
|
||||
{[
|
||||
{
|
||||
title: '当前总功率',
|
||||
value: '812.6',
|
||||
unit: 'kW',
|
||||
color: '#165DFF',
|
||||
bg: '#E8F3FF',
|
||||
icon: <ThunderboltOutlined />,
|
||||
sub: '额定功率 1,000 kW'
|
||||
},
|
||||
{
|
||||
title: '并网状态',
|
||||
value: '并网正常',
|
||||
unit: '',
|
||||
color: '#00B42A',
|
||||
bg: '#E8FFEA',
|
||||
icon: <CheckCircleOutlined />,
|
||||
sub: '频率 50.02 Hz'
|
||||
},
|
||||
{
|
||||
title: '电网电压',
|
||||
value: '380.2',
|
||||
unit: 'V',
|
||||
color: '#165DFF',
|
||||
bg: '#E8F3FF',
|
||||
icon: <BarChartOutlined />,
|
||||
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}>
|
||||
<Card bordered={false} style={{ borderRadius: 8 }}>
|
||||
<Statistic
|
||||
title="今日发电量"
|
||||
value={4752}
|
||||
suffix="kWh"
|
||||
prefix={<RiseOutlined />}
|
||||
valueStyle={{ color: '#52c41a', fontSize: 24, fontWeight: 700 }}
|
||||
/>
|
||||
</Card>
|
||||
</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>
|
||||
{/* 右侧文字 */}
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 12, color: '#333', marginBottom: 4 }}>{item.title}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'baseline', marginBottom: 4 }}>
|
||||
<span style={{ color: item.color, fontSize: 20, fontWeight: 600 }}>{item.value}</span>
|
||||
{item.unit && <span style={{ color: item.color, fontSize: 12, marginLeft: 4 }}>{item.unit}</span>}
|
||||
</div>
|
||||
<div style={{ fontSize: 10, color: '#999' }}>{item.sub}</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
{/* 👇 修改后的实时功率曲线:两天对比 */}
|
||||
<Card title="实时功率曲线" style={{ marginBottom: 16, borderRadius: 8 }}>
|
||||
<Line
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Card, Row, Col, Button, Space, Input, Select, Table, Tag, Typography, Dropdown, Menu,
|
||||
Timeline
|
||||
@@ -54,71 +54,100 @@ export default function VideoMonitorPage() {
|
||||
<p style={{ color: '#666', margin: '4px 0 0' }}>实时视频监控、云台控制、录像回放与智能告警一体化管理</p>
|
||||
</div>
|
||||
{/* ========== 顶部统计卡片:统一高度 ========== */}
|
||||
<Row gutter={[16, 16]} style={{ marginBottom: 16, display: 'flex', alignItems: 'stretch' }}>
|
||||
<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 }}>32 台</div>
|
||||
<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>
|
||||
</Card>
|
||||
</Col>
|
||||
{/* 视频监控统计卡片 —— 宽高统一 + 最小宽度168px + 自动换行 */}
|
||||
<Row
|
||||
gutter={[16, 16]}
|
||||
style={{
|
||||
marginBottom: 16,
|
||||
flexWrap: 'wrap',
|
||||
}}
|
||||
>
|
||||
{[
|
||||
{
|
||||
title: '在线摄像头',
|
||||
value: '32',
|
||||
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 }}>
|
||||
<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' }}>↑ 5.9%</span></div>
|
||||
<div style={{
|
||||
width: 48,
|
||||
height: 48,
|
||||
borderRadius: '50%',
|
||||
background: item.bg,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexShrink: 0
|
||||
}}>
|
||||
{React.cloneElement(item.icon, { style: { fontSize: 24, color: item.color } })}
|
||||
</div>
|
||||
</div>
|
||||
<VideoCameraOutlined style={{ fontSize: 28, color: '#999' }} />
|
||||
</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 }}>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>
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
{/* ========== 视频区域 + AI:高度对齐 ========== */}
|
||||
|
||||
@@ -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