From 78ee2d5c094c134fec196ded32cc30e4902c5696 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Tue, 12 May 2026 14:13:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E6=B0=94=20=E5=8A=A8=E5=9B=BE=20?= =?UTF-8?q?=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Weather/WeatherCloudy.css | 23 + src/components/Weather/WeatherCloudy.jsx | 11 + src/components/Weather/WeatherRainy.css | 23 + src/components/Weather/WeatherRainy.jsx | 14 + src/components/Weather/WeatherSunny.css | 58 + src/components/Weather/WeatherSunny.jsx | 25 + src/components/Weather/index.jsx | 23 + src/components/devices/DeviceControl.tsx | 2335 ++++++++++++++++++++++ src/lib/utils.ts | 35 + src/pages/Home.tsx | 59 +- 10 files changed, 2588 insertions(+), 18 deletions(-) create mode 100644 src/components/Weather/WeatherCloudy.css create mode 100644 src/components/Weather/WeatherCloudy.jsx create mode 100644 src/components/Weather/WeatherRainy.css create mode 100644 src/components/Weather/WeatherRainy.jsx create mode 100644 src/components/Weather/WeatherSunny.css create mode 100644 src/components/Weather/WeatherSunny.jsx create mode 100644 src/components/Weather/index.jsx create mode 100644 src/components/devices/DeviceControl.tsx diff --git a/src/components/Weather/WeatherCloudy.css b/src/components/Weather/WeatherCloudy.css new file mode 100644 index 0000000..8731c4f --- /dev/null +++ b/src/components/Weather/WeatherCloudy.css @@ -0,0 +1,23 @@ +.cloud-group { + height: 80px; +} + +.cloud { + font-size: 45px; + position: absolute; +} + +.cloud1 { + left: 10px; + animation: floatCloud 3s ease-in-out infinite; +} + +.cloud2 { + left: 60px; + animation: floatCloud 4s ease-in-out infinite; +} + +@keyframes floatCloud { + 0%, 100% { transform: translateX(0); } + 50% { transform: translateX(10px); } +} diff --git a/src/components/Weather/WeatherCloudy.jsx b/src/components/Weather/WeatherCloudy.jsx new file mode 100644 index 0000000..91f8658 --- /dev/null +++ b/src/components/Weather/WeatherCloudy.jsx @@ -0,0 +1,11 @@ +import "./WeatherCloudy.css"; + +export default function WeatherCloudy() { + return ( +
任务态势
+{selectedDevice.taskStatus}
+
+
当前位置
++ {selectedDevice?.position?.lon + ? Number(selectedDevice.position.lon).toFixed(2) + : '--'}, + {selectedDevice?.position?.lat + ? Number(selectedDevice.position.lat).toFixed(2) + : '--'} +
当前模式
+{selectedDevice?.type === 'plane' ? '无人机待命' : selectedDevice?.type === 'mower' ? '割草待命' : '待命'}
+电量/航向
+{selectedDevice?.battery}% / 92°
+速度
+{selectedDevice?.speed} m/s
+TCP链路
+{selectedDevice?.mqttLink}
+遥控接管
+{selectedDevice.remoteStatus}
+规划态势
+{selectedDevice.gpsPlan}
+任务状态
+{selectedDevice.taskStatus}
+实时速度
++ {Number(wsDeviceInfo?.leftMeasureSpeed || 0).toFixed(2)} + rpm +
+工作电流
++ {Number(wsDeviceInfo?.leftCurrent || 0).toFixed(2)} + A +
+实时速度
++ {Number(wsDeviceInfo?.rightMeasureSpeed || 0).toFixed(2)} + rpm +
+工作电流
++ {(Number(wsDeviceInfo?.rightMeasureSpeed || 0)).toFixed(2)} + A +
+GPS航点规划
+航点 {wp.id}
+{wp.lon}, {wp.lat}
+{rt.robotName}
+航点:{rt.waypoints.length} 个
+加载中...
+{modalcontent.content}
+ +