装备 完善

This commit is contained in:
mmc
2026-05-11 14:59:36 +08:00
parent 2ee7d1183d
commit 89d18ea0da
10 changed files with 1117 additions and 773 deletions

View File

@@ -15,30 +15,15 @@ import {
} from '@ant-design/icons';
import { useSelector } from 'react-redux';
import { getDeviceListApi, getPlaneDeviceList } from '../../api/device.ts';
import { getDeviceListApi, getLiveStream, getPlaneDeviceList } from '../../api/device.ts';
import { RootState } from '@/src/store';
import DroneLivePlayer from '../VolcRtcPlayer.jsx';
const { Content } = Layout;
const { Text, Title } = Typography;
// 模拟数据
const topCards = [
{ title: '无人机机场状态', icon: <EnvironmentOutlined />, value: '2 / 2', desc: '在线', sub: '可调度 2 架', color: '#1890ff' },
{ title: '巡检机器人', icon: <RobotOutlined />, value: '3 台', desc: '', sub: '执行中 2', color: '#722ed1' },
{ title: '除草机器人', icon: <BranchesOutlined />, value: '2 台', desc: '', sub: '作业中 1', color: '#13c2c2' },
{ title: '清洗无人机', icon: <CloudOutlined />, value: '2 架', desc: '', sub: '待命 1', color: '#eb2f96' },
{ title: '设备平均电量', icon: <ThunderboltOutlined />, value: '86%', desc: '', sub: '', color: '#52c41a' },
{ title: '今日任务执行', icon: <CheckCircleOutlined />, value: '12 / 15', desc: '', sub: '完成率 80%', color: '#2f54eb' },
];
const scheduleList = [
{ id: 1, name: '无人机机场 A01', type: '无人机机场', status: '在线', mode: '待命', battery: 100, position: '开压站旁', task: '待命', comm: '良好' },
{ id: 2, name: '巡检机器人 RBT-01', type: '巡检机器人', status: '作业中', mode: '自主巡检', battery: 68, position: '区块 B-03', task: '巡检航线 P-02', comm: '良好' },
{ id: 3, name: '巡检机器人 RBT-02', type: '巡检机器人', status: '在线', mode: '待命', battery: 92, position: '区块 D-06', task: '待命', comm: '良好' },
{ id: 4, name: '除草机器人 GR-01', type: '除草机器人', status: '充电中', mode: '回充', battery: 35, position: '充电桩 1', task: '回充中', comm: '良好' },
{ id: 5, name: '清洗无人机 UAV-C01', type: '清洗无人机', status: '作业中', mode: '自主清洗', battery: 72, position: '清洗区 C-05', task: '清洗航线 C-05', comm: '良好' },
{ id: 6, name: '清洗无人机 UAV-C02', type: '清洗无人机', status: '待命', mode: '待命', battery: 96, position: '无人机机场 A01', task: '待命', comm: '良好' },
];
const taskTimeline = [
{ time: '10:24:18', color: 'blue', text: 'UAV-C01 开始执行清洗航线 C-05', status: '任务开始' },
@@ -60,23 +45,69 @@ const logs = [
// 设备总览组件
export default function DeviceOverviewPage({ devices, planedevices, devicesAll }) {
const [activeTab, setActiveTab] = useState('drone');
const [selectedDevice, setSelectedDevice] = useState('');
const [currentDevice, setCurrentDevice] = useState(null);
console.log(devicesAll, "devicesAll")
const [selectedDevice, setSelectedDevice] = useState(null);
const [planeVideo, setPlaneVideo] = useState('');
// 动态计算顶部卡片数据
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;
return [
{ title: '无人机机场状态', icon: <EnvironmentOutlined />, value: `${onlineDrones} / ${totalDrones}`, desc: onlineDrones > 0 ? '在线' : '离线', sub: `可调度 ${onlineDrones} 架`, color: '#1890ff' },
//{ title: '巡检机器人', icon: <RobotOutlined />, value: `${totalRobots} 台`, desc: '', sub: `执行中 ${activeRobots}`, color: '#722ed1' },
{ title: '机器人', icon: <BranchesOutlined />, value: `${totalMowers} 台`, desc: '', sub: `作业中 ${activeMowers}`, color: '#13c2c2' },
{ title: '无人机', icon: <CloudOutlined />, value: `${totalDrones} 架`, desc: '', sub: `待命 ${planedevices?.filter(d => d.productName?.includes('清洗') && d.onlineStatus === 1).length || 0}`, color: '#eb2f96' },
{ title: '设备平均电量', icon: <ThunderboltOutlined />, value: '86%', desc: '', sub: '', color: '#52c41a' },
{ title: '今日任务执行', icon: <CheckCircleOutlined />, value: '12 / 15', desc: '', sub: '完成率 80%', color: '#2f54eb' },
];
}, [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]);
const controlTabs = [
{ key: 'airport', label: '无人机机场' },
{ key: 'robot', label: '巡检机器人' },
{ key: 'mower', label: '除草机器人' },
{ key: 'clean', label: '清洗无人机' },
{ key: 'machine', label: '机械设备' },
];
const handleStart = () => message.success('任务已启动');
const handlePause = () => message.info('任务已暂停');
const handleReturn = () => message.info('返航指令已下发');
const handleRecharge = () => message.info('回充指令已下发');
const handleEmergencyStop = () => message.error('已触发急停!');
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);
}
})
}
// 数字保留两位小数
const fix2 = (val) => {
@@ -85,28 +116,28 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
};
// 安全取值
const getVal = (val) => val == "no_rain" ? "无" : '-';
const getVal = (val) => val == "no_rain" ? "无" : (val || '-');
// 默认选中第一个
useEffect(() => {
if (devicesAll && devicesAll.length > 0) {
const first = devicesAll[0];
setSelectedDevice(first.device_sn);
setCurrentDevice(first);
setSelectedDevice(devicesAll[0]); // 🔥 修复:存整个对象
}
}, [devicesAll]);
useEffect(() => {
getLiveDefault();
}, [selectedDevice])
// 切换设备
const handleDeviceChange = (sn) => {
setSelectedDevice(sn);
const target = devicesAll.find(item => item.device_sn === sn);
setCurrentDevice(target);
const handleDeviceChange = (id) => {
const target = devicesAll.find(item => (item.device_sn || item.serialNumber) === id);
setSelectedDevice(target || null); // 🔥 修复:存对象
};
return (
<Content style={{ maxWidth: 1800, margin: '0 auto', }}>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', marginBottom: 20 }}>
{topCards.map((card, idx) => (
{dynamicTopCards.map((card, idx) => (
<div key={idx} style={{ flex: 1 }}>
<Card bordered={false} style={{ borderRadius: 12, boxShadow: '0 2px 8px rgba(0,0,0,0.05)', height: '110px', display: 'flex', alignItems: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12, width: '100%' }}>
@@ -143,19 +174,19 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
</Card>
<Card title={<><SettingOutlined /> 装备调度列表</>} bordered={false} style={{ borderRadius: 12, marginBottom: 16 }}>
<Table rowKey="id" size="small" pagination={false}
<Table rowKey={(record) => record.id || record.serialNumber || record.device_sn} size="small" pagination={false}
columns={[
{ title: '装备名称', dataIndex: 'name', width: 160 },
{ title: '类型', dataIndex: 'type', width: 100 },
{ title: '当前状态', dataIndex: 'status', width: 80, render: s => <Tag color={s === '作业中' ? 'processing' : s === '在线' ? 'success' : 'default'}>{s}</Tag> },
{ title: '当前状态', dataIndex: 'status', width: 80, render: s => <Tag color={s === '作业中' || s === '在线' ? 'success' : 'default'}>{s}</Tag> },
{ title: '模式', dataIndex: 'mode', width: 80 },
{ title: '电量', dataIndex: 'battery', width: 80, render: v => <Progress percent={v} size="small" status={v < 40 ? 'exception' : 'active'} /> },
{ title: '位置', dataIndex: 'position', width: 100 },
{ title: '当前任务', dataIndex: 'task', width: 120 },
{ title: '通讯状态', dataIndex: 'comm', width: 80, render: v => <Badge status="success" text={v} /> },
{ title: '通讯状态', dataIndex: 'comm', width: 80, render: v => <Badge status={v.includes('-') ? 'warning' : 'success'} text={v} /> },
{ title: '操作', key: 'action', width: 100, render: () => <Space><Button size="small" type="text" icon={<EditOutlined />} /><Button size="small" type="text" icon={<SettingOutlined />} /></Space> }
]}
dataSource={scheduleList}
dataSource={dynamicScheduleList}
scroll={{ x: 'max-content' }}
/>
</Card>
@@ -177,91 +208,78 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
<Col xs={24} lg={10}>
<Card title={<> 设备控制面板</>} bordered={false} style={{ borderRadius: 12, marginBottom: 16 }} bodyStyle={{ padding: 16, paddingBottom: 0 }}>
<Select
style={{ width: 180, marginBottom: 10 }}
style={{ width: 220, marginBottom: 10 }}
placeholder="请选择设备"
value={selectedDevice}
value={selectedDevice?.device_sn || selectedDevice?.serialNumber}
onChange={handleDeviceChange}
showSearch // 👈 开启搜索
allowClear // 允许删除/清空
optionFilterProp="label" // 👈 按设备名称搜索
filterOption={(input, option) =>
option.label.toLowerCase().includes(input.toLowerCase())
}
options={devicesAll.map(item => ({
value: item.device_sn,
label: item.callsign || '未知设备'
value: item.device_sn || item.serialNumber,
label: item.deviceAlias || item.drone_callsign || item.callsign || item.deviceName || '未知设备'
}))}
/>
{currentDevice && (
{selectedDevice && (
<Row gutter={16}>
<Col span={12}>
<div style={{ marginBottom: 24 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 16 }}>
<span style={{ fontSize: 24, color: '#1890ff' }}><RocketOutlined /></span>
<span style={{ fontSize: 16, fontWeight: 600 }}>{currentDevice.drone_callsign || currentDevice.callsign}</span>
<Tag color={currentDevice.onlineStatus === 1 ? "success" : "default"} size="small">
{currentDevice.onlineStatus == 1 ? "在线" : "离线"}
<span style={{ fontSize: 16, fontWeight: 600 }}>{selectedDevice.deviceAlias || selectedDevice.drone_callsign || selectedDevice.callsign || selectedDevice.deviceName}</span>
<Tag color={selectedDevice.onlineStatus === 1 ? "success" : "default"} size="small">
{selectedDevice.onlineStatus == 1 ? "在线" : "离线"}
</Tag>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 6 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
<span style={{ color: '#52c41a' }}><ThunderboltOutlined /></span>
<span style={{ fontSize: 12 }}>电量 {fix2(currentDevice.capacity_percent)}%</span>
<span style={{ fontSize: 12 }}>电量 {fix2(selectedDevice.capacity_percent || 100)}%</span>
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
<span style={{ fontSize: 12 }}>温度</span>
<span style={{ color: '#faad14' }}>{fix2(currentDevice.environment_temperature)}℃</span>
<span style={{ color: '#faad14' }}>{fix2(selectedDevice.environment_temperature || 25)}℃</span>
</div>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, marginBottom: 12, maxHeight: "100px", overflow: "auto", scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>机场编号</span>
<span style={{ fontSize: 12 }}>{getVal(currentDevice.gateway_sn)}</span>
<span style={{ color: '#666', fontSize: 12 }}>产品类型</span>
<span style={{ fontSize: 12 }}>{getVal(selectedDevice.productName)}</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>设备SN</span>
<span style={{ fontSize: 12 }}>{getVal(currentDevice.device_sn)}</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>高度</span>
<span style={{ fontSize: 12 }}>{fix2(currentDevice.height)} m</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>风速</span>
<span style={{ fontSize: 12 }}>{fix2(currentDevice.wind_speed)} m/s</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>离家距离</span>
<span style={{ fontSize: 12 }}>{fix2(currentDevice.home_distance)} m</span>
</div>
{/* 经纬度 */}
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>经纬度</span>
<span style={{ fontSize: 12 }}>{(fix2(currentDevice.longitude), fix2(currentDevice.latitude))}</span>
</div>
{/* 无人机状态 */}
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>信号</span>
<span style={{ fontSize: 12 }}>
{currentDevice.network_state?.quality === 'good' ? '好' : currentDevice.network_state?.quality === 'better' ? '较好' : currentDevice.network_state?.quality === 'moderate' ? '一般' : currentDevice.network_state?.quality === 'poor' ? '较差' : currentDevice.network_state?.quality === 'too_pool' ? '差' : '无信号'}
</span>
</div>
{/* RTK 信息 */}
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#1890ff', fontSize: 12 }}>RTK 状态</span>
<span style={{ fontSize: 12 }}>
{currentDevice.position_state?.is_fixed === 'fixing_successful' ? '固定' : '未固定'}
</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>GPS卫星</span>
<span style={{ fontSize: 12 }}>{getVal(currentDevice.position_state?.gps_number)}</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>RTK卫星</span>
<span style={{ fontSize: 12 }}>{getVal(currentDevice.position_state?.rtk_number)}</span>
<span style={{ fontSize: 12 }}>{getVal(selectedDevice.device_sn || selectedDevice.serialNumber)}</span>
</div>
{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>
)}
{selectedDevice.device_sn && (
<>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>高度</span>
<span style={{ fontSize: 12 }}>{fix2(selectedDevice.height)} m</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: '#666', fontSize: 12 }}>风速</span>
<span style={{ fontSize: 12 }}>{fix2(selectedDevice.wind_speed)} m/s</span>
</div>
</>
)}
</div>
@@ -280,10 +298,12 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
<span style={{ fontSize: 14, fontWeight: 500, color: "#666" }}>实时画面</span>
<span style={{ fontSize: 13, color: '#999' }}>实时监控</span>
</div>
<div style={{ width: '100%', height: 160, background: '#000 url(https://picsum.photos/seed/droneview/800/400) center/cover', borderRadius: 8, position: 'relative', overflow: 'hidden' }}>
<div style={{ width: '100%', height: 160, borderRadius: 8, position: 'relative', overflow: 'hidden', background: '#000' }}>
<DroneLivePlayer streamData={planeVideo?.[0] || null} />
<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: 14 }}>
<span>高度 {fix2(currentDevice.height)}m</span>
<span>风速 {fix2(currentDevice.wind_speed)}m/s</span>
<span>高度 {fix2(selectedDevice.height)}m</span>
<span>风速 {fix2(selectedDevice.wind_speed)}m/s</span>
</div>
</div>
</div>
@@ -309,15 +329,15 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
<div style={{ marginBottom: 12 }}>
<div style={{ fontSize: 16, fontWeight: 600, color: '#1890ff', marginBottom: 12 }}>建议操作</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 2, padding: '16px', borderRadius: 12, border: '1px solid #e8e8e8' }}>
<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><svg t="1778317171240" className="icon" viewBox="0 0 1024 1024" width="20" height="20"><path d="M384.32 797.512a30.088 30.088 0 0 1-21.288-51.392L597.144 512 363.032 277.816a30.088 30.088 0 0 1 0-42.568 30.088 30.088 0 0 1 42.568 0l255.392 255.464a30.088 30.088 0 0 1 0 42.568L405.6 788.696a30.04 30.04 0 0 1-21.28 8.816z" fill="#666666"></path></svg></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><svg t="1778317171240" className="icon" viewBox="0 0 1024 1024" width="20" height="20"><path d="M384.32 797.512a30.088 30.088 0 0 1-21.288-51.392L597.144 512 363.032 277.816a30.088 30.088 0 0 1 0-42.568 30.088 30.088 0 0 1 42.568 0l255.392 255.464a30.088 30.088 0 0 1 0 42.568L405.6 788.696a30.04 30.04 0 0 1-21.28 8.816z" fill="#666666"></path></svg></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><svg t="1778317171240" className="icon" viewBox="0 0 1024 1024" width="20" height="20"><path d="M384.32 797.512a30.088 30.088 0 0 1-21.288-51.392L597.144 512 363.032 277.816a30.088 30.088 0 0 1 0-42.568 30.088 30.088 0 0 1 42.568 0l255.392 255.464a30.088 30.088 0 0 1 0 42.568L405.6 788.696a30.04 30.04 0 0 1-21.28 8.816z" fill="#666666"></path></svg></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 }}>优先执行巡检航线 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>
</div>
</div>
</Col>
<Col span={10}>
<div style={{ display: 'flex', flexDirection: 'column', paddingBottom: "12px", gap: 16, height: '100%', justifyContent: "end" }}>
<div style={{ display: 'flex', gap: 12 }}>
<div style={{ display: 'flex', gap: 12, flexWrap: "wrap" }}>
<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>
@@ -330,10 +350,10 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll }
<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(currentDevice?.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(currentDevice?.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(currentDevice?.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 }}>{currentDevice?.position_state?.is_fixed === 'fixing_successful' ? '固定' : '未固定'}</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?.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>
<div style={{ width: 110, padding: '12px 8px', borderRadius: 8, background: '#f6ffed', border: '1px solid #b7eb8f', textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 4 }}>
<div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a' }}>适宜执行</div>