From 66660a772a6c33752e5ed527a6401df5c9e1fcf2 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Tue, 2 Jun 2026 09:19:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=88=AA=E7=BA=BF=E4=BB=BB=E5=8A=A1=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=20=20=E5=B7=A5=E4=BD=9C=E4=BB=BB=E5=8A=A1=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=20=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96=EF=BC=8C=E6=BA=A2=E5=87=BA=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/devices/WayLinePage.tsx | 41 ++++++++++++++++---------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/components/devices/WayLinePage.tsx b/src/components/devices/WayLinePage.tsx index 57f0296..fa30ab4 100644 --- a/src/components/devices/WayLinePage.tsx +++ b/src/components/devices/WayLinePage.tsx @@ -90,11 +90,10 @@ export default function WayLinePage({ onRefresh }) { // 当MQTT数据更新时,更新持久化数据(只在有新数据时更新) const handleMqttMessage = (topic, message) => { - console.log('WayLinePage MQTT 消息到达 - Topic:', topic); - console.log('WayLinePage MQTT 消息内容:', message); + try { const parsedMessage = JSON.parse(message); - console.log('WayLinePage 解析后的消息:', parsedMessage); + //console.log('WayLinePage 解析后的消息:', parsedMessage); if (parsedMessage.data && parsedMessage.data.host) { const { host } = parsedMessage.data; @@ -213,7 +212,6 @@ export default function WayLinePage({ onRefresh }) { if (listDrone.gateway_sn && listDrone.gateway_sn !== listDrone.device_sn) { topics.push(`thing/product/${listDrone.gateway_sn}/osd`); } - console.log('WayLinePage 订阅的MQTT主题:', topics); return topics; }, [listDrone]); @@ -250,11 +248,6 @@ export default function WayLinePage({ onRefresh }) { }; fetchRealtime(); - listDroneTimerRef.current = setInterval(fetchRealtime, 3000); - - return () => { - if (listDroneTimerRef.current) clearInterval(listDroneTimerRef.current); - }; }, [listDrone]); // 工作看板 独立筛选状态 @@ -521,6 +514,8 @@ export default function WayLinePage({ onRefresh }) { const getBoardTask = async () => { if (!planedevices?.length) return; try { + console.log('获取看板任务数据,当前筛选条件:') + const defaultStart = dayjs().startOf('day').unix(); const defaultEnd = dayjs().endOf('day').unix(); @@ -530,6 +525,7 @@ export default function WayLinePage({ onRefresh }) { const sns = boardDrone ? [boardDrone.gateway_sn] : planedevices.map(item => item.gateway_sn); const res = await getsinglePlan({ sns, beginAt, endAt }); + console.log('看板任务数据接口返回:', res); if (res?.code === 200) { let combinedList = []; if (res.data) { @@ -537,6 +533,7 @@ export default function WayLinePage({ onRefresh }) { if (item.list) combinedList = combinedList.concat(item.list); }); } + console.log('看板任务列表:', combinedList); setBoardTaskList(combinedList); } } catch (err) { @@ -563,7 +560,7 @@ export default function WayLinePage({ onRefresh }) { useEffect(() => { getBoardTask(); - }, [boardDrone, boardDateRange]); + }, [boardDrone, boardDateRange, planedevices?.length]); // 任务状态标签 const getStatusTag = (status) => { @@ -1398,12 +1395,26 @@ export default function WayLinePage({ onRefresh }) {