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

feat: 兼容异常处理

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