中英文切换

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

@@ -1,4 +1,5 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
Row,
Col,
@@ -35,6 +36,7 @@ function cn(...classes: string[]) {
}
export default function VideoControl() {
const { t } = useTranslation();
const [selectedDevice, setSelectedDevice] = useState(DEVICES[0]);
const onlineDevices = DEVICES.filter(d => d.status === 'online' || d.status === 'alert');
@@ -43,20 +45,20 @@ export default function VideoControl() {
case '安防型':
return {
count: 4,
labels: ['Front/主前', 'Back/后视', 'Left/左侧', 'Right/右侧'],
labels: [t('video.labelMainFront'), t('video.labelRear'), t('video.labelLeft'), t('video.labelRight')],
gridClass: 'grid-cols-2 grid-rows-2'
};
case '运输型':
return {
count: 5,
labels: ['Front/前驱', 'Back/后置', 'Left/左翼', 'Right/右翼', 'Cargo/货舱'],
labels: [t('video.labelFrontDrive'), t('video.labelRearMount'), t('video.labelLeftWing'), t('video.labelRightWing'), t('video.labelCargo')],
gridClass: 'grid-cols-4 grid-rows-2'
};
case '巡检型':
default:
return {
count: 3,
labels: ['Main/主探', 'Pan/全景', 'Detail/细节'],
labels: [t('video.labelMainProbe'), t('video.labelPanorama'), t('video.labelDetail')],
gridClass: 'grid-cols-2 grid-rows-2'
};
}
@@ -72,7 +74,7 @@ export default function VideoControl() {
<div className="flex items-center justify-between bg-white p-3 rounded shadow-sm border border-gray-100">
<Space size="large">
<div className="flex flex-col">
<Text type="secondary" style={{ fontSize: 10, textTransform: 'uppercase', letterSpacing: 1 }}>当前执勤设备</Text>
<Text type="secondary" style={{ fontSize: 10, textTransform: 'uppercase', letterSpacing: 1 }}>{t('video.currentDutyDevice')}</Text>
<Select
value={selectedDevice.id}
onChange={(id) => setSelectedDevice(onlineDevices.find(d => d.id === id)!)}
@@ -84,15 +86,15 @@ export default function VideoControl() {
</div>
<Divider type="vertical" style={{ height: 32 }} />
<div className="flex flex-col">
<Text type="secondary" style={{ fontSize: 10, textTransform: 'uppercase', letterSpacing: 1 }}>视频流路数</Text>
<Text type="secondary" style={{ fontSize: 10, textTransform: 'uppercase', letterSpacing: 1 }}>{t('video.videoStreamChannels')}</Text>
<Tag color="processing" style={{ marginTop: 2, fontWeight: 'bold', fontFamily: 'monospace' }}>
{config.count} CHANNELS ACTIVE
</Tag>
</div>
</Space>
<Space>
<Button size="small" icon={<ReloadOutlined />}>刷新信号</Button>
<Button size="small" type="primary" ghost>全屏墙</Button>
<Button size="small" icon={<ReloadOutlined />}>{t('video.refreshSignal')}</Button>
<Button size="small" type="primary" ghost>{t('video.fullScreenWall')}</Button>
</Space>
</div>
@@ -131,7 +133,7 @@ export default function VideoControl() {
<Card size="small" styles={{ body: { padding: 12 } }}>
<Row gutter={16} align="middle">
<Col flex="0 0 160px" style={{ borderRight: '1px solid #f0f0f0', paddingRight: 24 }}>
<Text strong type="secondary" style={{ fontSize: 10, textTransform: 'uppercase', display: 'block', textAlign: 'center', marginBottom: 8 }}>PTZ 舵机控制</Text>
<Text strong type="secondary" style={{ fontSize: 10, textTransform: 'uppercase', display: 'block', textAlign: 'center', marginBottom: 8 }}>{t('video.ptzServoControl')}</Text>
<div className="flex flex-col items-center gap-1">
<Button type="text" size="small" icon={<CaretUpOutlined />} />
<Space>
@@ -145,13 +147,13 @@ export default function VideoControl() {
<Col flex="auto">
<div className="flex items-center justify-between mb-4">
<Text strong type="secondary" style={{ fontSize: 10, textTransform: 'uppercase' }}>系统集成作业指令 ({selectedDevice.type})</Text>
<Text strong type="secondary" style={{ fontSize: 10, textTransform: 'uppercase' }}>{t('video.systemIntegratedCommand', { type: selectedDevice.type })}</Text>
<Tag color="success" variant={false} style={{ fontSize: 10, fontWeight: 'bold' }}>SIGNAL: 100% EXCELLENT</Tag>
</div>
<Space className="w-full" size="middle">
<Button icon={<CustomerServiceOutlined />} style={{ borderRadius: 2 }} block>双轴双向对讲</Button>
<Button danger icon={<AlertOutlined />} style={{ borderRadius: 2 }} block>触发远程驱逐</Button>
<Button type="primary" icon={<EyeOutlined />} style={{ borderRadius: 2 }} block>AI 视觉追踪锁定</Button>
<Button icon={<CustomerServiceOutlined />} style={{ borderRadius: 2 }} block>{t('video.twoWayIntercom')}</Button>
<Button danger icon={<AlertOutlined />} style={{ borderRadius: 2 }} block>{t('video.triggerRemoteRepellent')}</Button>
<Button type="primary" icon={<EyeOutlined />} style={{ borderRadius: 2 }} block>{t('video.aiVisualTracking')}</Button>
</Space>
</Col>
</Row>
@@ -161,7 +163,7 @@ export default function VideoControl() {
{/* Sidebar Channels */}
<Col flex="0 0 260px" className="h-full">
<Card
title={<Space><MonitorOutlined /><Text strong style={{ fontSize: 13 }}>活跃视频流 ({onlineDevices.length})</Text></Space>}
title={<Space><MonitorOutlined /><Text strong style={{ fontSize: 13 }}>{t('video.activeVideoStreams', { count: onlineDevices.length })}</Text></Space>}
extra={<Button type="text" size="small" icon={<ReloadOutlined />} />}
styles={{ body: { padding: 0 } }}
className="h-full flex flex-col overflow-hidden"
@@ -204,4 +206,4 @@ export default function VideoControl() {
</Col>
</Row>
);
}
}