- 重复模式
+ {t('devices.repeatMode')}
setTaskForm({ ...taskForm, repeat_type: val })}
options={[
- { label: '不重复', value: 'nonrepeating' },
- { label: '每日', value: 'daily' },
- { label: '每周', value: 'weekly' },
+ { label: t('devices.s81'), value: 'nonrepeating' },
+ { label: t('devices.s82'), value: 'daily' },
+ { label: t('devices.s83'), value: 'weekly' },
{ label: '每月(日期)', value: 'absolute_monthly' },
{ label: '每月(星期)', value: 'relative_monthly' }
]}
@@ -2362,7 +2339,7 @@ hover:overflow-y-auto"> {planList.length > 0 ? planList.map((task, index
{taskForm.repeat_type !== 'nonrepeating' && (
-
重复间隔
+
{t('devices.repeatInterval')}
{planList.length > 0 ? planList.map((task, index
{t('common.cancel')}
- 创建航线任务
+ {t('devices.createWaylineTask')}
diff --git a/src/components/devices/DeviceOverviewPage.tsx b/src/components/devices/DeviceOverviewPage.tsx
index a908c57..df9e41a 100644
--- a/src/components/devices/DeviceOverviewPage.tsx
+++ b/src/components/devices/DeviceOverviewPage.tsx
@@ -40,14 +40,6 @@ import { useTranslation } from 'react-i18next';
const { Content } = Layout;
const { Text, Title } = Typography;
-const taskTimeline = [
- { time: '10:24:18', color: 'blue', text: 'UAV-C01 开始执行清洗航线 C-05', status: '任务开始' },
- { time: '10:21:35', color: 'orange', text: 'RBT-01 开始执行巡检航线 P-02', status: '任务开始' },
- { time: '10:18:02', color: 'green', text: 'GR-02 开始除草作业 G-01', status: '任务开始' },
- { time: '10:15:47', color: 'gray', text: 'UAV-C02 任务待命就绪', status: '待命就绪' },
- { time: '10:12:33', color: 'blue', text: 'UAV-C01 再次返机补水', status: '返机补给' },
- { time: '09:58:10', color: 'green', text: 'RBT-02 完成巡检航线 P-01', status: '任务完成' },
-];
export default function DeviceOverviewPage() {
@@ -89,6 +81,15 @@ export default function DeviceOverviewPage() {
{ time: '10:12:35', device: 'UAV-C01', type: t('constants.sourceAlert'), desc: '返航补水' },
{ time: '10:05:22', device: 'RBT-01', type: '事件', desc: '电量较低,建议回充', level: '低电量' },
];
+ const taskTimeline = [
+ { time: '10:24:18', color: 'blue', text: t('devices.uavC01ExecuteFixed2CleaningC05'), status: '任务开始' },
+ { time: '10:21:35', color: 'orange', text: t('devices.rbt01ExecuteFixed2InspectionP02'), status: '任务开始' },
+ { time: '10:18:02', color: 'green', text: t('devices.gr02G01'), status: '任务开始' },
+ { time: '10:15:47', color: 'gray', text: t('devices.uavC02TaskSuspended2'), status: '待命就绪' },
+ { time: '10:12:33', color: 'blue', text: t('devices.uavC01'), status: '返机补给' },
+ { time: '09:58:10', color: 'green', text: t('devices.rbt02CompleteFixed2InspectionP01'), status: '任务完成' },
+ ];
+
@@ -143,7 +144,7 @@ export default function DeviceOverviewPage() {
// 仅机器人允许编辑,无人机直接提示
const isRobot = !record.gateway_sn && !record.drone_callsign;
if (!isRobot) {
- message.info('仅支持编辑机器人设备别名');
+ message.info(t('devices.editFixed2RobotFixed2Device'));
return;
}
setCurrentEditRobot(record);
@@ -154,7 +155,7 @@ export default function DeviceOverviewPage() {
// 确认保存别名
const handleSaveRobotAlias = async () => {
if (!currentEditRobot || !editAliasInput.trim()) {
- utils.message.warning('设备别名不能为空');
+ utils.message.warning(t('devices.fixed2Device'));
return;
}
setEditLoading(true);
@@ -167,15 +168,15 @@ export default function DeviceOverviewPage() {
const res = await updateDeviceAliasApi(data);
if (res.code === 200 && res.data == true) {
fetchAllData();
- utils.message.success('别名修改成功');
+ utils.message.success(t('devices.modifiedSuccessfullyFixed2'));
setEditRobotModalOpen(false);
} else {
- utils.message.error('修改失败,请重试');
+ utils.message.error(t('devices.fixed2ModificationFailed'));
}
} catch (err) {
console.error('修改别名报错', err);
- utils.message.error('接口异常,修改失败');
+ utils.message.error(t('devices.fixed2Fixed2AbnormalModificationFailedFixed2'));
} finally {
setEditLoading(false);
}
@@ -438,7 +439,7 @@ export default function DeviceOverviewPage() {
setCurrentParamDevice(data);
setParamModalOpen(true);
} else {
- utils.message.error('无权限');
+ utils.message.error(t('devices.noPermission'));
}
}
})
@@ -470,7 +471,7 @@ export default function DeviceOverviewPage() {
return [
{
- title: '无人机机场状态',
+ title: t('devices.fixed2DroneAirportFixed2StatusFixed2'),
icon:
,
value: `${onlineDrones} / ${totalDrones}`,
sub: `可调度 ${onlineDrones} 架`,
@@ -486,7 +487,7 @@ export default function DeviceOverviewPage() {
iconBg: '#E6FFFA'
},
{
- title: '除草机器人',
+ title: t('devices.mowingRobot'),
icon:
,
value: `${totalMowers} 台`,
sub: `任务中 ${activeMowers}`,
@@ -494,7 +495,7 @@ export default function DeviceOverviewPage() {
iconBg: '#F9F0FF'
},
{
- title: '清洗无人机',
+ title: t('devices.washDrone'),
icon:
,
value: `${totalDrones} 架`,
sub: `待命 ${washDroneStandby}`,
@@ -502,7 +503,7 @@ export default function DeviceOverviewPage() {
iconBg: '#FFF1F3'
},
//{
- // title: '设备平均电量',
+ // title: t('devices.fixed2DeviceBatteryFixed2'),
// icon:
,
// value: `${finalAvgBattery}%`,
// sub: '',
@@ -510,7 +511,7 @@ export default function DeviceOverviewPage() {
// iconBg: '#E8FFEA'
//},
{
- title: '今日任务执行',
+ title: t('devices.todayTaskExecute'),
icon:
,
value: `${completedTasks} / ${totalTasks}`,
sub: `完成率 ${completionRate}%`,
@@ -537,11 +538,11 @@ export default function DeviceOverviewPage() {
})) || [];
}, [devicesAll]);
- const handleStart = () => message.success('任务已启动');
- const handlePause = () => message.info('任务已暂停');
- const handleReturn = () => message.info('返航指令已下发');
- const handleRecharge = () => message.info('回充指令已下发');
- const handleEmergencyStop = () => message.error('已触发急停!');
+ const handleStart = () => message.success(t('devices.fixed2TaskSuspended22'));
+ const handlePause = () => message.info(t('devices.taskPaused'));
+ const handleReturn = () => message.info(t('devices.fixed2ReturnHomeFixed2CommandIssuedFixed2'));
+ const handleRecharge = () => message.info(t('devices.commandIssuedFixed2'));
+ const handleEmergencyStop = () => message.error(t('devices.s73'));
const fix2 = (val) => {
if (val === null || val === undefined || isNaN(val)) return '-';
@@ -578,7 +579,7 @@ export default function DeviceOverviewPage() {
return (
- 装备总览
+ {t('devices.fixed2Equipment')}
@@ -626,28 +627,28 @@ export default function DeviceOverviewPage() {
- 装备协同态势图>} extra={ } />} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }} bodyStyle={{ padding: 0 }}>
+ {t('devices.fixed2Equipment')}>} extra={ } />} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }} bodyStyle={{ padding: 0 }}>
-
图例说明
+
{t('devices.s22')}
-
——— 巡检航线
-
——— 机器人路径
-
——— 清洗路径
-
🚗 机器位置
-
✈️ 无人机位置
-
● 补给/充电点
-
■ 障碍/禁入区
+
——— {t('devices.fixed2Inspection')}
+
——— {t('devices.robotPath')}
+
——— {t('devices.cleaningPath')}
+
{t('devices.locationFixed2')}
+
{t('devices.dronePositionFixed2')}
+
● {t('devices.chargePointFixed2')}
+
■ {t('devices.s9')}
- 装备调度列表>} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }}>
+ {t('devices.fixed2EquipmentListFixed2')}>} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }}>
record.id || record.serialNumber || record.device_sn} size="small" pagination={false}
columns={[
- { title: '装备名称', dataIndex: 'name', width: 140 },
+ { title: t('devices.fixed2EquipmentFixed2NameFixed2'), dataIndex: 'name', width: 140 },
{ title: t('common.type'), dataIndex: 'type', width: 90 },
{
title: t('workOrder.currentStatus'),
@@ -659,7 +660,7 @@ export default function DeviceOverviewPage() {
return {text} ;
}
}, {
- title: '模式', dataIndex: 'mode', width: 70, render: (text) => {
+ title: t('devices.abMode'), dataIndex: 'mode', width: 70, render: (text) => {
let color = 'default';
if (text === '作业中') color = 'processing';
if (text === t('devices.idle')) color = 'success';
@@ -683,8 +684,8 @@ export default function DeviceOverviewPage() {
/>;
}
}, { title: t('aiAnalysis.location'), dataIndex: 'position', width: 90 },
- //{ title: '当前任务', dataIndex: 'task', width: 100 },
- { title: '通讯状态', dataIndex: 'comm', width: 100, render: v => },
+ //{ title: t('devices.fixed2CurrentFixed2TaskSuspended2Fixed2'), dataIndex: 'task', width: 100 },
+ { title: t('devices.statusFixed2'), dataIndex: 'comm', width: 100, render: v => },
{
title: t('roles.actions'),
key: 'action',
@@ -700,7 +701,7 @@ export default function DeviceOverviewPage() {
onClick={() => openEditRobotModal(record)}
title={t('roles.edit')}
/>
-
+
- 控制日志 / 告警记录 >} bordered={false} style={{ borderRadius: 8 }} extra={全部级别 ▼
}>
+ {t('devices.fixed2ControlFixed2LogDesc6Alert')} >} bordered={false} style={{ borderRadius: 8 }} extra={{t('devices.fixed2AllLevels')}
}>
{t} },
- { title: '设备', dataIndex: 'device', width: 100, render: t => {t} },
+ { title: t('devices.device'), dataIndex: 'device', width: 100, render: t => {t} },
{ title: t('common.type'), dataIndex: 'type', width: 70, render: r => { let c = '#52c41a'; if (r === t('constants.sourceAlert')) c = '#fa8c16'; if (t === 'events') c = '#1890ff'; return {t}
} },
{ title: t('common.description'), dataIndex: 'desc', render: t => {t} },
{ title: '', width: 70, render: (_, r) => r.level ? {r.level} : null }
]}
/>
- 查看更多日志
+ {t('devices.viewMoreLogs')}
- 设备控制面板>} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }} bodyStyle={{ padding: 12, paddingBottom: 0 }}>
+ {t('devices.deviceControlPanel')}>} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }} bodyStyle={{ padding: 12, paddingBottom: 0 }}>
}
style={{ borderRadius: 4, fontSize: 11, marginLeft: 'auto' }}
onClick={() => onViewStatus(selectedDevice.device_sn || selectedDevice.serialNumber)}
- >详情
+ >{t('common.detail')}
@@ -791,40 +792,40 @@ export default function DeviceOverviewPage() {
{selectedDevice.productName && (
- 产品类型
+ {t('devices.productType')}
{getVal(selectedDevice.productName)}
)}
- 设备SN
+ {t('systemSetting.fixed2DeviceSn')}
{getVal(selectedDevice.device_sn || selectedDevice.serialNumber)}
{selectedDevice.activeTime && (
- 激活时间
+ {t('devices.timeFixed2')}
{selectedDevice.activeTime}
)}
{selectedDevice.firmwareVersion && (
- 固件版本
+ {t('devices.firmwareVersion')}
v{selectedDevice.firmwareVersion}
)}
{(selectedDevice.productName?.includes(t('constants.uav')) || selectedDevice.device_sn) && (
<>
- 飞行高度
+ {t('devices.flightAltitude')}
{fix2(realtimeDevice?.height)} m
- 飞行风速
+ {t('devices.s21')}
{fix2(realtimeDevice?.wind_speed)} m/s
-
rtk数量
+
{t('devices.rtkQuantityFixed2')}
- 启动
+ {t('devices.s23')}
{t('video.pause')}
{t('devices.returnHome')}
- 回充
+ {t('devices.s24')}
@@ -849,7 +850,7 @@ export default function DeviceOverviewPage() {
-
实时画面
+
{t('devices.s25')}
{isUAV && (
)}
@@ -886,9 +887,7 @@ export default function DeviceOverviewPage() {
ready={ready}
/>
) : (
-
- 视频加载中...
-
+
{t('video.videoLoading')}
)
) : (
// ========== 未点击播放时:显示播放大按钮 ==========
@@ -931,7 +930,7 @@ export default function DeviceOverviewPage() {
onClick={() => {
setRobotPlayActive(false);
}}
- >停止视频
+ >{t('devices.fixed2StopFixed2VideoFixed2')}
)}
@@ -939,66 +938,66 @@ export default function DeviceOverviewPage() {
- 切换手动
- 急停
+ {t('devices.switchManual')}
+ {t('devices.s29')}
)}
-
AI分析与操作建议>} bordered={false} style={{ borderRadius: 12, marginBottom: 8 }}>
+ {t('devices.fixed2AiActions')}>} bordered={false} style={{ borderRadius: 12, marginBottom: 8 }}>
-
-
-
-
+ 🔥
{t('devices.hotspotSuspect')}
2 {t('devices.s32')}
+
{t('devices.s33')}
3 {t('devices.s34')}
+
{t('devices.s35')}
4 {t('devices.s34')}
+
{t('devices.fenceAbnormal')}
1 {t('devices.s32')}
-
建议操作
+
{t('devices.suggestAction')}
-
-
-
+
⦿ {t('devices.executeFixed2InspectionP03')}
+
⦿ {t('devices.taskSuspended2G02')}
+
⦿ {t('devices.generateCleaningOrderFixed2')}
- 生成任务
- AI优化路径
+ {t('devices.generateTask')}
+ {t('devices.aiOptimizePath')}
-
一键联动作业
+
{t('devices.s43')}
{(selectedDevice?.productName?.includes(t('constants.uav')) || selectedDevice?.device_sn) && (
-
+
-
风速
{fix2(realtimeDevice?.wind_speed)} m/s
+
{t('devices.s44')}
{fix2(realtimeDevice?.wind_speed)} m/s
{t('home.temperature')}
{fix2(realtimeDevice?.environment_temperature)}℃
-
降雨
{getVal(realtimeDevice?.rainfall)}
+
{t('devices.rainfall')}
{getVal(realtimeDevice?.rainfall)}
RTK
{realtimeDevice?.position_state?.is_fixed === 'fixing_successful' ? '固定' : '未固定'}
-
适宜执行
+
{t('devices.suitableExec')}
-
可正常作业
+
{t('devices.normal')}
)}
{(!selectedDevice?.productName?.includes(t('constants.uav')) && !selectedDevice?.device_sn) && (
- 机器人作业状态 } bordered={false} style={{ borderRadius: 12, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', border: '1px solid #f0f0f0' }}>
+
{t('devices.fixed2RobotStatusFixed2')} } bordered={false} style={{ borderRadius: 12, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', border: '1px solid #f0f0f0' }}>
累计作业里程}
+ title={{t('devices.statTotalDistance')} }
value={deviceStatistics?.distance ? Number(deviceStatistics.distance).toFixed(2) : Number(deviceStatistics?.workArea / 0.7 || 0).toFixed(2)}
suffix="m"
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
@@ -1031,7 +1030,7 @@ export default function DeviceOverviewPage() {
}}
>
累计作业面积}
+ title={{t('devices.s50')} }
value={Number(deviceStatistics?.workArea || 0).toFixed(2)}
suffix="㎡"
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
@@ -1050,7 +1049,7 @@ export default function DeviceOverviewPage() {
}}
>
累计作业时长}
+ title={{t('devices.s51')} }
value={Number(deviceStatistics?.time || 0).toFixed(2)}
suffix="min"
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
@@ -1061,7 +1060,7 @@ export default function DeviceOverviewPage() {
)}
- 任务执行时间线>} bordered={false} style={{ borderRadius: 12 }} extra={
}>
+ {t('devices.fixed2TaskSuspended2Fixed2ExecutionTime')}>} bordered={false} style={{ borderRadius: 12 }} extra={
}>
{taskTimeline.map((item, idx) => (
{item.time} }>
@@ -1070,14 +1069,14 @@ export default function DeviceOverviewPage() {
))}
- 查看更多
+ {t('devices.viewMore')}
{/* 机器人编辑别名弹窗 */}
setEditRobotModalOpen(false)}
confirmLoading={editLoading}
@@ -1087,28 +1086,26 @@ export default function DeviceOverviewPage() {
{currentEditRobot && (
- 设备SN:
+ {t('devices.fixed2Fixed2DeviceSn')}
{currentEditRobot.device_sn || currentEditRobot.serialNumber}
- 设备类型:
+ {t('devices.fixed2DeviceType')}
{currentEditRobot.productName || t('constants.locationUnknown')}
- 设备别名 *
+ {t('devices.fixed2Device')}*
setEditAliasInput(e.target.value)}
- placeholder="请输入自定义设备别名"
+ placeholder={t('devices.fixed2PleaseEnterDevice')}
maxLength={30}
allowClear
/>
-
- 别名用于设备列表、控制面板展示,便于快速区分设备
-
+
{t('devices.deviceListControlDeviceFixed2')}
)}
diff --git a/src/components/devices/DeviceParamModal.tsx b/src/components/devices/DeviceParamModal.tsx
index ef2f3f6..06cd450 100644
--- a/src/components/devices/DeviceParamModal.tsx
+++ b/src/components/devices/DeviceParamModal.tsx
@@ -119,16 +119,16 @@ const DeviceParamModal: React.FC = ({ open, device, onCan
setParamData(res.data);
paramForm.setFieldsValue({ ...res.data });
} else {
- utils.message.error('获取参数失败');
+ utils.message.error(t('devices.fetchParamFail'));
setParamData(null);
paramForm.resetFields();
}
} else {
- utils.message.error('获取参数失败');
+ utils.message.error(t('devices.fetchParamFail'));
}
} catch (err) {
- utils.message.error('获取参数失败');
+ utils.message.error(t('devices.fetchParamFail'));
} finally {
setLoading(false);
}
@@ -149,14 +149,14 @@ const DeviceParamModal: React.FC = ({ open, device, onCan
};
const res = await deviceRunParamSave(payload);
if (res.code === 200) {
- utils.message.success('保存参数成功');
+ utils.message.success(t('devices.paramSaveSuccess'));
onSuccess?.();
onCancel?.();
} else {
- utils.message.error(res.msg || '保存参数失败');
+ utils.message.error(res.msg || t('devices.paramSaveFail'));
}
} catch (err) {
- utils.message.error('操作异常');
+ utils.message.error(t('devices.paramSaveException'));
} finally {
setLoading(false);
}
@@ -168,53 +168,53 @@ const DeviceParamModal: React.FC = ({ open, device, onCan
onCancel?.();
};
const paramFieldConfigs = [
- { key: 'leftForwardGain', label: '左轮前进增益', type: 'InputNumber', editable: true, min: 0, max: 1, step: 0.01 },
- { key: 'leftBackwardGain', label: '左轮后退增益', type: 'InputNumber', editable: true, min: 0, max: 1, step: 0.01 },
- { key: 'rightForwardGain', label: '右轮前进增益', type: 'InputNumber', editable: true, min: 0, max: 1, step: 0.01 },
- { key: 'rightBackwardGain', label: '右轮后退增益', type: 'InputNumber', editable: true, min: 0, max: 1, step: 0.01 },
+ { key: 'leftForwardGain', label: t('devices.paramLeftForwardGain'), type: 'InputNumber', editable: true, min: 0, max: 1, step: 0.01 },
+ { key: 'leftBackwardGain', label: t('devices.paramLeftBackwardGain'), type: 'InputNumber', editable: true, min: 0, max: 1, step: 0.01 },
+ { key: 'rightForwardGain', label: t('devices.paramRightForwardGain'), type: 'InputNumber', editable: true, min: 0, max: 1, step: 0.01 },
+ { key: 'rightBackwardGain', label: t('devices.paramRightBackwardGain'), type: 'InputNumber', editable: true, min: 0, max: 1, step: 0.01 },
- { key: 'runSpeed', label: '运行速度', type: 'InputNumber', editable: true },
- { key: 'chipUidSign', label: '芯片UID固化标志位', type: 'InputNumber', editable: false },
- { key: 'chipUid', label: '芯片UID', type: 'Input', editable: false },
- { key: 'remoteConfig', label: '遥控器通道配置', type: 'InputNumber', editable: false },
- { key: 'knifeMotorMode', label: '割刀电机模式', type: 'InputNumber', editable: false },
- { key: 'walkMotorMode', label: '行走电机模式', type: 'InputNumber', editable: false },
- { key: 'leftMotorReverse', label: '左轮电机方向极性', type: 'InputNumber', editable: false },
- { key: 'rightMotorReverse', label: '右轮电机方向极性', type: 'InputNumber', editable: false },
- { key: 'swapChannel', label: '左右轮通道互换标志', type: 'InputNumber', editable: false },
- { key: 'use4G', label: '联网标志位', type: 'InputNumber', editable: false },
- { key: 'forwardSpeedLimit', label: '前进速度限制', type: 'InputNumber', editable: false },
- { key: 'turnSpeedLimit', label: '转向速度限制', type: 'InputNumber', editable: false },
- { key: 'knifePolarity', label: '割刀通道极性', type: 'InputNumber', editable: false },
- { key: 'fanPolarity', label: '风门通道极性', type: 'InputNumber', editable: false },
- { key: 'throttlePolarity', label: '油门通道极性', type: 'InputNumber', editable: false },
- { key: 'liftProtectTime', label: '底盘升降电机保护时间', type: 'InputNumber', editable: false },
- { key: 'dualRtk', label: 'RTK配置', type: 'InputNumber', editable: false },
- { key: 'knifeChannel', label: '割刀通道配置', type: 'InputNumber', editable: false },
- { key: 'fanChannel', label: '风门通道配置', type: 'InputNumber', editable: false },
- { key: 'throttleChannel', label: '油门通道配置', type: 'InputNumber', editable: false },
- { key: 'remoteType', label: '遥控器类型', type: 'InputNumber', editable: false },
- { key: 'relayBoard', label: '是否搭载继电器板', type: 'Checkbox', editable: false },
- { key: 'liftChannel', label: '底盘升通道配置', type: 'InputNumber', editable: false },
- { key: 'chassisChannel', label: '底盘降通道配置', type: 'InputNumber', editable: false },
- { key: 'armChannel', label: '抱闸通道配置', type: 'InputNumber', editable: false },
- { key: 'fuelPumpChannel', label: '燃油励磁通道配置', type: 'InputNumber', editable: false },
- { key: 'wifiName', label: 'wifi名称', type: 'Input', editable: false },
- { key: 'wifiPassword', label: 'wifi密码', type: 'Input', editable: false },
- { key: 'batteryType', label: '电池类型', type: 'InputNumber', editable: false },
- { key: 'driveType', label: '行走驱动配置', type: 'InputNumber', editable: false },
- { key: 'gearRatio', label: '转速比', type: 'InputNumber', editable: false, step: 0.01 },
- { key: 'robotLength', label: '机器人长度', type: 'InputNumber', editable: false, step: 0.01 },
- { key: 'robotWidth', label: '机器人宽度', type: 'InputNumber', editable: false, step: 0.01 },
- { key: 'robotHeight', label: '机器人高度', type: 'InputNumber', editable: false, step: 0.01 },
- { key: 'knifeWidth', label: '割刀宽度', type: 'InputNumber', editable: false, step: 0.01 },
- { key: 'tyreSize', label: '轮胎尺寸', type: 'InputNumber', editable: false, step: 0.01 },
- { key: 'firmwareVersion', label: '固件版本', type: 'Input', editable: false },
+ { key: 'runSpeed', label: t('devices.paramRunSpeed'), type: 'InputNumber', editable: true },
+ { key: 'chipUidSign', label: t('devices.paramChipUidSign'), type: 'InputNumber', editable: false },
+ { key: 'chipUid', label: t('devices.paramChipUid'), type: 'Input', editable: false },
+ { key: 'remoteConfig', label: t('devices.paramRemoteConfig'), type: 'InputNumber', editable: false },
+ { key: 'knifeMotorMode', label: t('devices.paramKnifeMotorMode'), type: 'InputNumber', editable: false },
+ { key: 'walkMotorMode', label: t('devices.paramWalkMotorMode'), type: 'InputNumber', editable: false },
+ { key: 'leftMotorReverse', label: t('devices.paramLeftMotorReverse'), type: 'InputNumber', editable: false },
+ { key: 'rightMotorReverse', label: t('devices.paramRightMotorReverse'), type: 'InputNumber', editable: false },
+ { key: 'swapChannel', label: t('devices.paramSwapChannel'), type: 'InputNumber', editable: false },
+ { key: 'use4G', label: t('devices.paramUse4G'), type: 'InputNumber', editable: false },
+ { key: 'forwardSpeedLimit', label: t('devices.paramForwardSpeedLimit'), type: 'InputNumber', editable: false },
+ { key: 'turnSpeedLimit', label: t('devices.paramTurnSpeedLimit'), type: 'InputNumber', editable: false },
+ { key: 'knifePolarity', label: t('devices.paramKnifePolarity'), type: 'InputNumber', editable: false },
+ { key: 'fanPolarity', label: t('devices.paramFanPolarity'), type: 'InputNumber', editable: false },
+ { key: 'throttlePolarity', label: t('devices.paramThrottlePolarity'), type: 'InputNumber', editable: false },
+ { key: 'liftProtectTime', label: t('devices.paramLiftProtectTime'), type: 'InputNumber', editable: false },
+ { key: 'dualRtk', label: t('devices.paramDualRtk'), type: 'InputNumber', editable: false },
+ { key: 'knifeChannel', label: t('devices.paramKnifeChannel'), type: 'InputNumber', editable: false },
+ { key: 'fanChannel', label: t('devices.paramFanChannel'), type: 'InputNumber', editable: false },
+ { key: 'throttleChannel', label: t('devices.paramThrottleChannel'), type: 'InputNumber', editable: false },
+ { key: 'remoteType', label: t('devices.paramRemoteType'), type: 'InputNumber', editable: false },
+ { key: 'relayBoard', label: t('devices.paramRelayBoard'), type: 'Checkbox', editable: false },
+ { key: 'liftChannel', label: t('devices.paramLiftChannel'), type: 'InputNumber', editable: false },
+ { key: 'chassisChannel', label: t('devices.paramChassisChannel'), type: 'InputNumber', editable: false },
+ { key: 'armChannel', label: t('devices.paramArmChannel'), type: 'InputNumber', editable: false },
+ { key: 'fuelPumpChannel', label: t('devices.paramFuelPumpChannel'), type: 'InputNumber', editable: false },
+ { key: 'wifiName', label: t('devices.paramWifiName'), type: 'Input', editable: false },
+ { key: 'wifiPassword', label: t('devices.paramWifiPassword'), type: 'Input', editable: false },
+ { key: 'batteryType', label: t('devices.paramBatteryType'), type: 'InputNumber', editable: false },
+ { key: 'driveType', label: t('devices.paramDriveType'), type: 'InputNumber', editable: false },
+ { key: 'gearRatio', label: t('devices.paramGearRatio'), type: 'InputNumber', editable: false, step: 0.01 },
+ { key: 'robotLength', label: t('devices.paramRobotLength'), type: 'InputNumber', editable: false, step: 0.01 },
+ { key: 'robotWidth', label: t('devices.paramRobotWidth'), type: 'InputNumber', editable: false, step: 0.01 },
+ { key: 'robotHeight', label: t('devices.paramRobotHeight'), type: 'InputNumber', editable: false, step: 0.01 },
+ { key: 'knifeWidth', label: t('devices.paramKnifeWidth'), type: 'InputNumber', editable: false, step: 0.01 },
+ { key: 'tyreSize', label: t('devices.paramTyreSize'), type: 'InputNumber', editable: false, step: 0.01 },
+ { key: 'firmwareVersion', label: t('devices.paramFirmwareVersion'), type: 'Input', editable: false },
{ key: 'crc16', label: 'CRC16', type: 'InputNumber', editable: false },
{ key: 'tail1', label: 'tail1', type: 'InputNumber', editable: false },
{ key: 'tail2', label: 'tail2', type: 'InputNumber', editable: false },
{ key: 'remark', label: t('roles.remark'), type: 'Input', editable: false },
- { key: 'delFlag', label: '删除标志', type: 'Checkbox', editable: false },
+ { key: 'delFlag', label: t('devices.paramDelFlag'), type: 'Checkbox', editable: false },
];
return (
@@ -228,7 +228,7 @@ const DeviceParamModal: React.FC = ({ open, device, onCan
background: 'linear-gradient(180deg, #52c41a 0%, #389e0d 100%)',
borderRadius: 2,
}}>
- 设备全部参数查看与增益修改
+ {t('devices.paramViewEditTitle')}
- {deviceName}
@@ -304,7 +304,7 @@ const DeviceParamModal: React.FC = ({ open, device, onCan
) : field.type === 'Checkbox' ? (
) : (
-
+
)}
diff --git a/src/components/devices/DeviceStatusPage.tsx b/src/components/devices/DeviceStatusPage.tsx
index 94f1ffd..8e09d0f 100644
--- a/src/components/devices/DeviceStatusPage.tsx
+++ b/src/components/devices/DeviceStatusPage.tsx
@@ -417,7 +417,7 @@ export default function DeviceStatusPage() {
// !isUAV ? device?.serialNumber : '',
// `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`,
//);
- const getVal = (val) => val === "no_rain" ? "无" : (val || '-');
+ const getVal = (val) => val === "no_rain" ? t('devices.rainNo') : (val || '-');
const realtimePosition = React.useMemo(() => {
// 1. 无人机:优先用 MQTT 实时数据
@@ -580,7 +580,7 @@ export default function DeviceStatusPage() {
// 让地图取最新经纬度
longitude: lng,
latitude: lat,
- name: device.deviceAlias || device.callsign || device.deviceName || '设备',
+ name: device.deviceAlias || device.callsign || device.deviceName || t('devices.device'),
type: isUAV
? 'drone'
: device.productName?.includes(t('constants.mower'))
@@ -637,7 +637,7 @@ export default function DeviceStatusPage() {
// 打点功能
const handleMarkPoint = () => {
if (!realtimePosition) {
- message.warning('无法获取实时位置,请检查设备连接');
+ message.warning(t('devices.locationFail'));
return;
}
const newPoint = {
@@ -645,7 +645,7 @@ export default function DeviceStatusPage() {
lat: Number(realtimePosition.lat),
};
setMarkedPoints([...markedPoints, newPoint]);
- messageApi.success(`已标记第 ${markedPoints.length + 1} 个点`);
+ messageApi.success(t('devices.pointMarked', { count: markedPoints.length + 1 }));
};
// 清空标记点
@@ -660,7 +660,7 @@ export default function DeviceStatusPage() {
//如果时弓子模式
if (isLoopMode) {
if (markedPoints.length < 3) {
- messageApi.warning('请至少标记 3 个点');
+ messageApi.warning(t('devices.minThreePoints'));
return;
}
@@ -716,11 +716,11 @@ export default function DeviceStatusPage() {
planModel: 0,
});
setCompleteFlag(true);
- messageApi.success('路径规划完成');
+ messageApi.success(t('devices.pathPlanDone'));
}
} catch (error) {
console.error('路径规划失败:', error);
- messageApi.error('路径规划失败,请重试');
+ messageApi.error(t('devices.pathPlanFailRetry'));
}
} else {
const positionPoints = [...markedPoints].map(item => {
@@ -745,7 +745,7 @@ export default function DeviceStatusPage() {
// 打开保存模态框
const handleOpenSaveModal = () => {
if (!completeFlag) {
- messageApi.warning('请先点击完成生成路径');
+ messageApi.warning(t('devices.completePathFirst'));
return;
}
setPlotName('');
@@ -755,7 +755,7 @@ export default function DeviceStatusPage() {
// 保存功能
const handleSave = async () => {
if (!plotName.trim()) {
- messageApi.warning('请输入地块名称');
+ messageApi.warning(t('devices.inputPlotName'));
return;
}
@@ -826,7 +826,7 @@ export default function DeviceStatusPage() {
if (!device) {
return (
);
@@ -856,31 +856,31 @@ export default function DeviceStatusPage() {
}}
>
- 路径规划:
- 已标记 {markedPoints.length} 个点
+ {t('devices.pathPlanning')}:
+ {t('devices.markedPointsCount', { count: markedPoints.length })}
- 作业方式
+ {t('devices.workMode')}
- {isLoopMode ? '弓字' : 'AB点'}
+ {isLoopMode ? t('devices.bowMode') : t('devices.abMode')}
- 打点
+ {t('devices.markPoint')}
- 清空标记
+ {t('devices.clearMarks')}
- 完成
+ {t('devices.complete')}
- 保存
+ {t('common.save')}
@@ -910,7 +910,7 @@ export default function DeviceStatusPage() {
flexWrap: 'wrap',
}}
>
- 选择设备:
+ {t('devices.selectDevice')}:
!item.gateway_sn && !item.drone_callsign && item.serialNumber).map(item => ({
value: item.device_sn || item.serialNumber,
- label: `${item.deviceAlias || item.deviceName || '未知设备'} `,
+ label: `${item.deviceAlias || item.deviceName || t('devices.unknownDevice')} `,
})),
},
{
@@ -935,7 +935,7 @@ export default function DeviceStatusPage() {
title: 'uav',
options: devicesAll.filter(item => item.gateway_sn || item.drone_callsign).map(item => ({
value: item.device_sn,
- label: `${item.drone_callsign || item.callsign || '未知无人机'}`,
+ label: `${item.drone_callsign || item.callsign || t('devices.unknownDrone')}`,
})),
},
].filter(group => group.options.length > 0)}
@@ -961,7 +961,7 @@ export default function DeviceStatusPage() {
title={
<>
- 无人机场视频
+{t('devices.stationVideo')}
>
}
bordered={false}
@@ -986,7 +986,7 @@ export default function DeviceStatusPage() {
title={
<>
- 位置态势图
+ {t('devices.situationMap')}
>
}
extra={
@@ -997,7 +997,7 @@ export default function DeviceStatusPage() {
icon={ }
onClick={() => setClearNavLine((v) => v + 1)}
>
- 清空实时轨迹
+ {t('devices.clearRealtimeTrack')}
v + 1);
}}
>
- 清空规划航线
+ {t('devices.clearPlannedRoute')}
}
@@ -1039,7 +1039,7 @@ export default function DeviceStatusPage() {
title={
<>
- 无人机视频
+{t('devices.droneVideo')}
>
}
bordered={false}
@@ -1068,7 +1068,7 @@ export default function DeviceStatusPage() {
title={
<>
- 实时视频监控
+ {t('devices.realtimeVideoMonitor')}
>
}
bordered={false}
@@ -1086,11 +1086,11 @@ export default function DeviceStatusPage() {
}
>
- setMowerView('front')}>前视
- setMowerView('back')}>后视
- setMowerView('left')}>左视
- setMowerView('right')}>右视
- setMowerView('all')}>全景
+ setMowerView('front')}>{t('devices.frontView')}
+ setMowerView('back')}>{t('devices.backView')}
+ setMowerView('left')}>{t('devices.leftView')}
+ setMowerView('right')}>{t('devices.rightView')}
+ setMowerView('all')}>{t('devices.panorama')}
{mowerView == "all" ? <>
-
机器人状态
+
{t('devices.robotStatus')}
- 电量:
+ {t('devices.rtBattery')}
{runningStatus.battery !== undefined ? `${runningStatus.battery}%` : '-'}
- 电压:
+ {t('devices.rtVoltage')}
{runningStatus.voltage !== undefined ? `${Number(runningStatus.voltage).toFixed(2)}V` : '-'}
- 左电机:
+ {t('devices.rtLeftMotor')}
{runningStatus.leftCurrent !== undefined ? `${Number(runningStatus.leftCurrent).toFixed(2)}A` : '-'}
- 右电机:
+ {t('devices.rtRightMotor')}
{runningStatus.rightCurrent !== undefined ? `${Number(runningStatus.rightCurrent).toFixed(2)}A` : '-'}
- 左速度:
+ {t('devices.rtLeftSpeed')}
{runningStatus.leftMeasureSpeed !== undefined ? `${Number(runningStatus.leftMeasureSpeed).toFixed(1)}rpm` : '-'}
- 右速度:
+ {t('devices.rtRightSpeed')}
{runningStatus.rightMeasureSpeed !== undefined ? `${Number(runningStatus.rightMeasureSpeed).toFixed(1)}rpm` : '-'}
- 左温度:
+ {t('devices.rtLeftTemp')}
{runningStatus.leftMotorTemp !== undefined ? `${Number(runningStatus.leftMotorTemp).toFixed(1)}℃` : '-'}
- 右温度:
+ {t('devices.rtRightTemp')}
{runningStatus.rightMotorTemp !== undefined ? `${Number(runningStatus.rightMotorTemp).toFixed(1)}℃` : '-'}
- 主控温度:
+ {t('devices.rtMainTemp')}
{runningStatus.chipTemp !== undefined ? `${Number(runningStatus.chipTemp).toFixed(1)}℃` : '-'}
- 航向角:
+ {t('devices.rtHeadingAngle')}
{runningStatus.yaw !== undefined ? `${Number(runningStatus.yaw).toFixed(1)}°` : '-'}
- 俯仰角:
+ {t('devices.rtPitchAngle')}
{runningStatus.pitch !== undefined ? `${Number(runningStatus.pitch).toFixed(1)}°` : '-'}
- 航向角状态:
- {runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? '初始化' : '未初始化'}` : '-'}
- 定位:
+ {t('devices.rtHeadingStatus')}
+ {runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}
+ {t('devices.rtPositioning')}
{runningStatus.qual == 0 ? t('constants.locationInvalid') :
- runningStatus.qual == 1 ? 'GPS单点' :
- runningStatus.qual == 2 ? 'DGPS差分' :
- runningStatus.qual == 4 ? 'RTK固定' :
- runningStatus.qual == 5 ? 'RTK浮点' : t('constants.locationUnknown')}
+ runningStatus.qual == 1 ? t('devices.gpsSingle') :
+ runningStatus.qual == 2 ? t('devices.dgpsDiff') :
+ runningStatus.qual == 4 ? t('devices.rtkFixed2') :
+ runningStatus.qual == 5 ? t('devices.rtkFloat') : t('constants.locationUnknown')}
- 卫星:
- {runningStatus.satelliteCnt || 0}颗
- 模式:
+ {t('devices.rtSatellites')}
+ {t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}
+ {t('devices.rtMode')}
- {runningStatus.controlMode == 1 ? '本地' :
- runningStatus.controlMode == 3 ? '远程' : t('constants.locationUnknown')}
+ {runningStatus.controlMode == 1 ? t('devices.localMode') :
+ runningStatus.controlMode == 3 ? t('devices.remoteMode') : t('constants.locationUnknown')}
@@ -1190,10 +1190,10 @@ export default function DeviceStatusPage() {
}}>
- {!isVideoPlaying ? '已停止视频' : t('video.videoLoading')}
+ {!isVideoPlaying ? t('devices.videoStopped') : t('video.videoLoading')}
- {!isVideoPlaying ? '点击右上角「播放」按钮开启视频' : ''}
+ {!isVideoPlaying ? t('devices.clickPlayHint') : ''}
)}
@@ -1214,48 +1214,48 @@ export default function DeviceStatusPage() {
boxShadow: '0 4px 16px rgba(0,0,0,0.4)',
border: '1px solid rgba(24,144,255,0.2)',
}}>
- 机器人状态
+ {t('devices.robotStatus')}
- 电量:
+ {t('devices.rtBattery')}
{runningStatus.battery !== undefined ? `${runningStatus.battery}%` : '-'}
- 电压:
+ {t('devices.rtVoltage')}
{runningStatus.voltage !== undefined ? `${Number(runningStatus.voltage).toFixed(2)}V` : '-'}
- 左电机:
+ {t('devices.rtLeftMotor')}
{runningStatus.leftCurrent !== undefined ? `${Number(runningStatus.leftCurrent).toFixed(2)}A` : '-'}
- 右电机:
+ {t('devices.rtRightMotor')}
{runningStatus.rightCurrent !== undefined ? `${Number(runningStatus.rightCurrent).toFixed(2)}A` : '-'}
- 左速度:
+ {t('devices.rtLeftSpeed')}
{runningStatus.leftMeasureSpeed !== undefined ? `${Number(runningStatus.leftMeasureSpeed).toFixed(1)}rpm` : '-'}
- 右速度:
+ {t('devices.rtRightSpeed')}
{runningStatus.rightMeasureSpeed !== undefined ? `${Number(runningStatus.rightMeasureSpeed).toFixed(1)}rpm` : '-'}
- 左温度:
+ {t('devices.rtLeftTemp')}
{runningStatus.leftMotorTemp !== undefined ? `${Number(runningStatus.leftMotorTemp).toFixed(1)}℃` : '-'}
- 右温度:
+ {t('devices.rtRightTemp')}
{runningStatus.rightMotorTemp !== undefined ? `${Number(runningStatus.rightMotorTemp).toFixed(1)}℃` : '-'}
- 主控温度:
+ {t('devices.rtMainTemp')}
{runningStatus.chipTemp !== undefined ? `${Number(runningStatus.chipTemp).toFixed(1)}℃` : '-'}
- 航向角:
+ {t('devices.rtHeadingAngle')}
{runningStatus.yaw !== undefined ? `${Number(runningStatus.yaw).toFixed(1)}°` : '-'}
- 俯仰角:
+ {t('devices.rtPitchAngle')}
{runningStatus.pitch !== undefined ? `${Number(runningStatus.pitch).toFixed(1)}°` : '-'}
- 航向角状态:
- {runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? '初始化' : '未初始化'}` : '-'}
- 定位:
+ {t('devices.rtHeadingStatus')}
+ {runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}
+ {t('devices.rtPositioning')}
{runningStatus.qual == 0 ? t('constants.locationInvalid') :
- runningStatus.qual == 1 ? 'GPS单点' :
- runningStatus.qual == 2 ? 'DGPS差分' :
- runningStatus.qual == 4 ? 'RTK固定' :
- runningStatus.qual == 5 ? 'RTK浮点' : t('constants.locationUnknown')}
+ runningStatus.qual == 1 ? t('devices.gpsSingle') :
+ runningStatus.qual == 2 ? t('devices.dgpsDiff') :
+ runningStatus.qual == 4 ? t('devices.rtkFixed2') :
+ runningStatus.qual == 5 ? t('devices.rtkFloat') : t('constants.locationUnknown')}
- 卫星:
- {runningStatus.satelliteCnt || 0}颗
- 模式:
+ {t('devices.rtSatellites')}
+ {t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}
+ {t('devices.rtMode')}
- {runningStatus.controlMode == 1 ? '本地' :
- runningStatus.controlMode == 3 ? '远程' : t('constants.locationUnknown')}
+ {runningStatus.controlMode == 1 ? t('devices.localMode') :
+ runningStatus.controlMode == 3 ? t('devices.remoteMode') : t('constants.locationUnknown')}
@@ -1272,7 +1272,7 @@ export default function DeviceStatusPage() {
title={
<>
- 位置态势图
+ {t('devices.situationMap')}
>
}
extra={
@@ -1283,7 +1283,7 @@ export default function DeviceStatusPage() {
icon={ }
onClick={() => setClearNavLine((v) => v + 1)}
>
- 清空实时轨迹
+ {t('devices.clearRealtimeTrack')}
v + 1);
}}
>
- 清空规划航线
+ {t('devices.clearPlannedRoute')}
}
@@ -1322,7 +1322,7 @@ export default function DeviceStatusPage() {
title={
<>
- 远程控制
+{t('devices.remoteControl')}
>
}
bordered={false}
@@ -1356,7 +1356,7 @@ export default function DeviceStatusPage() {
{/* 保存路径模态框 */}
setIsSaveModalVisible(false)}
okText={t('common.save')}
@@ -1364,12 +1364,12 @@ export default function DeviceStatusPage() {
confirmLoading={isSaving}
>
-
地块名称
+
{t('devices.plotNameLabel')}
setPlotName(e.target.value)}
- placeholder="请输入地块名称"
+ placeholder={t('devices.inputPlotName')}
style={{
width: '100%',
padding: '8px 12px',
@@ -1390,7 +1390,7 @@ export default function DeviceStatusPage() {
borderRadius: '50%',
animation: 'spin 0.8s linear infinite',
}} />
-
保存中...
+
{t('devices.saving')}
)}
-
- AI 智能诊断与分析中心
-
+ {t('aiAnalysis.fixed2Ai2')}
- }>刷新数据
- 导出报告
+ }>{t('aiAnalysis.fixed2Refresh')}
+ {t('aiAnalysis.fixed2Export')}
{/* 第一排:顶部统计卡片 */}
{[
- { title: 'PR值 (性能比)', value: '82.6%', trend: '较昨日 -1.3%', icon: , color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F', direction: 'down' },
- { title: '发电偏差率', value: '-4.35%', trend: '较昨日 -1.02%', icon: , color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F', direction: 'down' },
- { title: '异常组串数量', value: '8', trend: '较昨日 +2 ↑', icon: , color: '#1D2129', bg: '#F5F7FA', trendColor: '#F53F3F', direction: 'up' },
- { title: '热斑疑似数量', value: '36', trend: '较昨日 +5 ↑', icon: , color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F', direction: 'up' },
- { title: '电站健康度评分', value: '86.3', unit: '分', trend: '较昨日 -1.7', icon: , color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F', direction: 'down' },
- { title: '预测发电量', value: '4,821', unit: t('home.kWh'), trend: '较昨日 +2.6% ↑', icon: , color: '#165DFF', bg: '#E8F3FF', trendColor: '#00B42A', direction: 'up' },
+ { title: t('aiAnalysis.prValue'), value: '82.6%', trend: t('devices.vsYesterday', { value: '-1.3%' }), icon: , color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F', direction: 'down' },
+ { title: t('aiAnalysis.fixed2GenerationDeviation'), value: '-4.35%', trend: t('devices.vsYesterday', { value: '-1.02%' }), icon: , color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F', direction: 'down' },
+ { title: t('aiAnalysis.fixed2AbnormalStringFixed2QuantityFixed2'), value: '8', trend: t('devices.vsYesterday', { value: '+2 ↑' }), icon: , color: '#1D2129', bg: '#F5F7FA', trendColor: '#F53F3F', direction: 'up' },
+ { title: t('aiAnalysis.fixed2HotspotSuspectFixed2QuantityFixed2'), value: '36', trend: t('devices.vsYesterday', { value: '+5 ↑' }), icon: , color: '#F53F3F', bg: '#FFF1F0', trendColor: '#F53F3F', direction: 'up' },
+ { title: t('aiAnalysis.s25'), value: '86.3', unit: t('aiAnalysis.scoreUnit'), trend: t('devices.vsYesterday', { value: '-1.7' }), icon: , color: '#00B42A', bg: '#E8FFEA', trendColor: '#F53F3F', direction: 'down' },
+ { title: t('aiAnalysis.fixed2PredictedGeneration'), value: '4,821', unit: t('home.kWh'), trend: t('devices.vsYesterday', { value: '+2.6% ↑' }), icon: , color: '#165DFF', bg: '#E8F3FF', trendColor: '#00B42A', direction: 'up' },
].map((item, index) => (
无人机热成像巡检分析 }
- extra={巡检:2025-05-20 09:30 }
+ title={{t('aiAnalysis.fixed2UavInspection')} }
+ extra={{t('aiAnalysis.fixed2Inspection202505200930')} }
bordered={false}
bodyStyle={{ padding: '16px 20px' }}
style={{ ...cardStyle, height: '100%' }}
@@ -263,7 +261,7 @@ export default function AIDiagnosisPage() {
- {item.status === 'serious' ? '高危' : '注意'}
+ {item.status === 'serious' ? t('aiAnalysis.highDanger') : t('aiAnalysis.attention')}
@@ -273,11 +271,11 @@ export default function AIDiagnosisPage() {
-
热斑疑似点
-
高温区域
+
{t('aiAnalysis.fixed2HotspotSuspect')}
+
{t('aiAnalysis.areaFixed2')}
-
温度分布: 25℃ ~ 85℃
+
{t('aiAnalysis.fixed2Temperature2585')}
@@ -285,10 +283,10 @@ export default function AIDiagnosisPage() {
组串实时状态定位图 }
+ title={{t('aiAnalysis.status')} }
extra={ } style={{ fontSize: 12, color: '#86909C' }}>
- 总组串: 160
- 异常: 8
+ {t('aiAnalysis.s9')}160
+ {t('aiAnalysis.fixed2Abnormal')}8
}
bordered={false}
bodyStyle={{ padding: '16px 20px' }}
@@ -305,20 +303,21 @@ export default function AIDiagnosisPage() {
))}
{['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'].map((row) => (
- {row}排
+ {row}{t('aiAnalysis.rowUnit')}
{Array.from({ length: 20 }).map((_, col) => {
- let color = '#E8F3FF'; // 正常
+ let color = '#E8F3FF';
let icon = null;
- let tooltip = `组串 ${row}-${col + 1}: 正常`;
+ let statusKey = 'normal';
- // 模拟异常分布
- if (row === 'B' && col === 3) { color = '#F53F3F'; icon =
; tooltip = `组串 ${row}-${col + 1}: 严重异常 (热斑)`; }
- if (row === 'B' && col === 17) { color = '#F53F3F'; icon =
; tooltip = `组串 ${row}-${col + 1}: 严重异常 (断路)`; }
- if (row === 'C' && col === 15) { color = '#FF7D00'; icon =
; tooltip = `组串 ${row}-${col + 1}: 异常 (功率偏差)`; }
- if (row === 'E' && col === 4) { color = '#FF7D00'; icon =
; tooltip = `组串 ${row}-${col + 1}: 异常 (遮挡)`; }
- if (row === 'F' && col === 11) { color = '#F7BA1E'; icon =
; tooltip = `组串 ${row}-${col + 1}: 轻微异常`; }
- if (row === 'G' && col === 1) { color = '#F7BA1E'; icon =
; tooltip = `组串 ${row}-${col + 1}: 轻微异常`; }
- if (row === 'H' && col === 10) { color = '#86909C'; tooltip = `组串 ${row}-${col + 1}: 离线`; }
+ if (row === 'B' && col === 3) { color = '#F53F3F'; icon =
; statusKey = 'seriousHotspot'; }
+ if (row === 'B' && col === 17) { color = '#F53F3F'; icon =
; statusKey = 'seriousBreak'; }
+ if (row === 'C' && col === 15) { color = '#FF7D00'; icon =
; statusKey = 'abnormalPowerDeviation'; }
+ if (row === 'E' && col === 4) { color = '#FF7D00'; icon =
; statusKey = 'abnormalShading'; }
+ if (row === 'F' && col === 11) { color = '#F7BA1E'; icon =
; statusKey = 'minor'; }
+ if (row === 'G' && col === 1) { color = '#F7BA1E'; icon =
; statusKey = 'minor'; }
+ if (row === 'H' && col === 10) { color = '#86909C'; statusKey = 'offline'; }
+
+ const tooltip = t('aiAnalysis.stringCellTooltip', { row, col: col + 1, status: t(`aiAnalysis.stringStatus.${statusKey}`) });
return (
@@ -335,11 +334,11 @@ export default function AIDiagnosisPage() {
{[
- { color: '#E8F3FF', label: '运行正常' },
- { color: '#F7BA1E', label: '轻微异常' },
- { color: '#FF7D00', label: '功率异常' },
- { color: '#F53F3F', label: '严重故障' },
- { color: '#86909C', label: '设备离线' },
+ { color: '#E8F3FF', label: t('aiAnalysis.normalFixed2') },
+ { color: '#F7BA1E', label: t('aiAnalysis.abnormalFixed22') },
+ { color: '#FF7D00', label: t('aiAnalysis.abnormalFixed2') },
+ { color: '#F53F3F', label: t('aiAnalysis.fixed2CriticalFixed2ErrorFixed2') },
+ { color: '#86909C', label: t('aiAnalysis.fixed2DeviceFixed2OfflineFixed2') },
].map(item => (
@@ -351,14 +350,13 @@ export default function AIDiagnosisPage() {
- 异常类型分布
-
+
{t('aiAnalysis.fixed2AbnormalFixed2Type')}
{[
- { label: '严重故障', value: 2, color: '#F53F3F', percent: '25%' },
- { label: '功率异常', value: 4, color: '#FF7D00', percent: '50%' },
- { label: '轻微异常', value: 2, color: '#F7BA1E', percent: '25%' },
- { label: '离线组串', value: 0, color: '#86909C', percent: '0%' },
+ { label: t('aiAnalysis.fixed2CriticalFixed2ErrorFixed2'), value: 2, color: '#F53F3F', percent: '25%' },
+ { label: t('aiAnalysis.abnormalFixed2'), value: 4, color: '#FF7D00', percent: '50%' },
+ { label: t('aiAnalysis.abnormalFixed22'), value: 2, color: '#F7BA1E', percent: '25%' },
+ { label: t('aiAnalysis.fixed2Offline'), value: 0, color: '#86909C', percent: '0%' },
].map(item => (
@@ -372,7 +370,7 @@ export default function AIDiagnosisPage() {
))}
-
查看详细定位表
+
{t('aiAnalysis.fixed2View')}
@@ -384,14 +382,14 @@ export default function AIDiagnosisPage() {
组件衰减趋势分析 }
+ title={{t('aiAnalysis.s13')} }
bordered={false}
bodyStyle={{ padding: '16px 20px' }}
style={{ ...cardStyle, height: '100%' }}
>
- 衰减率趋势 (%)
- 当前均值: -5.32%
+ {t('aiAnalysis.degradationTrend')}
+ {t('aiAnalysis.fixed2Current532')}
- 衰减预警:
- 12块组件衰减超标, 建议排查。
+ {t('aiAnalysis.s15')}
+ {t('aiAnalysis.12')}
@@ -433,14 +431,14 @@ export default function AIDiagnosisPage() {
实时发电表现深度分析 }
+ title={{t('aiAnalysis.generation')} }
bordered={false}
bodyStyle={{ padding: '16px 20px' }}
style={{ ...cardStyle, height: '100%' }}
>
-
发电量对比分析 (kWh)
+
{t('aiAnalysis.generationComparison')}
{[
- { label: '当日实际发电', value: '4,752', unit: t('home.kWh'), color: '#165DFF' },
- { label: '当日预测发电', value: '4,960', unit: t('home.kWh'), color: '#00B42A' },
- { label: '发电偏差率', value: '-4.35%', unit: '', color: '#F53F3F' },
- { label: '实时 PR 值', value: '82.6%', unit: '', color: '#1D2129' },
+ { label: t('aiAnalysis.actualFixed2GenerationFixed2'), value: '4,752', unit: t('home.kWh'), color: '#165DFF' },
+ { label: t('aiAnalysis.predictedGenerationFixed2'), value: '4,960', unit: t('home.kWh'), color: '#00B42A' },
+ { label: t('aiAnalysis.fixed2GenerationDeviation'), value: '-4.35%', unit: '', color: '#F53F3F' },
+ { label: t('aiAnalysis.pr'), value: '82.6%', unit: '', color: '#1D2129' },
].map(item => (
{item.label}
@@ -496,23 +494,23 @@ export default function AIDiagnosisPage() {
{/* AI诊断总结 */}
- AI 诊断总结
- 更新时间: 2025-05-20 09:45
+ {t('aiAnalysis.fixed2Ai2')}
+ {t('aiAnalysis.fixed2UpdatedAt202505200945')}
-
- AI 建议与处置
-
+
{t('aiAnalysis.fixed2Ai')}
{g} , width: 68 },
+ { title: t('aiAnalysis.s40'), dataIndex: 'gain', render: g => {g} , width: 68 },
{ title: t('aiAnalysis.confidence'), dataIndex: 'confidence', width: 60 },
{
title: t('roles.actions'),
@@ -543,17 +539,17 @@ export default function AIDiagnosisPage() {
size="small"
style={{ fontSize: 11, borderRadius: 4, height: 22, padding: '0 6px' }}
>
- {record.isView ? '详情' : t('workOrder.dispatch')}
+ {record.isView ? t('common.detail') : t('workOrder.dispatch')}
)
},
]}
dataSource={[
- { key: '1', measure: '处理热斑组件', priority: '高', gain: '+2.15%', confidence: '92%', isView: false },
- { key: '2', measure: '排查异常组串', priority: '高', gain: '+1.85%', confidence: '90%', isView: false },
- { key: '3', measure: '清洗受遮挡区域', priority: '中', gain: '+0.45%', confidence: '78%', isView: false },
- { key: '4', measure: '跟踪衰减组件', priority: '中', gain: '+0.35%', confidence: '86%', isView: false },
- { key: '5', measure: '监控逆变器效率', priority: '低', gain: '+0.10%', confidence: '93%', isView: true },
+ { key: '1', measure: t('aiAnalysis.handleHotspotComponents'), priority: t('workOrder.high'), gain: '+2.15%', confidence: '92%', isView: false },
+ { key: '2', measure: t('aiAnalysis.checkAbnormalStrings'), priority: t('workOrder.high'), gain: '+1.85%', confidence: '90%', isView: false },
+ { key: '3', measure: t('aiAnalysis.cleanShadedAreas'), priority: t('workOrder.medium'), gain: '+0.45%', confidence: '78%', isView: false },
+ { key: '4', measure: t('aiAnalysis.trackDegradedComponents'), priority: t('workOrder.medium'), gain: '+0.35%', confidence: '86%', isView: false },
+ { key: '5', measure: t('aiAnalysis.monitorInverterEfficiency'), priority: t('workOrder.low'), gain: '+0.10%', confidence: '93%', isView: true },
]}
pagination={false}
size="small"
@@ -567,17 +563,17 @@ export default function AIDiagnosisPage() {
{/* 底部:数据来源 */}
全栈数据融合来源}
+ title={{t('aiAnalysis.sourceFixed2')} }
bordered={false}
bodyStyle={{ padding: '16px 20px' }}
style={cardStyle}
>
{[
- { title: '无人机载荷热成像', time: '2025-05-20 09:30', icon: , status: '同步中' },
- { title: 'SCADA 实时遥测数据', time: '2025-05-20 09:45:12', icon: , status: t('roles.normal') },
- { title: '云端气象分析站', time: '2025-05-20 09:45:00', icon: , status: t('roles.normal') },
- { title: '电站运维资产库', time: '最近更新: 2025-05-18', icon: , status: t('roles.normal') },
+ { title: t('aiAnalysis.fixed2Uav'), time: '2025-05-20 09:30', icon: , status: t('aiAnalysis.syncing') },
+ { title: t('aiAnalysis.scada'), time: '2025-05-20 09:45:12', icon: , status: t('roles.normal') },
+ { title: t('aiAnalysis.s43'), time: '2025-05-20 09:45:00', icon: , status: t('roles.normal') },
+ { title: t('aiAnalysis.oM'), time: t('aiAnalysis.lastUpdated', { value: '2025-05-18' }), icon: , status: t('roles.normal') },
].map((source, idx) => (
@@ -586,10 +582,10 @@ export default function AIDiagnosisPage() {
{source.title}
-
数据点: {source.time}
+
{t('aiAnalysis.dataPoint', { time: source.time })}
- 状态: {source.status}
+ {t('aiAnalysis.statusLabel', { status: source.status })}
diff --git a/src/pages/Agri.jsx b/src/pages/Agri.jsx
index cd7a8e7..f61a4fe 100644
--- a/src/pages/Agri.jsx
+++ b/src/pages/Agri.jsx
@@ -112,7 +112,7 @@ export default function Agri() {
}
}
} catch (err) {
- utils.message.error('获取模型列表失败');
+ utils.message.error(t('page.listFixed2FailedFixed2'));
} finally {
setLoadingModels(false);
}
@@ -185,7 +185,7 @@ export default function Agri() {
const handleSubmitDetect = async () => {
if (detectFiles.length === 0) {
- utils.message.warning('请先上传图片或视频');
+ utils.message.warning(t('page.uploadImageVideoFixed2'));
return;
}
@@ -215,7 +215,7 @@ export default function Agri() {
addToHistory('detect', res.jobId);
}
} catch (err) {
- utils.message.error('提交任务失败');
+ utils.message.error(t('aiAnalysis.submitTaskFailed'));
setDetectStatus(null);
}
};
@@ -4372,7 +4372,7 @@ export default function Agri() {
setHotLoading(false);
setSegResult(res);
- utils.message.success('热成像分析完成');
+ utils.message.success(t('aiAnalysis.thermalAnalysisComplete'));
addToHistory('segmentation', res.analysisId || 'seg-' + Date.now());
}).catch(err => { })
@@ -4389,7 +4389,7 @@ export default function Agri() {
setPolling(false);
const resultRes = await getDetectJobResult(jobId);
setDetectResult(resultRes);
- utils.message.success('任务执行成功');
+ utils.message.success(t('devices.taskExecSuccess'));
} else if (['failed', 'cancelled'].includes(statusRes.status)) {
clearInterval(pollTimer.current);
setPolling(false);
@@ -4405,7 +4405,7 @@ export default function Agri() {
const handleSubmitSeg = async () => {
if (!thermalFile) {
- utils.message.warning('请先上传热成像文件');
+ utils.message.warning(t('page.uploadThermal2'));
return;
}
@@ -4422,10 +4422,10 @@ export default function Agri() {
try {
const res = await submitSegmentationAnalyze(formData);
setSegResult(res);
- utils.message.success('热成像分析完成');
+ utils.message.success(t('aiAnalysis.thermalAnalysisComplete'));
addToHistory('segmentation', res.analysisId || 'seg-' + Date.now());
} catch (err) {
- utils.message.error('热成像分析失败');
+ utils.message.error(t('aiAnalysis.thermalAnalysisFailed'));
} finally {
setSegLoading(false);
}
@@ -4447,7 +4447,7 @@ export default function Agri() {
{[
{
- title: '算法数量',
+ title: t('aiAnalysis.algoCount'),
value: '2',
unit: '检测 + 分割',
icon: ,
@@ -4455,7 +4455,7 @@ export default function Agri() {
bg: '#E8F3FF',
},
{
- title: '在线服务',
+ title: t('aiAnalysis.onlineServices'),
value: '2',
unit: 'health 实时检查',
icon: ,
@@ -4463,7 +4463,7 @@ export default function Agri() {
bg: '#E8FFEA',
},
{
- title: '模型数量',
+ title: t('aiAnalysis.modelCount'),
value: models.length || 3,
unit: '检测模型 registry',
icon: ,
@@ -4471,7 +4471,7 @@ export default function Agri() {
bg: '#E8F3FF',
},
{
- title: '历史记录',
+ title: t('aiAnalysis.historyRecords'),
value: history.length,
unit: '本页联调记录',
icon: ,
@@ -4555,7 +4555,7 @@ export default function Agri() {
const renderDetectWorkspace = () => (
-
检测模型
+
{t('aiAnalysis.detectModel')}
- 输入类型
+ {t('aiAnalysis.inputType')}
setDetectForm(prev => ({ ...prev, inputType: e.target.value }))}
buttonStyle="solid"
size="small"
>
- 图片
+ {t('aiAnalysis.image')}
{t('constants.sourceVideo')}
- 推理预设
+ {t('aiAnalysis.inferencePreset')}
setDetectForm(prev => ({ ...prev, speedPreset: e.target.value }))}
size="small"
>
- 质量
+ {t('aiAnalysis.quality')}
{t('devices.speed')}
@@ -4681,8 +4681,8 @@ export default function Agri() {
- 拖拽文件到此处,或点击选择
- 支持 jpg/png/webp/mp4 等格式
+ {t('page.fixed2DragFile')}
+ {t('page.jpgPngWebpMp4')}
@@ -4699,9 +4699,7 @@ export default function Agri() {
icon={
}
onClick={handleGetTargetDemo}
loading={targetLoading}
- >
- 调用服务器样例
-
} onClick={fetchModels}>刷新模型
+ >{t('page.s7')}
} onClick={fetchModels}>{t('aiAnalysis.refreshModels')}
);
@@ -4748,7 +4746,7 @@ export default function Agri() {
-
热成像文件 thermal_file
+
{t('page.thermalFile')}
setThermalFile(info.fileList[0])}
@@ -4759,7 +4757,7 @@ export default function Agri() {
- 上传 TIFF / PNG / JPG 热成像文件
+ {t('page.fixed2UploadTiffPngJpg')}
@@ -4770,7 +4768,7 @@ export default function Agri() {
beforeUpload={() => false}
maxCount={1}
>
- 阵列 mask
+ {t('page.mask')}
false}
maxCount={1}
>
- 面板 GeoJSON
+ {t('page.geojson')}
@@ -4788,16 +4786,12 @@ export default function Agri() {
icon={segLoading ? : }
onClick={handleSubmitSeg}
loading={segLoading}
- >
- 提交热成像分析
-
+ >{t('aiAnalysis.submitThermalAnalysis')}
}
onClick={handleGetDemo}
loading={hotLoading}
- >
- 调用服务器样例
- }>读取服务器历史
+ >{t('page.s7')} }>{t('aiAnalysis.readServerHistory')}
);
@@ -4809,18 +4803,16 @@ export default function Agri() {
return (
结果展示}
+ title={{t('page.s15')} }
bordered={false}
style={{ marginTop: 12, borderRadius: 8 }}
bodyStyle={{ padding: '12px' }}
>
-
- 原始预览、结果图与完整 JSON 同屏查看
-
+ {t('page.jsonViewFixed2')}
{/* 输入预览 */}
-
+
{inputFile && (
detectForm.inputType === 'image' ? (
@@ -4843,7 +4835,7 @@ export default function Agri() {
{/* 结果图/视频 */}
-
+
{hasResult ? (
@@ -4861,7 +4853,7 @@ export default function Agri() {
/>
)
) : (
- 任务完成后显示结果
+ {t('page.fixed2TaskSuspended2Fixed2Complete')}
)}
@@ -4869,12 +4861,12 @@ export default function Agri() {
{/* 结果JSON */}
-
+
{hasResult ? (
{JSON.stringify(detectResult, null, 2)}
) : (
-
暂无结果
+
{t('page.noResultFixed2')}
)}
@@ -4899,19 +4891,17 @@ export default function Agri() {
return (
结果展示}
+ title={{t('page.s15')} }
bordered={false}
style={{ marginTop: 12, borderRadius: 8 }}
bodyStyle={{ padding: '12px' }}
>
-
- 原始预览、结果图与完整 JSON 同屏查看
-
+ {t('page.jsonViewFixed2')}
{/* 顶部统计卡片 */}
-
热成像交互分析视图
-
点击热点或面板查看温度、块号、GPS 与像素溯源信息
+
{t('page.s19')}
+
{t('page.viewFixed2TemperatureGpsInfoFixed2')}
热点数量}
+ title={{t('page.quantityFixed2')} }
value={segResult?.summary?.panel_hotspot_count || 0}
valueStyle={{ fontSize: 18, fontWeight: 600, color: '#FF4D4F' }}
@@ -4945,7 +4935,7 @@ export default function Agri() {
bodyStyle={{ padding: '12px 8px' }}
>
面板区域}
+ title={{t('aiAnalysis.panelArea')} }
value={segResult?.summary?.panel_polygon_count || 0}
titleStyle={{ fontSize: 12, color: '#333', marginBottom: 4 }}
valueStyle={{ fontSize: 18, fontWeight: 600, color: '#1677FF' }}
@@ -4985,7 +4975,7 @@ export default function Agri() {
bodyStyle={{ padding: '12px 8px' }}
>
分析编号}
+ title={{t('page.s23')} }
value={segResult?.analysis_id?.substring(0, 8) || '-'}
titleStyle={{ fontSize: 12, color: '#333', marginBottom: 4 }}
valueStyle={{ fontSize: 18, fontWeight: 600, color: '#722ED1' }}
@@ -5021,7 +5011,7 @@ export default function Agri() {
/>
)}
{/*{!inputFile && (
- 请上传热成像文件} image={Empty.PRESENTED_IMAGE_SIMPLE} />
+ {t('page.uploadThermal')}} image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}*/}
{/* 热点标记点 */}
@@ -5070,8 +5060,8 @@ export default function Agri() {
请选择热点或面板}
+ title={t('page.detailFixed2')}
+ extra={{t('page.fixed2PleaseSelect')} }
style={{ height: 400 }}
bodyStyle={{ height: 350 }}
>
@@ -5099,17 +5089,17 @@ export default function Agri() {
热点 {selectedPoint.hotspot_id}
- 热点
+ {t('page.s26')}
{[
{ label: t('home.temperature'), value: `${selectedPoint.peak_temp_c}℃` },
- { label: '块号', value: selectedPoint.panel_id || '-' },
+ { label: t('page.s49'), value: selectedPoint.panel_id || '-' },
{ label: 'GPS', value: selectedPoint.gps?.text || '-' },
- { label: '原图像素', value: `${selectedPoint.peak_x}, ${selectedPoint.peak_y}` },
- { label: '叠加图像素', value: `${selectedPoint.peak_x}, ${selectedPoint.peak_y}` },
- { label: '面积', value: `${selectedPoint.area_px} px` }
+ { label: t('page.s50'), value: `${selectedPoint.peak_x}, ${selectedPoint.peak_y}` },
+ { label: t('page.s51'), value: `${selectedPoint.peak_x}, ${selectedPoint.peak_y}` },
+ { label: t('page.s52'), value: `${selectedPoint.area_px} px` }
].map((item, i) => (
) : (
-
- 等待分割结果,完成后可点击热点/面板查看详情
-
+ {t('page.completeViewDetailsFixed2')}
)}
@@ -5145,7 +5133,7 @@ export default function Agri() {
paddingRight: 4,
boxSizing: 'border-box'
}}>
- 热点/面板列表
+ {t('page.listFixed2')}
{panels.map((p, i) => (
-
- 算法分析中心
-
+ {t('page.s29')}
{renderStats()}
@@ -5199,11 +5185,11 @@ export default function Agri() {
{/* 左侧:算法列表 */}
算法列表}
+ title={{t('aiAnalysis.algorithmList')} }
bordered={false}
bodyStyle={{ padding: '8px' }}
style={{ borderRadius: 8, height: '100%' }}
- extra={已接入 2 套 }
+ extra={{t('page.2')} }
>
{algorithmList.map(algo => (
历史分析记录}
+ title={{t('page.fixed2HistoryAnalysis')} }
bordered={false}
bodyStyle={{ padding: '8px' }}
style={{ borderRadius: 8, height: '100%' }}
extra={{history.length} 条 }
>
{history.length === 0 ? (
-
+
) : (
history.map(item => (
{t('router.alerts')}
- 告警处置闭环、规则管理与事件中心
+ {t('alerts.subtitle')}