From e55f626ceed502c6c4ac79c53cdffb9f747853a3 Mon Sep 17 00:00:00 2001 From: zhangjiming Date: Tue, 11 Mar 2025 09:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E8=BF=9E=E6=8E=A5=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=B8=A9=E5=BA=A6/=E7=94=B5=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header.tsx | 34 ++++++++++++++------------ src/pages/measure/components/MeasureAction.tsx | 2 +- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index e6a24fd..0e180d3 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -72,7 +72,7 @@ export default function Header() { setNickname(userData.nickname); } } - },[userInfo.nickname]); + }, [userInfo.nickname]); const [messageApi, contextHolder] = message.useMessage(); const [nickname, setNickname] = useState(); @@ -159,20 +159,24 @@ export default function Header() { return ( <> {contextHolder} -
-
- 温度:{deviceInfo.temperature.toFixed(1)}℃ - X轴倾斜:{deviceInfo.inclinatorX} - Y轴倾斜:{deviceInfo.inclinatorY} -
-
- -

{deviceInfo.power.toFixed()}%

-
+
+ {deviceInfo.isConnected && ( + <> +
+ 温度:{deviceInfo.temperature.toFixed(1)}℃ + X轴倾斜:{deviceInfo.inclinatorX} + Y轴倾斜:{deviceInfo.inclinatorY} +
+
+ +

{deviceInfo.power.toFixed()}%

+
+ + )} {/*
icon
*/} diff --git a/src/pages/measure/components/MeasureAction.tsx b/src/pages/measure/components/MeasureAction.tsx index b5b36bb..d312b97 100644 --- a/src/pages/measure/components/MeasureAction.tsx +++ b/src/pages/measure/components/MeasureAction.tsx @@ -96,7 +96,7 @@ export default function MeasureAction() { // 开始/重新测量按钮点击事件 const onStart = () => { if (startBtnText === "新测量") { - navigate("../newMeasure"); + navigate("../config"); return; } // 重置测量相关状态