Browse Source

feat:fix bugs

dev
zhaobing’ 1 year ago
parent
commit
8f3d44b336
  1. 7
      web/client/src/sections/analysis/containers/tableShow.jsx

7
web/client/src/sections/analysis/containers/tableShow.jsx

@ -103,7 +103,6 @@ const Network = props => {
}) })
} }
}, [thingId]) }, [thingId])
useEffect(async () => { useEffect(async () => {
if (sensorId && sensorId.length && sensorsDataItems) { if (sensorId && sensorId.length && sensorsDataItems) {
const rs = await dispatch(analysis.findSensorLastData(sensorId)) const rs = await dispatch(analysis.findSensorLastData(sensorId))
@ -150,9 +149,9 @@ const Network = props => {
} }
}, [sensorId]) }, [sensorId])
useEffect(() => { useEffect(() => {
if (deviceData && deviceData.length && tableData && tableData.length) { if (deviceData && deviceData.length ) {
const dataD = deviceData?.map(p => { const dataD = deviceData?.map(p => {
const objRslt = tableData.find(q => q.sensorId == p.sensorId) const objRslt = tableData?.find(q => q.sensorId == p.sensorId)
return { return {
sensorId: objRslt ? objRslt.sensorId : p.sensorId, sensorId: objRslt ? objRslt.sensorId : p.sensorId,
sensorName: objRslt ? objRslt.sensorName : p.sensorName, sensorName: objRslt ? objRslt.sensorName : p.sensorName,
@ -187,7 +186,7 @@ const Network = props => {
setLastData(dataD) setLastData(dataD)
setLastDataCopy(dataD) setLastDataCopy(dataD)
} }
}, [deviceData, tableData]) }, [deviceData])
// const lastDataCopy=useMemo(()=>{ // const lastDataCopy=useMemo(()=>{
// return lastData // return lastData
// },[thingId]) // },[thingId])

Loading…
Cancel
Save