自适应
This commit is contained in:
@@ -5,11 +5,19 @@ import {
|
||||
RiseOutlined, BellOutlined, WalletOutlined,
|
||||
MinusOutlined, PlusOutlined, SyncOutlined,
|
||||
MoneyCollectOutlined,
|
||||
DashboardOutlined
|
||||
DashboardOutlined,
|
||||
FullscreenOutlined,
|
||||
RocketOutlined,
|
||||
VideoCameraOutlined,
|
||||
AppstoreOutlined,
|
||||
ExperimentOutlined,
|
||||
BranchesOutlined,
|
||||
RobotOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { Line, Bar, Pie } from '@ant-design/charts';
|
||||
import { Line, Bar, Pie, } from '@ant-design/charts';
|
||||
import { getWeatherData, getWeatherType } from '../lib/utils';
|
||||
import WeatherDisplay from '../components/Weather';
|
||||
import bgMain from '../assets/images/bgmain.jpg';
|
||||
|
||||
|
||||
|
||||
@@ -257,11 +265,27 @@ export default function StationDashboard() {
|
||||
legend: { position: 'right' }
|
||||
};
|
||||
|
||||
const cardStyle = { borderRadius: 8, };
|
||||
const cardStyle = { borderRadius: 12, border: '1px solid #f0f0f0', boxShadow: '0 2px 8px rgba(0,0,0,0.04)' };
|
||||
|
||||
// 顶部卡片微型图表配置
|
||||
const tinyAreaConfig = {
|
||||
height: 40,
|
||||
autoFit: true,
|
||||
data: [264, 417, 438, 887, 309, 397, 550, 575, 563, 430, 525, 592, 492, 467, 513, 546, 983, 340, 539, 243, 226, 192],
|
||||
smooth: true,
|
||||
areaStyle: { fill: 'l(270) 0:#ffffff 0.5:#165DFF 1:#165DFF', fillOpacity: 0.1 },
|
||||
line: { color: '#165DFF' },
|
||||
};
|
||||
|
||||
const tinyColumnConfig = {
|
||||
height: 40,
|
||||
autoFit: true,
|
||||
data: [274, 337, 81, 497, 666, 219, 269],
|
||||
color: '#00B42A',
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ background: '#f0f2f5', paddingTop: "12px", minHeight: '100vh', width: '100%', boxSizing: 'border-box', overflow: "auto" }}>
|
||||
{/* 顶部统计卡片 */}
|
||||
<div style={{ background: '#f8fafc', padding: '16px', minHeight: '100vh', width: '100%', boxSizing: 'border-box' }}>
|
||||
<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 /> },
|
||||
@@ -294,357 +318,216 @@ export default function StationDashboard() {
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
{/* 主体:左侧图表 + 中间电站 + 右侧告警 —— 强制一行不换行 */}
|
||||
<Row
|
||||
gutter={[16, 16]}
|
||||
style={{
|
||||
width: '100%',
|
||||
margin: 0,
|
||||
flexWrap: 'nowrap',
|
||||
height: 'calc(100vh - 167px)',
|
||||
}}
|
||||
>
|
||||
{/* 左侧图表列 - 最终完美版:不溢出 + 一定可见 */}
|
||||
<Col
|
||||
xs={24}
|
||||
lg={6}
|
||||
style={{
|
||||
flex: '0 0 25%',
|
||||
padding: '0 8px',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
height: '100%',
|
||||
gap: '12px',
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'auto',
|
||||
scrollbarWidth: 'thin',
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
title={<span style={{ color: '#0837A8', fontWeight: 800 }}>发电趋势</span>}
|
||||
bordered={false}
|
||||
style={{ borderRadius: 8, flex: 1, padding: 0 }}
|
||||
bodyStyle={{ padding: '8px 12px' }}
|
||||
>
|
||||
<Line {...powerTrendConfig} height={140} autoFit />
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title={<span style={{ color: '#0837A8', fontWeight: 800 }}>辐照度与温度</span>}
|
||||
bordered={false}
|
||||
style={{ borderRadius: 8, flex: 1, padding: 0 }}
|
||||
bodyStyle={{ padding: '8px 12px' }}
|
||||
>
|
||||
<Line {...irradianceConfig} height={140} autoFit />
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title={<span style={{ color: '#0837A8', fontWeight: 800 }}>逆变器效率</span>}
|
||||
bordered={false}
|
||||
style={{ borderRadius: 8, flex: 1, padding: 0 }}
|
||||
bodyStyle={{ padding: '8px 12px' }}
|
||||
>
|
||||
<Bar {...invEfficiencyConfig} height={140} autoFit />
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title={<span style={{ color: '#0837A8', fontWeight: 800 }}>运维任务进度</span>}
|
||||
bordered={false}
|
||||
style={{ borderRadius: 8, flex: 1, padding: 0 }}
|
||||
bodyStyle={{ padding: '8px 12px' }}
|
||||
>
|
||||
<Pie {...taskProgressConfig} height={140} autoFit />
|
||||
</Card>
|
||||
</Col>
|
||||
<Col style={{ flex: '1 1 auto', }}>
|
||||
<Row gutter={16} style={{ marginBottom: 8, height: '75%' }}>
|
||||
<Col style={{ flex: '0 0 auto', width: '75%', height: "100%" }}>
|
||||
<Card
|
||||
title={
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<div>
|
||||
<div style={{ fontWeight: 800, color: '#0837A8' }}>电站概览</div>
|
||||
<div style={{ fontSize: 12, color: '#999' }}>GeoTIFF 正射底图 · 设备点位叠加</div>
|
||||
</div>
|
||||
|
||||
{/* 主体布局 */}
|
||||
<Row gutter={[16, 16]}>
|
||||
{/* 左侧:图表列 */}
|
||||
<Col xs={24} xl={6}>
|
||||
<Space direction="vertical" size={16} style={{ width: '100%' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>发电趋势</span>} extra={<Space><SyncOutlined /><FullscreenOutlined /></Space>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<div style={{ fontSize: 12, color: '#666', marginBottom: 12 }}>今日发电功率趋势 (kW)</div>
|
||||
<Line {...powerTrendConfig} height={180} />
|
||||
</Card>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>辐照度与温度趋势</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Line {...irradianceConfig} height={180} />
|
||||
</Card>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>逆变器效率对比</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Bar {...invEfficiencyConfig} height={180} />
|
||||
</Card>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>运维任务进度</span>} extra={<Button type="link" size="small">更多 ></Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<Pie {...taskProgressConfig} height={160} width={160} />
|
||||
<div style={{ flex: 1, paddingLeft: 12 }}>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<div style={{ fontSize: 12, color: '#999' }}>总任务</div>
|
||||
<div style={{ fontSize: 20, fontWeight: 800 }}>12</div>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
style={{ ...cardStyle, height: '100%', padding: '12px' }}
|
||||
bodyStyle={{ height: "86%" }}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Space>
|
||||
</Col>
|
||||
|
||||
>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 12 }}>
|
||||
<div style={{ display: 'flex', gap: 12, fontSize: 12 }}>
|
||||
{/* 中间:底图与状态 */}
|
||||
<Col xs={24} xl={12}>
|
||||
<Space direction="vertical" size={16} style={{ width: '100%' }}>
|
||||
<Card
|
||||
title={
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<span style={{ fontWeight: 800 }}>电站概览</span>
|
||||
<div style={{ display: 'flex', gap: 16, fontSize: 12 }}>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#52c41a', marginRight: 4 }}></span>正常</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#ff4d4f', marginRight: 4 }}></span>告警</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#888', marginRight: 4 }}></span>离线</span>
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#faad14', marginRight: 4 }}></span>维护中</span>
|
||||
</div>
|
||||
{/*<Space size="small">
|
||||
<Button size="small">适应</Button>
|
||||
<Button size="small" icon={<MinusOutlined />} />
|
||||
<Button size="small" icon={<PlusOutlined />} />
|
||||
<Button size="small" icon={<SyncOutlined />}>重置</Button>
|
||||
<span style={{ fontSize: 12 }}>65%</span>
|
||||
</Space>*/}
|
||||
</div>
|
||||
|
||||
|
||||
<div style={{ height: "100%", background: '#111827', borderRadius: 8, width: '100%', overflow: 'hidden', position: "relative" }}>
|
||||
<iframe
|
||||
src="https://pvs.satabot.com/?platform=web"
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
border: 'none',
|
||||
borderRadius: '8px',
|
||||
position: "absolute",
|
||||
}}
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
title="外部系统"
|
||||
/>
|
||||
</div> </Card>
|
||||
|
||||
|
||||
</Col>
|
||||
|
||||
{/* 右侧:实时告警 */}
|
||||
<Col
|
||||
xs={24}
|
||||
lg={6}
|
||||
style={{
|
||||
flex: '1 0 25%',
|
||||
height: "100%",
|
||||
overflow: 'auto',
|
||||
scrollbarWidth: 'thin',
|
||||
scrollbarColor: '#ccc transparent',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '12px' // 缩小卡片间距
|
||||
}}
|
||||
}
|
||||
bordered={false}
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden', height: 500 }}
|
||||
>
|
||||
{/* 实时告警 */}
|
||||
<Card
|
||||
title={
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<span style={{ fontWeight: 800, fontSize: 14, color: '#0837A8' }}>实时告警</span>
|
||||
<Button type="link" style={{ padding: 0, fontSize: 12 }}>更多</Button>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
style={{
|
||||
borderRadius: 8,
|
||||
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
|
||||
padding: '4px 8px',
|
||||
flex: 1,
|
||||
}}
|
||||
bodyStyle={{ padding: 4 }}
|
||||
>
|
||||
{realtimeAlerts.map((alert, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
marginBottom: idx === realtimeAlerts.length - 1 ? 0 : 8,
|
||||
fontSize: 12
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<Tag
|
||||
color={alert.level === 'INFO' ? 'success' : 'error'}
|
||||
style={{
|
||||
borderRadius: 12,
|
||||
padding: '0 6px',
|
||||
marginRight: 8,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 4,
|
||||
fontSize: 10
|
||||
}}
|
||||
>
|
||||
<span style={{ width: 6, height: 6, borderRadius: '50%', background: '#fff' }}></span>
|
||||
{alert.level}
|
||||
</Tag>
|
||||
<span style={{ fontSize: 12 }}>{alert.type}</span>
|
||||
</div>
|
||||
<span style={{ color: '#666', fontSize: 12 }}>{alert.time}</span>
|
||||
</div>
|
||||
))}
|
||||
</Card>
|
||||
|
||||
{/* 设备在线状态 */}
|
||||
<Card
|
||||
title={<span style={{ fontWeight: 800, fontSize: 14, color: '#0837A8' }}>设备在线状态</span>}
|
||||
bordered={false}
|
||||
style={{
|
||||
borderRadius: 8,
|
||||
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
|
||||
padding: '4px 8px',
|
||||
flex: 1,
|
||||
}}
|
||||
bodyStyle={{ padding: 4 }}
|
||||
>
|
||||
<Row gutter={[8, 8]}>
|
||||
{deviceStatus.map((item, idx) => (
|
||||
<Col span={12} key={idx}>
|
||||
<div
|
||||
style={{
|
||||
padding: '8px 4px',
|
||||
background: '#f5f7fa',
|
||||
borderRadius: 6,
|
||||
border: '1px solid #e8e8e8'
|
||||
}}
|
||||
>
|
||||
<div style={{ fontSize: 14, color: '#333', marginBottom: 2 }}>
|
||||
<span style={{ color: item.status === '正常' ? '#52c41a' : '#faad14' }}>{item.count}</span>
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: '#333', marginBottom: 2 }}>{item.name}</div>
|
||||
<div style={{ fontSize: 10, color: item.status === '正常' ? '#52c41a' : '#faad14' }}>{item.status}</div>
|
||||
</div>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title={<span style={{ fontWeight: 800, fontSize: 14, color: '#0837A8' }}>天气信息</span>}
|
||||
bordered={false}
|
||||
style={{
|
||||
borderRadius: 8,
|
||||
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
|
||||
padding: '8px',
|
||||
flex: 1,
|
||||
}}
|
||||
bodyStyle={{ padding: 8 }}
|
||||
>
|
||||
<div
|
||||
<div style={{ height: "100%", background: '#111827', borderRadius: 8, width: '100%', overflow: 'hidden', position: "relative" }}>
|
||||
<iframe
|
||||
src="https://pvs.satabot.com/?platform=web"
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 24,
|
||||
height: '100%'
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
border: 'none',
|
||||
borderRadius: '8px',
|
||||
position: "absolute",
|
||||
}}
|
||||
>
|
||||
{/* 左侧:动态天气图标 */}
|
||||
<div
|
||||
style={{
|
||||
width: 60,
|
||||
height: 60,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
}}
|
||||
>
|
||||
<WeatherDisplay type={weatherType} />
|
||||
</div>
|
||||
|
||||
{/* 右侧:天气信息 */}
|
||||
<div style={{ flex: 1, flexDirection: "row" }}>
|
||||
<div style={{ fontSize: 28, fontWeight: 800, color: '#1890ff' }}>
|
||||
{weatherdata.temperature}℃
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 14, color: '#333', marginBottom: 6 }}>
|
||||
{weatherdata.weather}
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: '#666', lineHeight: 1.6 }}>
|
||||
<div>湿度 {weatherdata.humidity}%</div>
|
||||
<div>{weatherdata.wind_direction} {weatherdata.wind_power}</div>
|
||||
<div>{weatherdata.city} · {weatherdata.district}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
title="外部系统"
|
||||
/>
|
||||
</div>
|
||||
{/* 背景图层 */}
|
||||
{/*<div style={{
|
||||
width: '100%', height: '100%',
|
||||
background: `url(${bgMain}) center/cover no-repeat`,
|
||||
backgroundColor: '#f0f2f5',
|
||||
position: 'relative'
|
||||
}}>*/}
|
||||
{/* 信息点 */}
|
||||
{/*<div style={{ position: 'absolute', top: '15%', left: '20%', background: 'rgba(0,0,0,0.6)', color: '#fff', padding: '4px 10px', borderRadius: 20, fontSize: 12 }}>
|
||||
<CloudOutlined style={{ marginRight: 4 }} /> 气象站 · <span style={{ color: '#52c41a' }}>正常</span>
|
||||
</div>
|
||||
</Card>
|
||||
{/* 清洗建议 */}
|
||||
<Card
|
||||
title={
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<span style={{ fontWeight: 800, fontSize: 14, color: '#0837A8' }}>清洗建议</span>
|
||||
<Button type="link" style={{ padding: 0, fontSize: 12 }}>详情</Button>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
style={{
|
||||
borderRadius: 8,
|
||||
boxShadow: '0 1px 2px rgba(0,0,0,0.05)',
|
||||
padding: '4px 8px',
|
||||
flex: 1,
|
||||
}}
|
||||
bodyStyle={{ padding: 4 }}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<div style={{ position: 'relative', width: 80, height: 80, marginRight: 12 }}>
|
||||
<Pie
|
||||
data={[{ type: '污染指数', value: 46 }]}
|
||||
angleField="value"
|
||||
colorField="type"
|
||||
color={['#52c41a']}
|
||||
radius={0.8}
|
||||
innerRadius={0.7}
|
||||
height={80}
|
||||
autoFit={true}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', textAlign: 'center' }}>
|
||||
<div style={{ fontSize: 24, fontWeight: 800, color: '#1890ff' }}>46</div>
|
||||
<div style={{ fontSize: 12, color: '#666' }}>分</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 12, color: '#333', marginBottom: 4 }}>污染指数中等,建议3天内安排B区清洗。</div>
|
||||
<div style={{ fontSize: 11, color: '#999' }}>预计收益 ¥ 8,278</div>
|
||||
</div>
|
||||
<div style={{ position: 'absolute', top: '10%', left: '60%', background: 'rgba(0,0,0,0.6)', color: '#fff', padding: '4px 10px', borderRadius: 20, fontSize: 12 }}>
|
||||
<RocketOutlined style={{ marginRight: 4 }} /> 无人机 · <span style={{ color: '#52c41a' }}>正常</span>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<div style={{ position: 'absolute', top: '20%', left: '80%', background: 'rgba(0,0,0,0.6)', color: '#fff', padding: '4px 10px', borderRadius: 20, fontSize: 12 }}>
|
||||
<VideoCameraOutlined style={{ marginRight: 4 }} /> 摄像头 12 · <span style={{ color: '#52c41a' }}>正常</span>
|
||||
</div>
|
||||
<div style={{ position: 'absolute', top: '40%', left: '45%', background: 'rgba(0,0,0,0.6)', color: '#fff', padding: '6px 12px', borderRadius: 20, fontSize: 13, border: '1px solid #165DFF' }}>
|
||||
<AppstoreOutlined style={{ marginRight: 4 }} /> 组件阵列 · <span style={{ color: '#52c41a' }}>正常</span>
|
||||
</div>
|
||||
<div style={{ position: 'absolute', bottom: '30%', left: '30%', background: 'rgba(0,0,0,0.6)', color: '#fff', padding: '4px 10px', borderRadius: 20, fontSize: 12 }}>
|
||||
<ThunderboltOutlined style={{ marginRight: 4 }} /> 逆变器 5 · <span style={{ color: '#52c41a' }}>正常</span>
|
||||
</div>
|
||||
<div style={{ position: 'absolute', bottom: '20%', left: '50%', background: 'rgba(0,0,0,0.6)', color: '#fff', padding: '4px 10px', borderRadius: 20, fontSize: 12 }}>
|
||||
<BranchesOutlined style={{ marginRight: 4 }} /> 汇流箱 20 · <span style={{ color: '#52c41a' }}>正常</span>
|
||||
</div>
|
||||
<div style={{ position: 'absolute', bottom: '15%', left: '70%', background: 'rgba(0,0,0,0.6)', color: '#fff', padding: '4px 10px', borderRadius: 20, fontSize: 12 }}>
|
||||
<RobotOutlined style={{ marginRight: 4 }} /> 巡检机器人 · <span style={{ color: '#52c41a' }}>正常</span>
|
||||
</div>*/}
|
||||
{/*</div>*/}
|
||||
</Card>
|
||||
|
||||
</Row>
|
||||
<Row gutter={16} style={{ height: '25%' }} >
|
||||
<Col xs={12} style={{ height: '100%' }}>
|
||||
<Card
|
||||
title={<span style={{ color: '#0837A8', fontWeight: 800 }}>近期巡检记录</span>}
|
||||
bordered={false}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
bodyStyle={{ padding: 12, height: '66%', overflow: 'auto', scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }}
|
||||
>
|
||||
{patrolRecords.map((item, idx) => (
|
||||
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 10 }}>
|
||||
<div>
|
||||
<div style={{ fontSize: 13 }}>{item.name}</div>
|
||||
<div style={{ fontSize: 12, color: '#999' }}>{item.device}</div>
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>近期巡检记录</span>} extra={<Button type="link" size="small">更多 ></Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '0 12px' }}>
|
||||
<Table
|
||||
dataSource={patrolRecords}
|
||||
pagination={false}
|
||||
size="small"
|
||||
columns={[
|
||||
{ title: '巡检类型', dataIndex: 'name', key: 'name', ellipsis: true },
|
||||
{ title: '巡检时间', dataIndex: 'time', key: 'time', render: (t) => t.substring(0, 10) },
|
||||
{ title: '状态', dataIndex: 'status', key: 'status', render: (s) => <span style={{ color: '#52c41a', fontSize: 12 }}>● 已完成</span> },
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>AI 分析摘要</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
|
||||
<Space><ThunderboltOutlined style={{ color: '#722ed1' }} /> <span style={{ fontSize: 13 }}>热点检测</span></Space>
|
||||
<Button type="link" size="small">查看详情</Button>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<Tag size="small">{item.status}</Tag>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
|
||||
<Space><AppstoreOutlined style={{ color: '#52c41a' }} /> <span style={{ fontSize: 13 }}>组串异常</span></Space>
|
||||
<Button type="link" size="small">查看详情</Button>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '8px', background: '#f9f9f9', borderRadius: 8 }}>
|
||||
<Space><RiseOutlined style={{ color: '#165DFF' }} /> <span style={{ fontSize: 13 }}>发电偏差分析</span></Space>
|
||||
<Button type="link" size="small">查看详情</Button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</Card>
|
||||
</Col>
|
||||
<Col xs={12} style={{ height: '100%', }}>
|
||||
<Card
|
||||
title={<span style={{ color: '#0837A8', fontWeight: 800 }}>AI分析摘要</span>}
|
||||
bordered={false}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
bodyStyle={{ padding: 12, height: '66%', overflow: 'auto', scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }}
|
||||
>
|
||||
{aiAnalysis.map((item, idx) => (
|
||||
<div key={idx} style={{ display: 'flex', marginBottom: 10 }}>
|
||||
<Tag color={item.type === 'AI分析' ? 'blue' : 'red'} style={{ marginRight: 8 }}>{item.type}</Tag>
|
||||
<span style={{ fontSize: 12 }}>{item.content}</span>
|
||||
</div>
|
||||
))}
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</Space>
|
||||
</Col>
|
||||
</Row >
|
||||
</div >
|
||||
|
||||
{/* 右侧:状态与分析 */}
|
||||
<Col xs={24} xl={6}>
|
||||
<Space direction="vertical" size={16} style={{ width: '100%' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>实时告警</span>} extra={<Button type="link" size="small">更多 ></Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
{realtimeAlerts.map((alert, idx) => (
|
||||
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 12, borderBottom: '1px solid #f5f5f5', paddingBottom: 8 }}>
|
||||
<div>
|
||||
<div style={{ fontSize: 13, fontWeight: 500 }}>{alert.type}</div>
|
||||
<div style={{ fontSize: 11, color: '#999' }}>发生时间: 10:24:15</div>
|
||||
</div>
|
||||
<Tag color={alert.level === '严重' ? 'error' : 'warning'}>{alert.level}</Tag>
|
||||
</div>
|
||||
))}
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontWeight: 800 }}>设备在线状态</span>} extra={<Button type="link" size="small">更多 ></Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Row gutter={[8, 8]}>
|
||||
{[
|
||||
{ name: '组件阵列', count: '320/320', icon: <AppstoreOutlined /> },
|
||||
{ name: '逆变器', count: '5/5', icon: <ThunderboltOutlined /> },
|
||||
{ name: '汇流箱', count: '20/20', icon: <BranchesOutlined /> },
|
||||
{ name: '气象站', count: '1/1', icon: <CloudOutlined /> },
|
||||
{ name: '摄像头', count: '12/12', icon: <VideoCameraOutlined /> },
|
||||
{ name: '环境传感器', count: '8/8', icon: <ExperimentOutlined /> },
|
||||
{ name: '无人机', count: '1/1', icon: <RocketOutlined /> },
|
||||
{ name: '巡检机器人', count: '1/1', icon: <RobotOutlined /> },
|
||||
].map((item, idx) => (
|
||||
<Col span={6} key={idx} style={{ textAlign: 'center' }}>
|
||||
<div style={{ background: '#f9f9f9', borderRadius: 8, padding: '8px 4px' }}>
|
||||
<div style={{ color: '#165DFF', fontSize: 16 }}>{item.icon}</div>
|
||||
<div style={{ fontSize: 11, color: '#333', fontWeight: 600, marginTop: 4 }}>{item.count}</div>
|
||||
<div style={{ fontSize: 10, color: '#999' }}>{item.name}</div>
|
||||
</div>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontWeight: 800 }}>天气信息</span>} extra={<Button type="link" size="small">详细 ></Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||
<div style={{ fontSize: 32, color: '#faad14' }}><CloudOutlined /></div>
|
||||
<div>
|
||||
<div style={{ fontSize: 24, fontWeight: 800 }}>28℃</div>
|
||||
<div style={{ fontSize: 14 }}>晴</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: '#666', lineHeight: '20px' }}>
|
||||
<div>辐照度: 815 W/m²</div>
|
||||
<div>组件温度: 45.6 ℃</div>
|
||||
<div>湿度: 56%</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontWeight: 800 }}>清洗建议</span>} extra={<Button type="link" size="small">更多 ></Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 16, marginBottom: 16 }}>
|
||||
<div style={{ width: 80, height: 80, position: 'relative' }}>
|
||||
{/*<RingProgress percent={0.85} width={80} height={80} color={['#00B42A', '#E8FFEA']} innerRadius={0.7} radius={1}
|
||||
statistic={{
|
||||
content: {
|
||||
style: { fontSize: '14px', fontWeight: 800, color: '#000' },
|
||||
formatter: () => '85分',
|
||||
},
|
||||
}}
|
||||
/>*/}
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div style={{ fontSize: 12, color: '#666', marginBottom: 4 }}>建议清洗时间: <span style={{ color: '#165DFF' }}>3天内</span></div>
|
||||
<div style={{ fontSize: 12, color: '#666', marginBottom: 4 }}>预计提升发电量: <span style={{ color: '#00B42A' }}>2.6 %</span></div>
|
||||
<div style={{ fontSize: 12, color: '#666' }}>预计提升电量: <span style={{ color: '#00B42A' }}>120 kWh/天</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<Button type="primary" block style={{ borderRadius: 8, height: 36 }} onClick={() => message.success('清洗工单已生成')}>生成清洗工单</Button>
|
||||
</Card>
|
||||
</Space>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user