Commit 42e68f08 authored by 陈龙's avatar 陈龙

fix:修复历史曲线在全部为异常值时,显示最大最小值异常的问题

parent 9622dd3a
...@@ -37,12 +37,12 @@ const deviceParams = [ ...@@ -37,12 +37,12 @@ const deviceParams = [
deviceType: '二供机组', deviceType: '二供机组',
// pointAddressID: 208, // pointAddressID: 208,
},*/ },*/
{ /* {
"deviceCode": "SC00000001", "deviceCode": "SC00000001",
// "sensors": "出厂瞬时流量1,1#清水池液位,2#清水池液位,今日供水量,出水压力1", // "sensors": "出厂瞬时流量1,1#清水池液位,2#清水池液位,今日供水量,出水压力1",
"sensors": "出厂瞬时流量1", "sensors": "出厂瞬时流量1",
"deviceType": "水厂" "deviceType": "水厂"
} }*/
/* { /* {
deviceCode: 'EGJZ00000198', deviceCode: 'EGJZ00000198',
// sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量', // sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
...@@ -160,7 +160,12 @@ const deviceParams = [ ...@@ -160,7 +160,12 @@ const deviceParams = [
"sensors": "频率,站点在线状态", "sensors": "频率,站点在线状态",
"deviceType": "送水泵" "deviceType": "送水泵"
}*/ }*/
/*界首*/
{
"deviceCode": "SYJ00000022",
"sensors": "IC",
"deviceType": "水源井"
}
]; ];
const Demo = () => { const Demo = () => {
......
...@@ -905,6 +905,7 @@ const renderItem = (params, api) => { ...@@ -905,6 +905,7 @@ const renderItem = (params, api) => {
const returnCustomSeries = (dataSource) => { const returnCustomSeries = (dataSource) => {
let _maxNumber = returnMaxOrMinNumber(dataSource, 'max'); let _maxNumber = returnMaxOrMinNumber(dataSource, 'max');
let _minNumber = returnMaxOrMinNumber(dataSource, 'min'); let _minNumber = returnMaxOrMinNumber(dataSource, 'min');
if (!_maxNumber.length && !_minNumber.length) return false;
// let _period = returnMaxOrMinNumber(dataSource, 'period'); // let _period = returnMaxOrMinNumber(dataSource, 'period');
// 需要将最大值最小分别传入,后续计算图例位置需要,先min后max // 需要将最大值最小分别传入,后续计算图例位置需要,先min后max
let _max = _maxNumber[1]; let _max = _maxNumber[1];
...@@ -1033,7 +1034,7 @@ const optionGenerator = ( ...@@ -1033,7 +1034,7 @@ const optionGenerator = (
lineStyle: { lineStyle: {
...(item.lineStyle ?? {}), ...(item.lineStyle ?? {}),
width: 1, width: 1,
opacity:0.4 opacity: 0.4
} }
}; };
}); });
...@@ -1154,9 +1155,11 @@ const optionGenerator = ( ...@@ -1154,9 +1155,11 @@ const optionGenerator = (
let _dataSource = dataSource?.filter((item) => item?.dataModel?.length); let _dataSource = dataSource?.filter((item) => item?.dataModel?.length);
if (_dataSource?.length) { if (_dataSource?.length) {
let _customSeries = returnCustomSeries(dataSource); let _customSeries = returnCustomSeries(dataSource);
if (_customSeries) {
series.push(_customSeries); series.push(_customSeries);
} }
} }
}
} else { } else {
tooltip = tooltipAccessor( tooltip = tooltipAccessor(
series.map((item) => item.unit), series.map((item) => item.unit),
......
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