中英文切换

This commit is contained in:
mmc
2026-08-14 09:02:52 +08:00
parent a8af55a856
commit 62b03bba03
94 changed files with 19723 additions and 2766 deletions

View File

@@ -101,9 +101,9 @@ export default function StationDashboard() {
];
const aiAnalysis = [
{ type: "AI分析", content: "AI发现逆变器温度与组串电流存在轻微异常,建议优先复核A区设备。", desc: "发现2处组件存在异常热斑" },
{ type: t('constants.critical'), content: "INV-A02散热检修建议:建议检查INV-A02散热风扇、风道和运行负载,持续高温时转维修工单。", desc: "3个组串存在发电异常" },
{ type: t('constants.critical'), content: "A05阵列热斑处置建议:建议现场复核PV-A05-018至PV-A05-020组件接线和旁路二极管状态,必要时更换异常组件。", desc: "整体发电偏差-2.8%" }
{ type: "AI分析", content: t('home.fixed2AiInverterFixed2TemperatureAbnormalADevice'), desc: "发现2处组件存在异常热斑" },
{ type: t('constants.critical'), content: t('home.invA02MaintenanceInvA02Repair'), desc: "3个组串存在发电异常" },
{ type: t('constants.critical'), content: t('home.a05HotspotPvA05018PvA05020StatusAbnormal'), desc: "整体发电偏差-2.8%" }
];
// 图表数据
@@ -200,12 +200,12 @@ export default function StationDashboard() {
const res = await addWorkOrder(params);
if (res.code === 0 || res.code === 200) {
messageApi.success('✅ 清洗工单生成成功');
messageApi.success(t('home.cleaningOrderGeneratedSuccessfullyFixed2'));
} else {
messageApi.error(res.msg || '❌ 工单生成失败');
}
} catch (error) {
messageApi.error('❌ 工单生成接口调用失败');
messageApi.error(t('home.failedFixed2'));
console.error(error);
}
};
@@ -222,7 +222,7 @@ export default function StationDashboard() {
}
} catch (err) {
messageApi.error('加载失败');
messageApi.error(t('common.loadFailed'));
} finally {
}
@@ -322,7 +322,7 @@ export default function StationDashboard() {
series={[{ key: 'efficiency', name: '效率', color: '#165DFF' }]}
/>
</Card>
<Card title={<span style={{ fontWeight: 800 }}>{t('home.maintenanceProgress')}</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Card title={<span style={{ fontWeight: 800 }}>{t('home.maintenanceProgress')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<UniversalPieChart
data={taskProgressData}
@@ -334,7 +334,7 @@ export default function StationDashboard() {
/>
<div style={{ flex: 1, paddingLeft: 12 }}>
<div style={{ textAlign: 'center' }}>
<div style={{ fontSize: 12, color: '#999' }}>总任务</div>
<div style={{ fontSize: 12, color: '#999' }}>{t('home.taskSuspended2Fixed2')}</div>
<div style={{ fontSize: 20, fontWeight: 800 }}>12</div>
</div>
</div>
@@ -351,10 +351,10 @@ export default function StationDashboard() {
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<span style={{ fontWeight: 800 }}>{t('home.stationOverview')}</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>roles.normal</span>
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#ff4d4f', marginRight: 4 }}></span>constants.sourceAlert</span>
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#888', marginRight: 4 }}></span>devices.offline</span>
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#faad14', marginRight: 4 }}></span>维护中</span>
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#52c41a', marginRight: 4 }}></span>{t('roles.normal')}</span>
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#ff4d4f', marginRight: 4 }}></span>{t('constants.sourceAlert')}</span>
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#888', marginRight: 4 }}></span>{t('devices.offline')}</span>
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ width: 8, height: 8, borderRadius: '50%', background: '#faad14', marginRight: 4 }}></span>{t('home.underMaintenance')}</span>
</div>
</div>
}
@@ -368,7 +368,7 @@ export default function StationDashboard() {
style={{ width: '100%', height: '100%', border: 'none', borderRadius: '8px', position: "absolute" }}
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
title="外部系统"
title={t('home.s20')}
/>*/}
<CesiumMap from="other" />
@@ -378,16 +378,16 @@ export default function StationDashboard() {
<Row gutter={16}>
<Col span={12}>
<Card title={<span style={{ fontWeight: 800 }}>{t('home.recentInspection')}</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '0 12px' }}>
<Card title={<span style={{ fontWeight: 800 }}>{t('home.recentInspection')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '0 12px' }}>
<Table
dataSource={patrolRecords}
pagination={false}
size="small"
columns={[
{ title: '巡检类型', dataIndex: 'name', key: 'name', ellipsis: true },
{ title: '巡检时间', dataIndex: 'time', key: 'time' },
{ title: '巡检人员', dataIndex: 'person', key: 'person', render: (t) => t.substring(0, 10) },
{ title: t('roles.status'), dataIndex: 'status', key: 'status', render: () => <span style={{ color: '#52c41a', fontSize: 12 }}>● 已完成</span> },
{ title: t('home.fixed2InspectionFixed2TypeFixed2'), dataIndex: 'name', key: 'name', ellipsis: true },
{ title: t('home.fixed2InspectionFixed2TimeFixed2'), dataIndex: 'time', key: 'time' },
{ title: t('home.fixed2Inspection'), dataIndex: 'person', key: 'person', render: (t) => t.substring(0, 10) },
{ title: t('roles.status'), dataIndex: 'status', key: 'status', render: () => <span style={{ color: '#52c41a', fontSize: 12 }}>{t('home.completedFixed2')}</span> },
]}
/>
</Card>
@@ -401,8 +401,8 @@ export default function StationDashboard() {
<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: 16, fontWeight: 600, color: '#1D2129' }}>{t('home.detectFixed2')}</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>{t('home.s4')}<span style={{ color: '#165DFF', fontWeight: 600 }}>2</span>{t('home.abnormalFixed2HotspotFixed2')}</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>{t('common.viewDetail')}</Button>
@@ -413,8 +413,8 @@ export default function StationDashboard() {
<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: 16, fontWeight: 600, color: '#1D2129' }}>{t('home.abnormalFixed2')}</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}><span style={{ color: '#165DFF', fontWeight: 600 }}>3</span>{t('home.generationFixed2AbnormalFixed2')}</div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>{t('common.viewDetail')}</Button>
@@ -425,8 +425,8 @@ export default function StationDashboard() {
<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: 16, fontWeight: 600, color: '#1D2129' }}>{t('home.fixed2GenerationDeviation')}</div>
<div style={{ fontSize: 14, color: '#4E5969', marginTop: 4 }}>{t('home.generationDeviationFixed2')}<span style={{ color: '#165DFF', fontWeight: 600 }}>-2.8%</span></div>
</div>
</div>
<Button type="link" size="small" style={{ color: '#165DFF' }}>{t('common.viewDetail')}</Button>
@@ -441,11 +441,11 @@ export default function StationDashboard() {
{/* 右侧 */}
<Col xs={24} xl={6}>
<Space direction="vertical" size={8} style={{ width: '100%' }}>
<Card title={<span style={{ fontWeight: 800 }}>{t('alerts.realtimeAlert')}</span>} extra={<Button type="link" size="small" onClick={() => navigate('/alerts/all')}>更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Card title={<span style={{ fontWeight: 800 }}>{t('alerts.realtimeAlert')}</span>} extra={<Button type="link" size="small" onClick={() => navigate('/alerts/all')}>{t('home.fixed2MoreGt')}</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>
<span style={{ flex: 3 }}>{t('alerts.alarmContent')}</span>
<span style={{ flex: 1, textAlign: 'center' }}>{t('alerts.level')}</span>
<span style={{ flex: 1.5, textAlign: 'right' }}>{t('alerts.occurTime')}</span>
</div>
{alarmList.slice(0, 2).map((alert, idx) => {
let dotColor = alert.alarmLevel === 'ERROR' ? '#ff4d4f' : alert.alarmLevel === 'WARNING' ? '#fa8c16' : '#1677ff';
@@ -465,7 +465,7 @@ export default function StationDashboard() {
})}
</Card>
<Card title={<span style={{ fontWeight: 800 }}>{t('home.deviceOnlineStatus')}</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Card title={<span style={{ fontWeight: 800 }}>{t('home.deviceOnlineStatus')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Row gutter={[16, 16]}>
{[
{ name: '组件阵列', count: '320/320', icon: <AppstoreOutlined /> },
@@ -490,7 +490,7 @@ export default function StationDashboard() {
</Row>
</Card>
<Card title={<span style={{ fontWeight: 800 }}>{t('home.weatherInfo')}</span>} extra={<Button type="link" size="small">详细 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Card title={<span style={{ fontWeight: 800 }}>{t('home.weatherInfo')}</span>} extra={<Button type="link" size="small">{t('home.gt')}</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'start', gap: 20 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<WeatherDisplay type={weatherType} />
@@ -510,7 +510,7 @@ export default function StationDashboard() {
{/* ====================================== */}
{/* 👇 清洗建议 + 生成工单按钮(已完善) */}
{/* ====================================== */}
<Card title={<span style={{ fontWeight: 800 }}>{t('clean.cleaningSuggestion')}</span>} extra={<Button type="link" size="small">更多 &gt;</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
<Card title={<span style={{ fontWeight: 800 }}>{t('clean.cleaningSuggestion')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</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' }}>
<UniversalPieChart
@@ -528,9 +528,9 @@ export default function StationDashboard() {
/>
</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 style={{ fontSize: 12, color: '#666', marginBottom: 4 }}>{t('home.cleaningFixed2Time')}<span style={{ color: '#165DFF' }}>{t('home.3')}</span></div>
<div style={{ fontSize: 12, color: '#666', marginBottom: 4 }}>{t('home.fixed2Battery')}<span style={{ color: '#00B42A' }}>2.6 %</span></div>
<div style={{ fontSize: 12, color: '#666' }}>{t('home.battery')}<span style={{ color: '#00B42A' }}>{t('home.120')}</span></div>
</div>
</div>
<Button
@@ -538,9 +538,7 @@ export default function StationDashboard() {
block
style={{ borderRadius: 8, height: 36 }}
onClick={handleaddOrder}
>
生成清洗工单
</Button>
>{t('home.generateCleanOrder')}</Button>
</Card>
</Space>
</Col>