Commit 524923cf authored by 陈龙's avatar 陈龙

feat: 兼容异常处理

parent bb6aa6f7
......@@ -159,6 +159,7 @@ const GridChart = memo((props) => {
return _dataSource
} catch (e) {
props.setLoading(false);
return []
}
};
const returnDateType = (date) => {
......@@ -171,7 +172,7 @@ const GridChart = memo((props) => {
useEffect(() => {
async function handle() {
let _data = await handleDataSource(dataSource);
let _data = await handleDataSource(dataSource)??[];
const grids = _data.reduce((pre, item, index) => {
const {sensorName, deviceType} = item;
const key = `${deviceType}_${sensorName}`; // 同设备类型同指标才在同一组
......
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