From 8f3d44b33651f665ec5959d1724272a69f746270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Fri, 1 Dec 2023 11:03:44 +0800 Subject: [PATCH] feat:fix bugs --- web/client/src/sections/analysis/containers/tableShow.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/client/src/sections/analysis/containers/tableShow.jsx b/web/client/src/sections/analysis/containers/tableShow.jsx index d4ee3e0..dcc1fc1 100644 --- a/web/client/src/sections/analysis/containers/tableShow.jsx +++ b/web/client/src/sections/analysis/containers/tableShow.jsx @@ -103,7 +103,6 @@ const Network = props => { }) } }, [thingId]) - useEffect(async () => { if (sensorId && sensorId.length && sensorsDataItems) { const rs = await dispatch(analysis.findSensorLastData(sensorId)) @@ -150,9 +149,9 @@ const Network = props => { } }, [sensorId]) useEffect(() => { - if (deviceData && deviceData.length && tableData && tableData.length) { + if (deviceData && deviceData.length ) { const dataD = deviceData?.map(p => { - const objRslt = tableData.find(q => q.sensorId == p.sensorId) + const objRslt = tableData?.find(q => q.sensorId == p.sensorId) return { sensorId: objRslt ? objRslt.sensorId : p.sensorId, sensorName: objRslt ? objRslt.sensorName : p.sensorName, @@ -187,7 +186,7 @@ const Network = props => { setLastData(dataD) setLastDataCopy(dataD) } - }, [deviceData, tableData]) + }, [deviceData]) // const lastDataCopy=useMemo(()=>{ // return lastData // },[thingId])