2026-05-11 10:47:51 +08:00
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
|
|
import {
|
|
|
|
|
Layout, Card, Row, Col, Statistic, Tag, Button, Table,
|
|
|
|
|
Typography, Space, Progress, Badge, Timeline, message,
|
2026-05-11 16:34:44 +08:00
|
|
|
Select, Modal
|
2026-05-11 10:47:51 +08:00
|
|
|
} from 'antd';
|
|
|
|
|
import {
|
|
|
|
|
EnvironmentOutlined, RobotOutlined, BranchesOutlined,
|
|
|
|
|
ThunderboltOutlined, CheckCircleOutlined, PauseOutlined,
|
|
|
|
|
RocketOutlined, SyncOutlined, WarningOutlined,
|
|
|
|
|
CloudOutlined, ClockCircleOutlined, ReloadOutlined,
|
|
|
|
|
AimOutlined, ApiOutlined, SettingOutlined,
|
|
|
|
|
PlusOutlined, ArrowRightOutlined,
|
2026-05-18 17:25:41 +08:00
|
|
|
EditOutlined, FullscreenOutlined, InfoCircleOutlined,
|
|
|
|
|
CarOutlined
|
2026-05-11 10:47:51 +08:00
|
|
|
} from '@ant-design/icons';
|
|
|
|
|
|
|
|
|
|
import { useSelector } from 'react-redux';
|
2026-05-11 14:59:36 +08:00
|
|
|
import { getDeviceListApi, getLiveStream, getPlaneDeviceList } from '../../api/device.ts';
|
2026-05-11 10:47:51 +08:00
|
|
|
import { RootState } from '@/src/store';
|
2026-05-11 14:59:36 +08:00
|
|
|
import DroneLivePlayer from '../VolcRtcPlayer.jsx';
|
2026-05-12 11:11:30 +08:00
|
|
|
import AgoraTextTest from '../AgoraRtc.tsx';
|
2026-05-22 13:50:50 +08:00
|
|
|
import { useWebRTCPlayer } from '../useWebRTCStream.tsx';
|
|
|
|
|
import VideoPlayer from '../VideoPlayer.tsx.tsx';
|
2026-05-22 14:14:30 +08:00
|
|
|
import CesiumMap from '../Map.jsx';
|
2026-05-11 10:47:51 +08:00
|
|
|
|
|
|
|
|
const { Content } = Layout;
|
|
|
|
|
const { Text, Title } = Typography;
|
|
|
|
|
|
|
|
|
|
|
2026-05-11 14:59:36 +08:00
|
|
|
|
2026-05-11 10:47:51 +08:00
|
|
|
|
|
|
|
|
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: '任务完成' },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const logs = [
|
|
|
|
|
{ time: '10:24:35', device: 'UAV-C01', type: '命令', desc: '起飞指令下发,开始作业' },
|
|
|
|
|
{ time: '10:21:40', device: 'RBT-01', type: '命令', desc: '开始巡检任务 P-02' },
|
|
|
|
|
{ time: '10:20:11', device: 'UAV-C02', type: '命令', desc: '转入待命状态' },
|
|
|
|
|
{ time: '10:18:05', device: 'GR-02', type: '命令', desc: '除草作业开始 G-01' },
|
|
|
|
|
{ time: '10:12:35', device: 'UAV-C01', type: '告警', desc: '返航补水' },
|
|
|
|
|
{ time: '10:05:22', device: 'RBT-01', type: '事件', desc: '电量较低,建议回充', level: '低电量' },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// 设备总览组件
|
2026-05-12 08:34:13 +08:00
|
|
|
export default function DeviceOverviewPage({ devices, planedevices, devicesAll, onViewStatus, selectedSn, onDeviceSelect }) {
|
2026-05-11 16:34:44 +08:00
|
|
|
const [planeVideo, setPlaneVideo] = useState([]); // 初始为空数组
|
|
|
|
|
const [zoomedVideo, setZoomedVideo] = useState(null); // 放大查看的视频数据
|
2026-05-11 14:59:36 +08:00
|
|
|
|
2026-05-12 08:34:13 +08:00
|
|
|
// 衍生状态:从 SN 获取设备对象
|
|
|
|
|
const selectedDevice = React.useMemo(() => {
|
|
|
|
|
const sn = selectedSn || (devicesAll?.[0]?.device_sn || devicesAll?.[0]?.serialNumber);
|
|
|
|
|
return devicesAll?.find(item => (item.device_sn || item.serialNumber) === sn) || null;
|
|
|
|
|
}, [devicesAll, selectedSn]);
|
|
|
|
|
|
2026-05-11 14:59:36 +08:00
|
|
|
// 动态计算顶部卡片数据
|
|
|
|
|
const dynamicTopCards = React.useMemo(() => {
|
|
|
|
|
const totalDrones = planedevices?.length || 0;
|
|
|
|
|
const onlineDrones = planedevices?.filter(d => d.onlineStatus === 1).length || 0;
|
|
|
|
|
|
|
|
|
|
const totalRobots = devicesAll?.filter(d => d.productName?.includes('巡检')).length || 0;
|
|
|
|
|
const activeRobots = devicesAll?.filter(d => d.productName?.includes('巡检') && d.onlineStatus === 1).length || 0;
|
|
|
|
|
|
|
|
|
|
const totalMowers = devicesAll?.filter(d => d.productName?.includes('割草机')).length || 0;
|
|
|
|
|
const activeMowers = devicesAll?.filter(d => d.productName?.includes('割草机') && d.onlineStatus === 1).length || 0;
|
|
|
|
|
|
2026-05-14 09:37:15 +08:00
|
|
|
const washDroneStandby = planedevices?.filter(d => d.productName?.includes('清洗') && d.onlineStatus === 1).length || 0;
|
|
|
|
|
|
2026-05-11 14:59:36 +08:00
|
|
|
return [
|
2026-05-14 09:37:15 +08:00
|
|
|
{
|
|
|
|
|
title: '无人机机场状态',
|
|
|
|
|
icon: <EnvironmentOutlined />,
|
|
|
|
|
value: `${onlineDrones} / ${totalDrones}`,
|
|
|
|
|
sub: `可调度 ${onlineDrones} 架`,
|
|
|
|
|
color: '#1890ff'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '机器人',
|
|
|
|
|
icon: <BranchesOutlined />,
|
|
|
|
|
value: `${totalMowers} 台`,
|
|
|
|
|
sub: `作业中 ${activeMowers}`,
|
|
|
|
|
color: '#13c2c2'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '无人机',
|
|
|
|
|
icon: <CloudOutlined />,
|
|
|
|
|
value: `${totalDrones} 架`,
|
|
|
|
|
sub: `待命 ${washDroneStandby}`,
|
|
|
|
|
color: '#eb2f96'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '设备平均电量',
|
|
|
|
|
icon: <ThunderboltOutlined />,
|
|
|
|
|
value: '86%',
|
|
|
|
|
sub: '',
|
|
|
|
|
color: '#52c41a'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '今日任务执行',
|
|
|
|
|
icon: <CheckCircleOutlined />,
|
|
|
|
|
value: '12 / 15',
|
|
|
|
|
sub: '完成率 80%',
|
|
|
|
|
color: '#2f54eb'
|
|
|
|
|
},
|
2026-05-11 14:59:36 +08:00
|
|
|
];
|
|
|
|
|
}, [devicesAll, planedevices]);
|
|
|
|
|
|
|
|
|
|
// 动态生成调度列表
|
|
|
|
|
const dynamicScheduleList = React.useMemo(() => {
|
|
|
|
|
return devicesAll.map((d, index) => ({
|
|
|
|
|
id: d.deviceId || index,
|
|
|
|
|
name: d.deviceAlias || d.deviceName || d.callsign || '未知设备',
|
|
|
|
|
type: d.productName || '未知类型',
|
|
|
|
|
status: d.onlineStatus === 1 ? '在线' : '离线',
|
|
|
|
|
mode: d.status === 4 ? '待命' : '作业中',
|
|
|
|
|
battery: d.capacity_percent || 100,
|
|
|
|
|
position: d.position || '站内',
|
|
|
|
|
task: d.status === 4 ? '待命' : '作业中',
|
|
|
|
|
comm: d.rssi ? `${d.rssi}dBm` : '良好'
|
|
|
|
|
}));
|
|
|
|
|
}, [devicesAll]);
|
|
|
|
|
|
2026-05-22 13:50:50 +08:00
|
|
|
const [mowerView, setMowerView] = useState('front');
|
|
|
|
|
const isUAV = !!selectedDevice?.device_sn;
|
|
|
|
|
|
|
|
|
|
// 机器人 WebRTC 视频(和你第二个页面逻辑一致)
|
|
|
|
|
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
|
|
|
|
selectedDevice?.serialNumber || '',
|
|
|
|
|
`webrtc://1.95.137.212/live/livestream/${selectedDevice?.serialNumber}`,
|
|
|
|
|
);
|
|
|
|
|
|
2026-05-11 10:47:51 +08:00
|
|
|
|
|
|
|
|
const handleStart = () => message.success('任务已启动');
|
|
|
|
|
const handlePause = () => message.info('任务已暂停');
|
|
|
|
|
const handleReturn = () => message.info('返航指令已下发');
|
|
|
|
|
const handleRecharge = () => message.info('回充指令已下发');
|
|
|
|
|
const handleEmergencyStop = () => message.error('已触发急停!');
|
2026-05-11 14:59:36 +08:00
|
|
|
const getLiveDefault = () => {
|
|
|
|
|
if (!selectedDevice?.gateway_sn) return;
|
|
|
|
|
const data = {
|
|
|
|
|
getway_sn: selectedDevice?.gateway_sn,
|
|
|
|
|
drone_sn: selectedDevice?.device_sn,
|
|
|
|
|
getway_camera_list: selectedDevice?.gateway_camera_list ?? [],
|
|
|
|
|
drone_camera_list: selectedDevice?.drone_camera_list ?? [],
|
|
|
|
|
video_expire: 7200,
|
|
|
|
|
quality_type: "adaptive",
|
|
|
|
|
}
|
|
|
|
|
getLiveStream(data).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
setPlaneVideo(res.data);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-11 11:59:17 +08:00
|
|
|
|
|
|
|
|
// 数字保留两位小数
|
|
|
|
|
const fix2 = (val) => {
|
|
|
|
|
if (val === null || val === undefined || isNaN(val)) return '-';
|
|
|
|
|
return Number(val).toFixed(2);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 安全取值
|
2026-05-11 14:59:36 +08:00
|
|
|
const getVal = (val) => val == "no_rain" ? "无" : (val || '-');
|
2026-05-11 11:59:17 +08:00
|
|
|
|
|
|
|
|
// 默认选中第一个
|
2026-05-11 14:59:36 +08:00
|
|
|
useEffect(() => {
|
|
|
|
|
getLiveDefault();
|
|
|
|
|
}, [selectedDevice])
|
2026-05-11 11:59:17 +08:00
|
|
|
|
|
|
|
|
// 切换设备
|
2026-05-11 14:59:36 +08:00
|
|
|
const handleDeviceChange = (id) => {
|
2026-05-12 08:34:13 +08:00
|
|
|
if (onDeviceSelect) {
|
|
|
|
|
onDeviceSelect(id);
|
|
|
|
|
}
|
2026-05-11 11:59:17 +08:00
|
|
|
};
|
2026-05-11 10:47:51 +08:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Content style={{ maxWidth: 1800, margin: '0 auto', }}>
|
2026-05-12 12:54:19 +08:00
|
|
|
{/*<AgoraTextTest />*/}
|
2026-05-14 17:23:12 +08:00
|
|
|
<Row gutter={[8, 8]} style={{ marginBottom: 12, flexWrap: 'wrap' }}>
|
2026-05-11 14:59:36 +08:00
|
|
|
{dynamicTopCards.map((card, idx) => (
|
2026-05-14 17:23:12 +08:00
|
|
|
<Col key={idx} style={{ minWidth: '160px', flex: '1 0 auto' }}>
|
2026-05-14 09:37:15 +08:00
|
|
|
<Card
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{
|
2026-05-14 17:23:12 +08:00
|
|
|
borderRadius: 8,
|
2026-05-14 09:37:15 +08:00
|
|
|
boxShadow: '0 2px 8px rgba(0,0,0,0.05)',
|
2026-05-14 17:23:12 +08:00
|
|
|
height: 90,
|
2026-05-14 09:37:15 +08:00
|
|
|
}}
|
2026-05-14 17:23:12 +08:00
|
|
|
bodyStyle={{ padding: '12px', height: '100%' }}
|
2026-05-14 09:37:15 +08:00
|
|
|
>
|
2026-05-14 17:23:12 +08:00
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 10, height: '100%' }}>
|
2026-05-14 09:37:15 +08:00
|
|
|
{/* 左侧图标 */}
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
2026-05-14 17:23:12 +08:00
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
borderRadius: 8,
|
2026-05-14 09:37:15 +08:00
|
|
|
background: `${card.color}15`,
|
|
|
|
|
color: card.color,
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
2026-05-14 17:23:12 +08:00
|
|
|
fontSize: 'clamp(14px, 1.2vw, 18px)',
|
2026-05-14 09:37:15 +08:00
|
|
|
flexShrink: 0,
|
|
|
|
|
}}
|
|
|
|
|
>
|
2026-05-11 10:47:51 +08:00
|
|
|
{card.icon}
|
|
|
|
|
</div>
|
2026-05-14 09:37:15 +08:00
|
|
|
|
|
|
|
|
{/* 右侧文字 */}
|
|
|
|
|
<div style={{ flex: 1, minWidth: 0 }}>
|
2026-05-14 10:03:51 +08:00
|
|
|
<div style={{ fontSize: 'clamp(11px, 0.9vw, 13px)', color: '#666' }}>{card.title}</div>
|
|
|
|
|
<div style={{ fontSize: 'clamp(18px, 1.6vw, 24px)', fontWeight: 700, color: '#222', lineHeight: '30px' }}>
|
2026-05-14 09:37:15 +08:00
|
|
|
{card.value}
|
|
|
|
|
</div>
|
|
|
|
|
{card.sub && (
|
2026-05-14 10:03:51 +08:00
|
|
|
<div style={{ fontSize: 'clamp(10px, 0.8vw, 12px)', color: '#999', marginTop: 2 }}>
|
2026-05-14 09:37:15 +08:00
|
|
|
{card.sub}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-05-11 10:47:51 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
2026-05-14 09:37:15 +08:00
|
|
|
</Col>
|
2026-05-11 10:47:51 +08:00
|
|
|
))}
|
2026-05-14 09:37:15 +08:00
|
|
|
</Row>
|
2026-05-11 10:47:51 +08:00
|
|
|
|
2026-05-14 17:23:12 +08:00
|
|
|
<Row gutter={[8, 8]}>
|
2026-05-11 10:47:51 +08:00
|
|
|
<Col xs={24} lg={14}>
|
2026-05-14 17:23:12 +08:00
|
|
|
<Card title={<><EnvironmentOutlined /> 装备协同态势图</>} extra={<Button type="text" icon={<SettingOutlined />} />} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }} bodyStyle={{ padding: 0 }}>
|
2026-05-22 14:14:30 +08:00
|
|
|
<div style={{ width: '100%', height: 350, borderRadius: 8, position: 'relative', overflow: 'hidden' }}>
|
|
|
|
|
<div style={{ position: 'absolute', zIndex: 9999, top: 12, left: 12, background: 'rgba(255,255,255,0.95)', borderRadius: 6, padding: 8 }}>
|
2026-05-14 17:23:12 +08:00
|
|
|
<div style={{ fontSize: 11, fontWeight: 60, marginBottom: 4 }}>图例说明</div>
|
|
|
|
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 4, fontSize: 10 }}>
|
2026-05-11 10:47:51 +08:00
|
|
|
<div><span style={{ color: '#1890ff' }}>———</span> 巡检航线</div>
|
|
|
|
|
<div><span style={{ color: '#fa8c16' }}>———</span> 机器人路径</div>
|
|
|
|
|
<div><span style={{ color: '#52c41a' }}>———</span> 清洗路径</div>
|
2026-05-22 14:36:31 +08:00
|
|
|
<div>🚗 设备位置</div>
|
2026-05-11 10:47:51 +08:00
|
|
|
<div><span style={{ color: '#1890ff' }}>●</span> 补给/充电点</div>
|
|
|
|
|
<div><span style={{ color: '#ff4d4f' }}>■</span> 障碍/禁入区</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-05-22 14:36:31 +08:00
|
|
|
<CesiumMap devices={devicesAll} />
|
2026-05-11 10:47:51 +08:00
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
|
2026-05-14 17:23:12 +08:00
|
|
|
<Card title={<><SettingOutlined /> 装备调度列表</>} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }}>
|
2026-05-11 14:59:36 +08:00
|
|
|
<Table rowKey={(record) => record.id || record.serialNumber || record.device_sn} size="small" pagination={false}
|
2026-05-11 10:47:51 +08:00
|
|
|
columns={[
|
2026-05-14 17:23:12 +08:00
|
|
|
{ title: '装备名称', dataIndex: 'name', width: 140 },
|
|
|
|
|
{ title: '类型', dataIndex: 'type', width: 90 },
|
|
|
|
|
{ title: '当前状态', dataIndex: 'status', width: 70, render: s => <Tag color={s === '作业中' || s === '在线' ? 'success' : 'default'} style={{ margin: 0 }}>{s}</Tag> },
|
|
|
|
|
{ title: '模式', dataIndex: 'mode', width: 70 },
|
|
|
|
|
{ title: '电量', dataIndex: 'battery', width: 70, render: v => <Progress percent={v} size="small" status={v < 40 ? 'exception' : 'active'} /> },
|
|
|
|
|
{ title: '位置', dataIndex: 'position', width: 90 },
|
|
|
|
|
{ title: '当前任务', dataIndex: 'task', width: 100 },
|
|
|
|
|
{ title: '通讯状态', dataIndex: 'comm', width: 70, render: v => <Badge status={v.includes('-') ? 'warning' : 'success'} text={v} /> },
|
|
|
|
|
{ title: '操作', key: 'action', width: 80, render: () => <Space size={4}><Button size="small" type="text" icon={<EditOutlined />} /><Button size="small" type="text" icon={<SettingOutlined />} /></Space> }
|
2026-05-11 10:47:51 +08:00
|
|
|
]}
|
2026-05-11 14:59:36 +08:00
|
|
|
dataSource={dynamicScheduleList}
|
2026-05-14 17:23:12 +08:00
|
|
|
scroll={{ x: 'max-content', y: 280 }}
|
2026-05-11 10:47:51 +08:00
|
|
|
/>
|
|
|
|
|
</Card>
|
2026-05-11 11:59:17 +08:00
|
|
|
|
2026-05-14 17:23:12 +08:00
|
|
|
<Card title={<><SettingOutlined /> <span >控制日志 / 告警记录</span></>} bordered={false} style={{ borderRadius: 8 }} extra={<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><Button size="small" style={{ borderRadius: 4, border: '1px solid #d9d9d9' }}>全部级别 ▼</Button></div>}>
|
2026-05-11 10:47:51 +08:00
|
|
|
<Table rowKey="time" size="small" pagination={false} dataSource={logs} scroll={{ x: 'max-content' }}
|
|
|
|
|
columns={[
|
2026-05-14 17:23:12 +08:00
|
|
|
{ title: '时间', dataIndex: 'time', width: 90, render: t => <span style={{ fontSize: 13 }}>{t}</span> },
|
|
|
|
|
{ title: '设备', dataIndex: 'device', width: 100, render: t => <span style={{ fontSize: 13 }}>{t}</span> },
|
|
|
|
|
{ title: '类型', dataIndex: 'type', width: 70, render: t => { let c = '#52c41a'; if (t === '告警') c = '#fa8c16'; if (t === 'events') c = '#1890ff'; return <div style={{ display: 'flex', alignItems: 'center', gap: 4 }}><span style={{ width: 10, height: 10, borderRadius: 2, background: c }} /><span style={{ fontSize: 13 }}>{t}</span></div> } },
|
|
|
|
|
{ title: '描述', dataIndex: 'desc', render: t => <span style={{ fontSize: 13 }}>{t}</span> },
|
|
|
|
|
{ title: '', width: 70, render: (_, r) => r.level ? <Tag color="red" style={{ fontSize: 11, margin: 0 }}>{r.level}</Tag> : null }
|
2026-05-11 10:47:51 +08:00
|
|
|
]}
|
|
|
|
|
/>
|
2026-05-14 17:23:12 +08:00
|
|
|
<div style={{ textAlign: 'center', marginTop: 8 }}><Button type="link" size="small" style={{ fontSize: 13, color: '#1890ff' }}>查看更多日志</Button></div>
|
2026-05-11 10:47:51 +08:00
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
<Col xs={24} lg={10}>
|
2026-05-11 16:34:44 +08:00
|
|
|
<Card
|
|
|
|
|
title={<><SettingOutlined style={{ marginRight: 6, }} /> 设备控制面板</>}
|
|
|
|
|
bordered={false}
|
2026-05-14 17:23:12 +08:00
|
|
|
style={{ borderRadius: 8, marginBottom: 8 }}
|
|
|
|
|
bodyStyle={{ padding: 12, paddingBottom: 0 }}
|
2026-05-18 17:25:41 +08:00
|
|
|
>
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: "80%", marginBottom: 8 }}
|
2026-05-11 11:59:17 +08:00
|
|
|
placeholder="请选择设备"
|
2026-05-11 14:59:36 +08:00
|
|
|
value={selectedDevice?.device_sn || selectedDevice?.serialNumber}
|
2026-05-11 11:59:17 +08:00
|
|
|
onChange={handleDeviceChange}
|
2026-05-14 17:23:12 +08:00
|
|
|
size="small"
|
2026-05-11 14:59:36 +08:00
|
|
|
showSearch // 👈 开启搜索
|
|
|
|
|
allowClear // 允许删除/清空
|
|
|
|
|
optionFilterProp="label" // 👈 按设备名称搜索
|
|
|
|
|
filterOption={(input, option) =>
|
|
|
|
|
option.label.toLowerCase().includes(input.toLowerCase())
|
|
|
|
|
}
|
2026-05-18 17:25:41 +08:00
|
|
|
options={[
|
|
|
|
|
{
|
|
|
|
|
label: <span>机器人</span>,
|
|
|
|
|
title: 'manager',
|
|
|
|
|
options: devices.map(item => ({
|
|
|
|
|
value: item.device_sn || item.serialNumber,
|
|
|
|
|
label: item.deviceAlias || item.deviceName || '未知设备'
|
|
|
|
|
})),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: <span>无人机</span>,
|
|
|
|
|
title: 'engineer',
|
|
|
|
|
options: planedevices.map(item => ({
|
|
|
|
|
value: item.device_sn,
|
|
|
|
|
label: item.drone_callsign || item.callsign || '未知设备'
|
|
|
|
|
})),
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
//options={devicesAll.map(item => ({
|
|
|
|
|
// value: item.device_sn || item.serialNumber,
|
|
|
|
|
// label: item.deviceAlias || item.drone_callsign || item.callsign || item.deviceName || '未知设备'
|
|
|
|
|
//}))}
|
2026-05-11 10:47:51 +08:00
|
|
|
/>
|
2026-05-11 11:59:17 +08:00
|
|
|
|
2026-05-11 14:59:36 +08:00
|
|
|
{selectedDevice && (
|
2026-05-14 17:23:12 +08:00
|
|
|
<Row gutter={8}>
|
2026-05-11 11:59:17 +08:00
|
|
|
<Col span={12}>
|
2026-05-14 17:23:12 +08:00
|
|
|
<div style={{ marginBottom: 12 }}>
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 6, marginBottom: 12, flexWrap: "wrap" }}>
|
2026-05-18 17:25:41 +08:00
|
|
|
{selectedDevice.deviceType === 'drone' ||
|
|
|
|
|
selectedDevice.deviceName?.includes('无人机') ||
|
|
|
|
|
selectedDevice.drone_callsign ? (
|
|
|
|
|
<span style={{ fontSize: 20, color: '#1890ff' }}><RocketOutlined /></span>
|
|
|
|
|
) : (
|
|
|
|
|
<span style={{ fontSize: 20, color: '#1890ff' }}><CarOutlined /></span>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-05-14 17:23:12 +08:00
|
|
|
<span style={{ fontSize: 14, fontWeight: 600 }}>{selectedDevice.deviceAlias || selectedDevice.drone_callsign || selectedDevice.callsign || selectedDevice.deviceName}</span>
|
|
|
|
|
<Tag color={selectedDevice.onlineStatus === 1 ? "success" : "default"} size="small" style={{ margin: 0 }}>
|
2026-05-11 14:59:36 +08:00
|
|
|
{selectedDevice.onlineStatus == 1 ? "在线" : "离线"}
|
2026-05-11 11:59:17 +08:00
|
|
|
</Tag>
|
2026-05-11 16:34:44 +08:00
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
2026-05-18 17:25:41 +08:00
|
|
|
ghost
|
|
|
|
|
|
2026-05-11 16:34:44 +08:00
|
|
|
icon={<InfoCircleOutlined />}
|
2026-05-14 17:23:12 +08:00
|
|
|
style={{ borderRadius: 4, fontSize: 11, marginLeft: 'auto' }}
|
2026-05-11 16:34:44 +08:00
|
|
|
onClick={() => onViewStatus && onViewStatus(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
|
|
|
|
>
|
|
|
|
|
详情
|
|
|
|
|
</Button>
|
2026-05-11 10:47:51 +08:00
|
|
|
</div>
|
2026-05-11 11:59:17 +08:00
|
|
|
|
2026-05-14 17:23:12 +08:00
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 4 }}>
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
2026-05-11 11:59:17 +08:00
|
|
|
<span style={{ color: '#52c41a' }}><ThunderboltOutlined /></span>
|
2026-05-11 14:59:36 +08:00
|
|
|
<span style={{ fontSize: 12 }}>电量 {fix2(selectedDevice.capacity_percent || 100)}%</span>
|
2026-05-11 11:59:17 +08:00
|
|
|
</div>
|
2026-05-11 15:48:14 +08:00
|
|
|
{selectedDevice.environment_temperature && (
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
|
|
|
|
<span style={{ fontSize: 12 }}>温度</span>
|
|
|
|
|
<span style={{ color: '#faad14' }}>{fix2(selectedDevice.environment_temperature || 25)}℃</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-05-11 11:59:17 +08:00
|
|
|
</div>
|
|
|
|
|
|
2026-05-11 15:15:19 +08:00
|
|
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, marginBottom: 12, maxHeight: "160px", overflow: "auto", scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }}>
|
2026-05-22 14:14:30 +08:00
|
|
|
{selectedDevice.productName && (
|
|
|
|
|
<>
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
|
|
|
<span style={{ color: '#666', fontSize: 12 }}>产品类型</span>
|
|
|
|
|
<span style={{ fontSize: 12 }}>{getVal(selectedDevice.productName)}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-05-11 15:15:19 +08:00
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 8 }}>
|
|
|
|
|
<span style={{ color: '#666', fontSize: 12, whiteSpace: 'nowrap' }}>设备SN</span>
|
|
|
|
|
<span
|
|
|
|
|
style={{
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
wordBreak: 'break-all', // 强制换行
|
|
|
|
|
whiteSpace: 'normal', // 允许换行
|
|
|
|
|
textAlign: 'right', // 右对齐
|
|
|
|
|
maxWidth: '70%', // 限制宽度,避免撑满
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{getVal(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
|
|
|
|
</span>
|
2026-05-11 11:59:17 +08:00
|
|
|
</div>
|
2026-05-11 14:59:36 +08:00
|
|
|
{selectedDevice.activeTime && (
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
|
|
|
<span style={{ color: '#666', fontSize: 12 }}>激活时间</span>
|
|
|
|
|
<span style={{ fontSize: 12 }}>{selectedDevice.activeTime}</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
{selectedDevice.firmwareVersion && (
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
|
|
|
<span style={{ color: '#666', fontSize: 12 }}>固件版本</span>
|
|
|
|
|
<span style={{ fontSize: 12 }}>v{selectedDevice.firmwareVersion}</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-05-11 15:15:19 +08:00
|
|
|
{/* 无人机特定信息 */}
|
|
|
|
|
{(selectedDevice.productName?.includes('无人机') || selectedDevice.device_sn) && (
|
2026-05-11 14:59:36 +08:00
|
|
|
<>
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
2026-05-11 15:15:19 +08:00
|
|
|
<span style={{ color: '#666', fontSize: 12 }}>飞行高度</span>
|
2026-05-11 14:59:36 +08:00
|
|
|
<span style={{ fontSize: 12 }}>{fix2(selectedDevice.height)} m</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
2026-05-11 15:15:19 +08:00
|
|
|
<span style={{ color: '#666', fontSize: 12 }}>飞行风速</span>
|
2026-05-11 14:59:36 +08:00
|
|
|
<span style={{ fontSize: 12 }}>{fix2(selectedDevice.wind_speed)} m/s</span>
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
2026-05-11 11:59:17 +08:00
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: "space-between", flexWrap: 'wrap', gap: 6 }}>
|
2026-05-18 17:25:41 +08:00
|
|
|
<Button type="primary" size="small" style={{ borderRadius: 8, flex: 1 }} onClick={handleStart}>启动</Button>
|
|
|
|
|
<Button style={{ borderRadius: 8, flex: 1 }} size="small" onClick={handlePause}>暂停</Button>
|
|
|
|
|
<Button type="primary" style={{ borderRadius: 8, flex: 1 }} size="small" onClick={handleReturn}>返航</Button>
|
|
|
|
|
<Button style={{ flex: 1, background: '#52c41a', borderColor: '#52c41a', color: "#fff", borderRadius: 8, }} size="small" onClick={handleRecharge}>回充</Button>
|
2026-05-11 10:47:51 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-05-11 11:59:17 +08:00
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
<Col span={12}>
|
2026-05-22 13:50:50 +08:00
|
|
|
{/* 实时画面 */}
|
2026-05-18 17:25:41 +08:00
|
|
|
<div style={{ marginBottom: 8 }}>
|
2026-05-11 11:59:17 +08:00
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>
|
|
|
|
|
<span style={{ fontSize: 14, fontWeight: 500, color: "#666" }}>实时画面</span>
|
2026-05-22 13:50:50 +08:00
|
|
|
{/* 角度选择下拉框 */}
|
|
|
|
|
{!isUAV && (
|
|
|
|
|
<Select
|
|
|
|
|
size="small"
|
|
|
|
|
style={{ width: 110 }}
|
|
|
|
|
value={mowerView}
|
|
|
|
|
onChange={setMowerView}
|
|
|
|
|
options={[
|
|
|
|
|
{ label: '前视', value: 'front' },
|
|
|
|
|
{ label: '后视', value: 'back' },
|
|
|
|
|
{ label: '左视', value: 'left' },
|
|
|
|
|
{ label: '右视', value: 'right' },
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
2026-05-11 11:59:17 +08:00
|
|
|
</div>
|
2026-05-22 13:50:50 +08:00
|
|
|
|
2026-05-11 14:59:36 +08:00
|
|
|
<div style={{ width: '100%', height: 160, borderRadius: 8, position: 'relative', overflow: 'hidden', background: '#000' }}>
|
2026-05-22 13:50:50 +08:00
|
|
|
{/* 无人机视频 */}
|
|
|
|
|
{isUAV ? (
|
|
|
|
|
planeVideo?.length > 0 ? (
|
|
|
|
|
<DroneLivePlayer streamData={planeVideo[0]} />
|
|
|
|
|
) : (
|
|
|
|
|
<div style={{ color: '#ccc', display: 'flex', height: '100%', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
|
|
暂无视频流
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
) : (
|
|
|
|
|
// 机器人单画面 + 角度切换
|
|
|
|
|
robotVideo ? (
|
|
|
|
|
<VideoPlayer
|
|
|
|
|
deviceId={selectedDevice?.device_sn || selectedDevice?.serialNumber}
|
|
|
|
|
idx={
|
|
|
|
|
mowerView === 'front' ? 1
|
|
|
|
|
: mowerView === 'back' ? 2
|
|
|
|
|
: mowerView === 'left' ? 3
|
|
|
|
|
: 4
|
|
|
|
|
}
|
|
|
|
|
className="w-full h-full object-contain"
|
|
|
|
|
video={robotVideo}
|
|
|
|
|
error={error}
|
|
|
|
|
ready={ready}
|
2026-05-18 17:25:41 +08:00
|
|
|
/>
|
2026-05-22 13:50:50 +08:00
|
|
|
) : (
|
|
|
|
|
<div style={{ color: '#ccc', display: 'flex', height: '100%', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
|
|
视频加载中...
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
)}
|
2026-05-18 17:25:41 +08:00
|
|
|
|
2026-05-22 13:50:50 +08:00
|
|
|
{/* 视频底部信息条 */}
|
|
|
|
|
{selectedDevice?.device_sn && (
|
|
|
|
|
<div style={{ position: 'absolute', bottom: 0, left: 0, right: 0, background: 'rgba(0,0,0,0.6)', color: '#fff', display: 'flex', justifyContent: 'space-between', padding: '8px 12px', fontSize: 12 }}>
|
2026-05-11 15:15:19 +08:00
|
|
|
<span>高度 {fix2(selectedDevice.height)}m</span>
|
|
|
|
|
<span>风速 {fix2(selectedDevice.wind_speed)}m/s</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-05-11 10:47:51 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-05-11 11:59:17 +08:00
|
|
|
|
|
|
|
|
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
|
|
|
|
|
<Button size="large" style={{ flex: 1, borderRadius: 8 }}>切换手动</Button>
|
|
|
|
|
<Button danger size="large" style={{ flex: 1, borderRadius: 8 }} onClick={handleEmergencyStop}>急停</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
)}
|
2026-05-11 10:47:51 +08:00
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
<Card title={<><ApiOutlined /> AI分析与操作建议</>} bordered={false} style={{ borderRadius: 12, marginBottom: 16 }}>
|
|
|
|
|
<Row gutter={16} style={{ marginBottom: 20 }}>
|
|
|
|
|
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(255,77,79,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#ff4d4f', fontSize: 20 }}><span role="img" aria-label="hotspot">🔥</span></div><div><div style={{ fontSize: 11, color: '#666' }}>热斑疑似</div><div style={{ fontSize: 22, fontWeight: 700, color: '#222' }}>2 <span style={{ fontSize: 12 }}>处</span></div></div></div></Col>
|
|
|
|
|
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(82,196,26,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#52c41a', fontSize: 16 }}><BranchesOutlined /></div><div><div style={{ fontSize: 11, color: '#666' }}>杂草高发区</div><div style={{ fontSize: 22, fontWeight: 700, color: '#222' }}>3 <span style={{ fontSize: 12 }}>块</span></div></div></div></Col>
|
|
|
|
|
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(24,144,255,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#1890ff', fontSize: 16 }}><CloudOutlined /></div><div><div style={{ fontSize: 11, color: '#666' }}>组件风险区</div><div style={{ fontSize: 22, fontWeight: 700, color: '#222' }}>4 <span style={{ fontSize: 12 }}>块</span></div></div></div></Col>
|
|
|
|
|
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(255,77,79,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#ff4d4f', fontSize: 16 }}><WarningOutlined /></div><div><div style={{ fontSize: 11, color: '#666' }}>围栏异常</div><div style={{ fontSize: 22, fontWeight: 700, color: '#ff4d4f' }}>1 <span style={{ fontSize: 12 }}>处</span></div></div></div></Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={16}>
|
|
|
|
|
<Col span={14}>
|
|
|
|
|
<div style={{ marginBottom: 12 }}>
|
|
|
|
|
<div style={{ fontSize: 16, fontWeight: 600, color: '#1890ff', marginBottom: 12 }}>建议操作</div>
|
2026-05-18 17:25:41 +08:00
|
|
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 2, padding: '4px', borderRadius: 12, border: '1px solid #e8e8e8' }}>
|
2026-05-11 14:59:36 +08:00
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}><div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ color: '#1890ff' }}>⦿</span><span style={{ fontSize: 16 }}>优先执行巡检航线 P-03</span></div><ArrowRightOutlined style={{ color: '#666' }} /></div>
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}><div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ color: '#1890ff' }}>⦿</span><span style={{ fontSize: 16 }}>先行安排除草任务 G-02</span></div><ArrowRightOutlined style={{ color: '#666' }} /></div>
|
|
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}><div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><span style={{ color: '#1890ff' }}>⦿</span><span style={{ fontSize: 16 }}>建议生成清洗工单</span></div><ArrowRightOutlined style={{ color: '#666' }} /></div>
|
2026-05-11 10:47:51 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={10}>
|
|
|
|
|
<div style={{ display: 'flex', flexDirection: 'column', paddingBottom: "12px", gap: 16, height: '100%', justifyContent: "end" }}>
|
2026-05-11 14:59:36 +08:00
|
|
|
<div style={{ display: 'flex', gap: 12, flexWrap: "wrap" }}>
|
2026-05-11 10:47:51 +08:00
|
|
|
<Button type="primary" size="large" style={{ flex: 1, borderRadius: 8, fontSize: 16 }}>生成任务</Button>
|
|
|
|
|
<Button size="large" style={{ flex: 1, borderRadius: 8, fontSize: 16, border: '1px solid #1890ff', color: '#1890ff' }}>AI优化路径</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<Button type="primary" size="large" style={{ borderRadius: 8, fontSize: 16 }}>一键联动作业</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Card>
|
|
|
|
|
|
2026-05-11 15:15:19 +08:00
|
|
|
{/* 条件渲染:只有无人机显示环境与飞行条件 */}
|
|
|
|
|
{(selectedDevice?.productName?.includes('无人机') || selectedDevice?.device_sn) && (
|
|
|
|
|
<Card title="环境与飞行条件" bordered={false} style={{ borderRadius: 12, marginBottom: 16 }}>
|
|
|
|
|
<div style={{ display: "flex", justifyContent: "space-between", gap: 12, alignItems: "center" }}>
|
|
|
|
|
<div style={{ display: "flex", border: "1px solid #e8e8e8", borderRadius: 12, overflow: "hidden", flex: 1 }}>
|
|
|
|
|
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>风速</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{fix2(selectedDevice?.wind_speed)} m/s</div></div>
|
|
|
|
|
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>温度</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{fix2(selectedDevice?.environment_temperature)}℃</div></div>
|
|
|
|
|
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>降雨</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{getVal(selectedDevice?.rainfall)}</div></div>
|
|
|
|
|
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>RTK</div><div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a', marginTop: 2 }}>{selectedDevice?.position_state?.is_fixed === 'fixing_successful' ? '固定' : '未固定'}</div></div>
|
|
|
|
|
</div>
|
2026-05-18 17:25:41 +08:00
|
|
|
<div style={{ width: 110, padding: '12px 4px', borderRadius: 8, background: '#f6ffed', border: '1px solid #b7eb8f', textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 4 }}>
|
|
|
|
|
<div className="flex items-center gap-1">
|
|
|
|
|
<div style={{ fontSize: 12, fontWeight: 700, color: '#52c41a' }}>适宜执行</div>
|
|
|
|
|
<div style={{ width: 18, height: 18, borderRadius: '50%', background: '#52c41a', display: 'flex', alignItems: 'center', justifyContent: 'center' }}><CheckCircleOutlined style={{ fontSize: 12, color: '#fff' }} /></div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-11 15:15:19 +08:00
|
|
|
<div style={{ fontSize: 11, color: '#666' }}>可正常作业</div>
|
|
|
|
|
</div>
|
2026-05-11 10:47:51 +08:00
|
|
|
</div>
|
2026-05-11 15:15:19 +08:00
|
|
|
</Card>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* 条件渲染:机器人显示其余信息(此处以任务详情为例) */}
|
|
|
|
|
{(!selectedDevice?.productName?.includes('无人机') && !selectedDevice?.device_sn) && (
|
2026-05-14 15:15:50 +08:00
|
|
|
<Card
|
|
|
|
|
title={
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14, fontWeight: 600 }}>
|
|
|
|
|
<RobotOutlined style={{ color: '#165DFF' }} />
|
|
|
|
|
机器人作业状态
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
bordered={false}
|
|
|
|
|
style={{
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
marginBottom: 16,
|
|
|
|
|
boxShadow: '0 2px 8px rgba(0,0,0,0.06)',
|
|
|
|
|
border: '1px solid #f0f0f0',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Row gutter={16} style={{ alignItems: 'center' }}>
|
2026-05-11 15:15:19 +08:00
|
|
|
<Col span={8}>
|
2026-05-14 15:15:50 +08:00
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
padding: '8px 12px',
|
|
|
|
|
borderRadius: 8,
|
|
|
|
|
background: '#f8fafc',
|
|
|
|
|
textAlign: 'center',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Statistic
|
|
|
|
|
title={<span style={{ fontSize: 12, color: '#86909C' }}>累计里程</span>}
|
|
|
|
|
value={128.5}
|
|
|
|
|
suffix="km"
|
|
|
|
|
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#1D2129' }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-05-11 15:15:19 +08:00
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
2026-05-14 15:15:50 +08:00
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
padding: '8px 12px',
|
|
|
|
|
borderRadius: 8,
|
|
|
|
|
background: '#f8fafc',
|
|
|
|
|
textAlign: 'center',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Statistic
|
|
|
|
|
title={<span style={{ fontSize: 12, color: '#86909C' }}>本次作业耗时</span>}
|
|
|
|
|
value={45}
|
|
|
|
|
suffix="min"
|
|
|
|
|
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#1D2129' }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-05-11 15:15:19 +08:00
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
2026-05-14 15:15:50 +08:00
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
padding: '8px 12px',
|
|
|
|
|
borderRadius: 8,
|
|
|
|
|
background: '#f8fafc',
|
|
|
|
|
textAlign: 'center',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Statistic
|
|
|
|
|
title={<span style={{ fontSize: 12, color: '#86909C' }}>预计剩余时间</span>}
|
|
|
|
|
value={12}
|
|
|
|
|
suffix="min"
|
|
|
|
|
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#1D2129' }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-05-11 15:15:19 +08:00
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Card>
|
|
|
|
|
)}
|
2026-05-11 11:59:17 +08:00
|
|
|
|
2026-05-11 10:47:51 +08:00
|
|
|
<Card title={<><ClockCircleOutlined /> 任务执行时间线</>} bordered={false} style={{ borderRadius: 12 }} extra={<div style={{ fontSize: 12, color: '#666' }}>今天 2025-05-24</div>}>
|
|
|
|
|
<Timeline mode="left">
|
|
|
|
|
{taskTimeline.map((item, idx) => (
|
|
|
|
|
<Timeline.Item key={idx} color={item.color} label={<div style={{ fontSize: 11, color: '#999' }}>{item.time}</div>}>
|
|
|
|
|
<div style={{ fontSize: 13 }}>{item.text}</div>
|
|
|
|
|
<div style={{ fontSize: 11, color: '#999' }}>{item.status}</div>
|
|
|
|
|
</Timeline.Item>
|
|
|
|
|
))}
|
|
|
|
|
</Timeline>
|
|
|
|
|
<div style={{ textAlign: 'center', marginTop: 12 }}><Button type="link">查看更多</Button></div>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
2026-05-11 16:34:44 +08:00
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
|
title="视频预览"
|
|
|
|
|
open={!!zoomedVideo}
|
|
|
|
|
onCancel={() => setZoomedVideo(null)}
|
|
|
|
|
footer={null}
|
|
|
|
|
width={1000}
|
|
|
|
|
centered
|
|
|
|
|
bodyStyle={{ padding: 0, height: 600, background: '#000' }}
|
|
|
|
|
destroyOnClose
|
|
|
|
|
>
|
|
|
|
|
{zoomedVideo && <DroneLivePlayer streamData={zoomedVideo} videoMode="LARGE" />}
|
|
|
|
|
</Modal>
|
2026-05-11 10:47:51 +08:00
|
|
|
</Content>
|
|
|
|
|
);
|
|
|
|
|
}
|