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 }) {