|
|
@ -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]) |
|
|
|