优化细节

This commit is contained in:
mmc
2026-05-18 14:28:42 +08:00
parent 00541fcf71
commit 002371a374
9 changed files with 202 additions and 295 deletions

View File

@@ -228,13 +228,11 @@ export default function AppLayout() {
style={{
border: '1px solid #e5e7eb',
borderRadius: 8,
//borderLeft: 0,
//borderRight: 0,
//borderBottom: 0,
margin: 4,
marginBottom: 50
}}
styles={{ body: { padding: '12px 8px' } }}
styles={{ body: { padding: '12px 4px' } }}
>
<div style={{ textAlign: 'left' }}>
<div style={{ fontSize: 14, fontWeight: 600, marginBottom: 8 }}>
@@ -244,15 +242,15 @@ export default function AppLayout() {
<img style={{ width: '100%', borderRadius: "8px", marginBottom: 8 }} src="https://images.unsplash.com/photo-1509391366360-2e959784a276?ixlib=rb-1.2.1&auto=format&fit=crop&w=1200&q=80" />
{/* <img src="电站图片地址" style={{ width: '100%', borderRadius: 4, marginBottom: 8 }} alt="电站" /> */}
<div style={{ fontSize: 10, color: '#666', lineHeight: 1.8 }}>
<div style={{ fontSize: 11, color: '#666', lineHeight: 1.8 }}>
<div>装机容量:{currentStation.capacity || '1.00'} MWp</div>
<div>并网时间:{currentStation.gridTime || '2024-01-15'}</div>
<div>电站地址:{currentStation.address || '浙江省杭州市'}</div>
<div>电站类型:{currentStation.type || '地面电站'}</div>
<div style={{ marginTop: 4, display: 'flex', alignItems: 'center' }}>
<span style={{ color: '#52c41a' }}>运行状态</span>
<span style={{ color: '#52c41a' }}>●</span>
<span style={{ color: '#52c41a', marginLeft: 4 }}>正常运行</span>
<div style={{ marginTop: 4, display: 'flex', alignItems: 'center', color: '#41ad0a' }}>
<span>运行状态:</span>
<span style={{ marginLeft: 4 }}>●</span>
<span style={{ marginLeft: 4 }}>正常运行</span>
</div>
</div>
</div>

View File

@@ -34,6 +34,7 @@ import {
SafetyCertificateOutlined,
ToolOutlined,
RightOutlined,
EyeOutlined,
} from '@ant-design/icons';
import {
Smartphone,
@@ -367,7 +368,16 @@ const BasicSettings = () => {
</Space>
)
},
{ title: '操作', key: 'action', width: 60, render: () => <Button type="link" size="small" style={{ padding: 0, fontSize: 11 }}>查看</Button>, fixed: 'right' },
{
title: '操作', key: 'action', width: 60, render: () => <Button
type="link"
size="small"
icon={<EyeOutlined />}
style={{ padding: 0, fontSize: 11 }}
>
查看
</Button>, fixed: 'right'
},
]}
dataSource={[
{ name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsmart.com', status: '在线' },

View File

@@ -121,7 +121,7 @@ export default function Organization() {
const columns = [
{ title: '组织名称', dataIndex: 'orgName' },
{ title: '组织编码', dataIndex: 'orgCode' },
//{ title: '组织编码', dataIndex: 'orgCode' },
{ title: '负责人', dataIndex: 'manager' },
{ title: '联系电话', dataIndex: 'phone' },
{ title: '邮箱', dataIndex: 'email' },
@@ -189,9 +189,9 @@ export default function Organization() {
<Input placeholder="请输入组织名称" />
</Form.Item>
<Form.Item name="orgCode" label="组织编码" rules={[{ required: true }]}>
{/*<Form.Item name="orgCode" label="组织编码" rules={[{ required: true }]}>
<Input placeholder="请输入组织编码" />
</Form.Item>
</Form.Item>*/}
<Form.Item name="manager" label="负责人" rules={[{ required: true, message: '请输入负责人' }]}>
<Input placeholder="请输入负责人" />

View File

@@ -7,6 +7,11 @@ import QRCode from 'qrcode';
import DictManager from "../DictManager";
import request from '../../api/request';
import { Country, State } from 'country-state-city';
import {
EyeOutlined,
EditOutlined,
DeleteOutlined,
} from '@ant-design/icons';
// 接口导入
import {
@@ -378,12 +383,14 @@ const SerialNumGenerate = () => {
fixed: "right",
render: (_, r) => (
<Space>
<Button type="link" onClick={() => handleView(r)}>查看</Button>
<Button type="link" icon={<EyeOutlined />} onClick={() => handleView(r)}>查看</Button>
<Popconfirm
title="确定删除?"
onConfirm={() => handleDelete(r.id)}
>
<Button type="link" danger>删除</Button>
<Button type="link" danger icon={<DeleteOutlined />} >
删除
</Button>
</Popconfirm>
</Space>
)

View File

@@ -225,7 +225,7 @@ export default function StationManage() {
// ====================== 表格列 ======================
const columns = [
{ title: '场站名称', dataIndex: 'siteName' },
{ title: '场站编号', dataIndex: 'siteCode' },
//{ title: '场站编号', dataIndex: 'siteCode' },
{
title: '所属组织',
dataIndex: 'orgId',
@@ -316,21 +316,19 @@ export default function StationManage() {
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="siteCode" label="场站编号" rules={[{ required: true }]}>
<Input placeholder="唯一编码" />
<Form.Item name="orgId" label="所属组织" rules={[{ required: true }]}>
<Select placeholder="请选择所属组织" allowClear>
{orgList.map(item => (
<Option key={item.id} value={item.id}>
{item.orgName}
</Option>
))}
</Select>
</Form.Item>
</Col>
</Row>
<Form.Item name="orgId" label="所属组织" rules={[{ required: true }]}>
<Select placeholder="请选择所属组织" allowClear>
{orgList.map(item => (
<Option key={item.id} value={item.id}>
{item.orgName}
</Option>
))}
</Select>
</Form.Item>
<Row gutter={16}>
<Col span={12}>

View File

@@ -5,9 +5,10 @@ import {
} from 'antd';
import {
BellOutlined, ClockCircleOutlined, CheckCircleOutlined, ExclamationCircleOutlined,
SearchOutlined, ReloadOutlined, FileTextOutlined, NotificationOutlined
SearchOutlined, ReloadOutlined, FileTextOutlined, NotificationOutlined,
EyeOutlined,
EditOutlined
} from '@ant-design/icons';
import { Line, Pie, Bar } from '@ant-design/charts';
import dayjs from 'dayjs';
import { exportTable } from "../../lib/utils.js"
@@ -265,9 +266,21 @@ export default function AlarmCenterPage() {
fixed: 'right',
render: (_, record) => (
<Space>
<Button type="link" onClick={() => showDetail(record.id)}>查看</Button>
{/* 新增修改按钮 */}
<Button type="link" onClick={() => openEditModal(record)}>修改</Button>
<Button
type="link"
icon={<EyeOutlined />}
onClick={() => showDetail(record.id)}
>
查看
</Button>
<Button
type="link"
icon={<EditOutlined />}
onClick={() => openEditModal(record)}
>
修改
</Button>
</Space>
)

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Card, Row, Col, Statistic, Button, Space, Tag, Typography, Table } from 'antd';
import React, { useState, useEffect, useRef } from 'react';
import { Card, Row, Col, Statistic, Button, Space, Tag, Typography, Table, message } from 'antd';
import {
CloudOutlined, ThunderboltOutlined, BarChartOutlined,
RiseOutlined, BellOutlined, WalletOutlined,
@@ -14,18 +14,27 @@ import {
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';
import { UniversalBarChart, UniversalLineChart, UniversalPieChart } from '../components/recharts';
// 👇 在这里引入你的工单接口(改成你真实的接口地址)
import { addWorkOrder } from '../api/workOrder';
import { useSelector } from 'react-redux';
const { Text } = Typography;
export default function StationDashboard() {
// 👇 消息提示(修复缺失)
const [messageApi, contextHolder] = message.useMessage();
// 👇 获取当前选中的电站(从redux拿,修复缺失)
const { currentStation } = useSelector((state) => state.station);
const { userInfo } = useSelector((state) => state.user);
// 天气数据
const [weatherdata, setWeatherData] = useState({
province: "江苏省",
city: "南通市",
@@ -41,7 +50,7 @@ export default function StationDashboard() {
});
const weatherType = getWeatherType(weatherdata.weather);
// 请求天气接口
// 请求天气
useEffect(() => {
const fetchWeather = async () => {
try {
@@ -90,7 +99,7 @@ export default function StationDashboard() {
{ type: "严重", content: "A05阵列热斑处置建议:建议现场复核PV-A05-018至PV-A05-020组件接线和旁路二极管状态,必要时更换异常组件。", desc: "整体发电偏差-2.8%" }
];
// 图表配置 —— 终极美化版(渐变+紧凑+高级)
// 图表数据
const powerTrendData = [
{ time: '00:00', actual: 1800, predict: 1600 },
{ time: '04:00', actual: 1500, predict: 1400 },
@@ -135,25 +144,73 @@ export default function StationDashboard() {
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 handleaddOrder = async () => {
if (!currentStation) {
messageApi.warning('请先选择电站');
return;
}
try {
// 严格按照你给的接口字段传参
const params = {
id: '', // 主键ID(新增为空)
orderNo: '', // 工单编号(后端生成)
orderTitle: '光伏组件清洗工单', // 工单标题
sourceType: 3, // 来源 3=清洗
orderType: 3, // 类型 3=清洗
priorityLevel: 2, // 优先级 2=中
deviceId: currentStation.id || '',
deviceName: currentStation.siteName || '电站',
deviceType: 1, // 设备类型:电站
siteId: currentStation.id || '',
siteName: currentStation.siteName || '',
orgId: userInfo?.orgId || '',
assigneeId: '',
assigneeName: '',
collaboratorIds: '',
collaboratorNames: '',
planStartTime: '',
planEndTime: '',
deadlineTime: '',
actualStartTime: '',
actualEndTime: '',
orderStatus: 1, // 状态 1=待处理
alarmId: '',
alarmNo: '',
taskDescription: '根据电站清洁度建议进行组件清洗,提升发电效率',
aiSuggestion: '系统自动生成清洗建议,预计提升发电量2.6%',
requiredEquipment: '清洗设备、水枪、抹布',
estimatedImpact: '2.6', // 影响发电量(%) 数字
handleResult: '',
handleRemark: ''
};
const res = await addWorkOrder(params);
if (res.code === 0 || res.code === 200) {
messageApi.success('✅ 清洗工单生成成功');
} else {
messageApi.error(res.msg || '❌ 工单生成失败');
}
} catch (error) {
messageApi.error('❌ 工单生成接口调用失败');
console.error(error);
}
};
const tinyColumnConfig = {
height: 40,
autoFit: true,
data: [274, 337, 81, 497, 666, 219, 269],
color: '#00B42A',
};
return (
<div style={{ background: '#f8fafc', padding: '0px', minHeight: '100vh', width: '100%', boxSizing: 'border-box' }}>
{/* 👇 必须加这个,message才能正常显示 */}
{contextHolder}
{/* 顶部统计卡片 */}
<Row gutter={[8, 8]} style={{ margin: '0 4px 0px 4px' }}>
{[
{ title: '今日发电量', value: '4,752', unit: 'kWh', sub: '日目标 5,000 kWh', color: '#00B42A', bg: '#E8FFEA', icon: <ThunderboltOutlined /> },
@@ -164,16 +221,12 @@ export default function StationDashboard() {
{ title: '节省运维成本', value: '¥ 36,540', unit: '', sub: '本月累计节省', color: '#FF7D00', bg: '#FFF7E8', icon: <MoneyCollectOutlined /> },
].map((item, idx) => (
<Col key={idx} style={{
flex: '1 1 auto', // 允许伸缩
width: 'clamp(180px, 15vw, 240px)', // 自适应宽度
flex: '1 1 auto',
width: 'clamp(180px, 15vw, 240px)',
maxWidth: '240px',
minWidth: '160px'
}}>
<Card
bordered={false}
style={{ ...cardStyle, height: "100%" }}
bodyStyle={{ padding: '12px' }}
>
<Card bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div>
<div style={{ color: '#000', fontSize: '13px', fontWeight: 600, marginBottom: 4 }}>{item.title}</div>
@@ -188,16 +241,17 @@ export default function StationDashboard() {
display: 'flex', justifyContent: 'center', alignItems: 'center',
boxShadow: `0 2px 8px ${item.color}1A`
}}>
{React.cloneElement(item.icon as React.ReactElement, { style: { fontSize: 22, color: item.color } })}
{React.cloneElement(item.icon, { style: { fontSize: 22, color: item.color } })}
</div>
</div>
</Card>
</Col>
))}
</Row>
{/* 主体布局 */}
<Row gutter={[8, 8]}>
{/* 左侧:图表列 */}
{/* 左侧图表 */}
<Col xs={24} xl={6}>
<Space direction="vertical" size={8} style={{ width: '100%' }}>
<Card title={<span style={{ fontWeight: 800 }}>发电趋势</span>} extra={<Space><SyncOutlined /><FullscreenOutlined /></Space>} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}>
@@ -210,20 +264,11 @@ export default function StationDashboard() {
dot
backgroundColor="transparent"
series={[
{
key: 'actual',
name: '实际',
color: '#165DFF',
strokeWidth: 3,
},
{
key: 'predict',
name: '预测',
color: '#00B42A',
strokeWidth: 2,
},
{ key: 'actual', name: '实际', color: '#165DFF', strokeWidth: 3 },
{ key: 'predict', name: '预测', color: '#00B42A', strokeWidth: 2 },
]}
/> </Card>
/>
</Card>
<Card title={<span style={{ fontWeight: 800 }}>辐照度与温度趋势</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}>
<UniversalLineChart
data={irradianceData}
@@ -233,20 +278,11 @@ export default function StationDashboard() {
dot
backgroundColor="transparent"
series={[
{
key: 'irradiance',
name: '辐照度',
color: '#165DFF',
strokeWidth: 3,
},
{
key: 'temperature',
name: '温度',
color: '#00B42A',
strokeWidth: 2,
},
{ key: 'irradiance', name: '辐照度', color: '#165DFF', strokeWidth: 3 },
{ key: 'temperature', name: '温度', color: '#00B42A', strokeWidth: 2 },
]}
/> </Card>
/>
</Card>
<Card title={<span style={{ fontWeight: 800 }}>逆变器效率对比</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<UniversalBarChart
data={invEfficiencyData}
@@ -255,14 +291,9 @@ export default function StationDashboard() {
backgroundColor="transparent"
barSize={28}
radius={[6, 6, 0, 0]}
series={[
{
key: 'efficiency',
name: '效率',
color: '#165DFF',
},
]}
/> </Card>
series={[{ key: 'efficiency', name: '效率', color: '#165DFF' }]}
/>
</Card>
<Card title={<span style={{ fontWeight: 800 }}>运维任务进度</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<UniversalPieChart
@@ -272,7 +303,8 @@ export default function StationDashboard() {
innerRadius={45}
outerRadius={70}
backgroundColor="transparent"
/> <div style={{ flex: 1, paddingLeft: 12 }}>
/>
<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>
@@ -283,7 +315,7 @@ export default function StationDashboard() {
</Space>
</Col>
{/* 中间:底图与状态 */}
{/* 中间 */}
<Col xs={24} xl={12}>
<Space direction="vertical" size={8} style={{ width: '100%' }}>
<Card
@@ -305,48 +337,12 @@ export default function StationDashboard() {
<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",
}}
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>
{/* 背景图层 */}
{/*<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>
<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>
<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 gutter={16}>
@@ -358,91 +354,48 @@ export default function StationDashboard() {
size="small"
columns={[
{ title: '巡检类型', dataIndex: 'name', key: 'name', ellipsis: true },
{ title: '巡检时间', dataIndex: 'time', key: 'time', },
{ title: '巡检时间', dataIndex: 'time', key: 'time' },
{ title: '巡检人员', dataIndex: 'person', key: 'person', render: (t) => t.substring(0, 10) },
{ title: '状态', dataIndex: 'status', key: 'status', render: (s) => <span style={{ color: '#52c41a', fontSize: 12 }}>● 已完成</span> },
{ title: '状态', dataIndex: 'status', key: 'status', render: () => <span style={{ color: '#52c41a', fontSize: 12 }}>● 已完成</span> },
]}
/>
</Card>
</Col>
<Col span={12}>
<Card
title={<span style={{ fontWeight: 800 }}>AI 分析摘要</span>}
bordered={false}
style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}
>
<Card title={<span style={{ fontWeight: 800 }}>AI 分析摘要</span>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
{/* 热点检测 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(114, 46, 209, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<div style={{ width: 56, height: 56, borderRadius: 12, background: 'rgba(114, 46, 209, 0.1)', display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 }}>
<ThunderboltOutlined style={{ fontSize: 24, color: '#722ed1' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>热点检测</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
发现 <span style={{ color: '#165DFF', fontWeight: 600 }}>2</span> 处组件存在异常热斑
</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>发现 <span style={{ color: '#165DFF', fontWeight: 600 }}>2</span> 处组件存在异常热斑</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
</div>
{/* 组串异常 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(82, 196, 26, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<div style={{ width: 56, height: 56, borderRadius: 12, background: 'rgba(82, 196, 26, 0.1)', display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 }}>
<AppstoreOutlined style={{ fontSize: 24, color: '#52c41a' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>组串异常</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
<span style={{ color: '#165DFF', fontWeight: 600 }}>3</span> 个组串存在发电异常
</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}><span style={{ color: '#165DFF', fontWeight: 600 }}>3</span> 个组串存在发电异常</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
</div>
{/* 发电偏差分析 */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 56,
height: 56,
borderRadius: 12,
background: 'rgba(22, 93, 255, 0.1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0
}}>
<div style={{ width: 56, height: 56, borderRadius: 12, background: 'rgba(22, 93, 255, 0.1)', display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 }}>
<RiseOutlined style={{ fontSize: 24, color: '#165DFF' }} />
</div>
<div>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1D2129' }}>发电偏差分析</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>
整体发电偏差 <span style={{ color: '#165DFF', fontWeight: 600 }}>-2.8%</span>
</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>整体发电偏差 <span style={{ color: '#165DFF', fontWeight: 600 }}>-2.8%</span></div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>查看详情</Button>
@@ -454,94 +407,34 @@ export default function StationDashboard() {
</Space>
</Col>
{/* 右侧:状态与分析 */}
{/* 右侧 */}
<Col xs={24} xl={6}>
<Space direction="vertical" size={8} style={{ width: '100%' }}>
<Card
title={<span style={{ fontWeight: 800 }}>实时告警</span>}
extra={<Button type="link" size="small">更多 &gt;</Button>}
bordered={false}
style={cardStyle}
bodyStyle={{ padding: '12px' }}
>
{/* 表头 */}
<div style={{
display: 'flex',
justifyContent: 'space-between',
marginBottom: 12,
padding: '0 4px 8px',
borderBottom: '1px solid #f0f0f0',
fontSize: 13,
color: '#666'
}}>
<Card title={<span style={{ fontWeight: 800 }}>实时告警</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 12, padding: '0 4px 8px', borderBottom: '1px solid #f0f0f0', fontSize: 13, color: '#666' }}>
<span style={{ flex: 3 }}>告警内容</span>
<span style={{ flex: 1, textAlign: 'center' }}>级别</span>
<span style={{ flex: 1.5, textAlign: 'right' }}>发生时间</span>
</div>
{realtimeAlerts.map((alert, idx) => {
// 映射级别颜色和圆点颜色
let dotColor, tagColor;
if (alert.level === '严重') {
dotColor = '#ff4d4f';
tagColor = 'error';
} else if (alert.level === '重要') {
dotColor = '#fa8c16';
tagColor = 'warning';
} else {
dotColor = '#1677ff';
tagColor = 'processing';
}
let dotColor = alert.level === '严重' ? '#ff4d4f' : alert.level === '重要' ? '#fa8c16' : '#1677ff';
let tagColor = alert.level === '严重' ? 'error' : alert.level === '重要' ? 'warning' : 'processing';
return (
<div
key={idx}
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 12,
padding: '0 4px',
borderBottom: idx < realtimeAlerts.length - 1 ? '1px solid #f5f5f5' : 'none',
paddingBottom: 8
}}
>
{/* 告警内容(带圆点) */}
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 12, padding: '0 4px', borderBottom: idx < realtimeAlerts.length - 1 ? '1px solid #f5f5f5' : 'none', paddingBottom: 8 }}>
<div style={{ display: 'flex', alignItems: 'center', flex: 3, minWidth: 0 }}>
<div style={{
width: 12,
height: 12,
borderRadius: '50%',
backgroundColor: dotColor,
marginRight: 8,
flexShrink: 0
}} />
<span style={{ fontSize: 13, fontWeight: 500, whiteSpace: 'normal', wordBreak: 'break-all' }}>
{alert.type}
</span>
<div style={{ width: 12, height: 12, borderRadius: '50%', backgroundColor: dotColor, marginRight: 8, flexShrink: 0 }} />
<span style={{ fontSize: 13, fontWeight: 500 }}>{alert.type}</span>
</div>
{/* 级别标签 */}
<div style={{ flex: 1, textAlign: 'center' }}>
<Tag color={tagColor} style={{ fontSize: 12 }}>{alert.level}</Tag>
</div>
{/* 发生时间 */}
<div style={{ flex: 1.5, textAlign: 'right', fontSize: 13, color: '#333' }}>
{alert.time}
</div>
<div style={{ flex: 1.5, textAlign: 'right', fontSize: 13 }}>{alert.time}</div>
</div>
);
})}
</Card>
<Card
title={<span style={{ fontWeight: 800 }}>设备在线状态</span>}
extra={<Button type="link" size="small">更多 &gt;</Button>}
bordered={false}
style={cardStyle}
bodyStyle={{ padding: '12px' }}
>
<Card title={<span style={{ fontWeight: 800 }}>设备在线状态</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Row gutter={[16, 16]}>
{[
{ name: '组件阵列', count: '320/320', icon: <AppstoreOutlined /> },
@@ -554,30 +447,12 @@ export default function StationDashboard() {
{ name: '巡检机器人', count: '1/1', icon: <RobotOutlined /> },
].map((item, idx) => (
<Col span={6} key={idx} style={{ display: 'flex', alignItems: 'center' }}>
{/* 绿色圆形图标 */}
<div style={{
width: 20,
height: 20,
borderRadius: '50%',
border: '2px solid #52c41a',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
marginRight: 12,
flexShrink: 0
}}>
<div style={{ fontSize: 12, color: '#52c41a' }}>
{item.icon}
</div>
<div style={{ width: 20, height: 20, borderRadius: '50%', border: '2px solid #52c41a', display: 'flex', alignItems: 'center', justifyContent: 'center', marginRight: 12, flexShrink: 0 }}>
<div style={{ fontSize: 12, color: '#52c41a' }}>{item.icon}</div>
</div>
{/* 名称+在线数 */}
<div style={{ textAlign: 'left' }}>
<div style={{ fontSize: 12, color: '#333', fontWeight: 600 }}>
{item.name}
</div>
<div style={{ fontSize: 10, color: '#52c41a', fontWeight: 700, marginTop: 4 }}>
{item.count}
</div>
<div>
<div style={{ fontSize: 12, fontWeight: 600 }}>{item.name}</div>
<div style={{ fontSize: 10, color: '#52c41a', fontWeight: 700, marginTop: 4 }}>{item.count}</div>
</div>
</Col>
))}
@@ -588,15 +463,9 @@ export default function StationDashboard() {
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'start', gap: 20 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<WeatherDisplay type={weatherType} />
{/*<WeatherDisplay type="sunny" />*/}
<div style={{ flex: 1, flexDirection: "row" }}>
<div style={{ fontSize: 28, fontWeight: 800, color: '#1890ff' }}>
{weatherdata.temperature}℃
</div>
<div style={{ fontSize: 14, color: '#333', marginBottom: 6 }}>
{weatherdata.weather}
</div>
<div>
<div style={{ fontSize: 28, fontWeight: 800, color: '#1890ff' }}>{weatherdata.temperature}℃</div>
<div style={{ fontSize: 14, color: '#333' }}>{weatherdata.weather}</div>
</div>
</div>
<div style={{ fontSize: 12, color: '#666', lineHeight: 1.6 }}>
@@ -607,6 +476,9 @@ export default function StationDashboard() {
</div>
</Card>
{/* ====================================== */}
{/* 👇 清洗建议 + 生成工单按钮(已完善) */}
{/* ====================================== */}
<Card title={<span style={{ fontWeight: 800 }}>清洗建议</span>} extra={<Button type="link" size="small">更多 &gt;</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' }}>
@@ -630,7 +502,14 @@ export default function StationDashboard() {
<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>
<Button
type="primary"
block
style={{ borderRadius: 8, height: 36 }}
onClick={handleaddOrder}
>
生成清洗工单
</Button>
</Card>
</Space>
</Col>

View File

@@ -511,8 +511,8 @@ export default function ReportCenterPage() {
title: '操作', width: 120,
render: () => (
<Space split={<Divider type="vertical" />}>
<Button type="link" size="small" style={{ fontSize: 12, padding: 0 }}>查看</Button>
<Button type="link" size="small" style={{ fontSize: 12, padding: 0 }}>下载</Button>
<Button type="link" size="small" icon={<EyeOutlined />} style={{ fontSize: 12, padding: 0 }}>查看</Button>
<Button type="link" size="small" icon={<DownloadOutlined />} style={{ fontSize: 12, padding: 0 }}>下载</Button>
</Space>
)
}

View File

@@ -407,10 +407,12 @@ const WorkOrderPage = () => {
fixed: "right",
render: (_, record) => (
<Space size={4}>
<Button type="link" size="small" onClick={() => handleRowSelect(record)}>查看</Button>
<Button type="link" size="small" onClick={() => { handleRowSelect(record); openEditModal(); }}>修改</Button>
<Button type="link" size="small" icon={<EyeOutlined />} onClick={() => handleRowSelect(record)}>查看</Button>
<Button type="link" size="small" icon={<EditOutlined />} onClick={() => { handleRowSelect(record); openEditModal(); }}>修改</Button>
<Popconfirm title="确定删除?" onConfirm={() => handleDelete(record)}>
<Button type="link" size="small" danger>删除</Button>
<Button type="link" size="small" danger icon={<DeleteOutlined />}>
删除
</Button>
</Popconfirm>
</Space>
)