Commit 41370d84 authored by 陈龙's avatar 陈龙

fix: 修复重复调用的问题

parent eea073ef
......@@ -2,16 +2,16 @@ import React from 'react';
import HistoryView from '../index';
const deviceParams = [
/* {
{
"deviceCode": "EGBF00000023",
"sensors": "出水压力",
"deviceType": "二供泵房"
}, */
{
},
/* {
"deviceCode": "EGBF00000023",
"sensors": "出水瞬时流量,出水压力",
"deviceType": "二供泵房"
}
} */
]
const Demo = () => {
return (
......
......@@ -345,7 +345,7 @@ const HistoryView = (props) => {
_deviceParams[0].sensors = combineSensors.join(',');
}
return _deviceParams;
},[combineSensors])
},[combineSensors,props.deviceParams])
const isBoxPlots =
deviceParams?.length === 1 && deviceParams?.[0]?.sensors?.split(',').length === 1;
const [loading, setLoading] = useState(null);
......@@ -1556,7 +1556,7 @@ const HistoryView = (props) => {
};
useEffect(() => {
getDefaultOptions();
}, [deviceParams]);
}, [props.deviceParams]);
let percentTimer = useRef({
timer: null,
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment