Commit 857d4b8e authored by 陈龙's avatar 陈龙

feat: 增加isInterpolation参数,解决接口在抽稀间隔大于等于12时在抽稀间隔内返回多条数据的问题

parent 57cdecc6
...@@ -172,10 +172,16 @@ const deviceParams = [ ...@@ -172,10 +172,16 @@ const deviceParams = [
"deviceType": "加压机组" "deviceType": "加压机组"
}*/ }*/
/*铁山*/ /*铁山*/
{ /* {
"deviceCode": "SZ00000001", "deviceCode": "SZ00000001",
"deviceType": "水质", "deviceType": "水质",
"sensors": "PH,浑浊度,氨氮,总氮,总磷,溶解氧,水温,电导率,叶绿素a,藻密度,高锰酸盐指数" "sensors": "PH,浑浊度,氨氮,总氮,总磷,溶解氧,水温,电导率,叶绿素a,藻密度,高锰酸盐指数"
}*/
/*邳州*/
{
"deviceCode": "TLC00000001",
"sensors": "1号碳滤池浊度",
"deviceType": "碳滤池"
} }
]; ];
......
...@@ -197,6 +197,12 @@ const timeIntervalList = [ ...@@ -197,6 +197,12 @@ const timeIntervalList = [
unit: 'h', unit: 'h',
name: '12小时', name: '12小时',
}, },
{
key: '24',
zoom: '24',
unit: 'h',
name: '24小时',
},
]; ];
const updateTime = (key) => { const updateTime = (key) => {
...@@ -1105,8 +1111,6 @@ const HistoryView = (props) => { ...@@ -1105,8 +1111,6 @@ const HistoryView = (props) => {
acrossTables, acrossTables,
isBoxPlots: isBoxPlots, isBoxPlots: isBoxPlots,
}; };
// if (ignoreOutliers) param.algorithmValue = algorithmValue;
// param.algorithmValue = algorithmValue;
let diffYears = moment(item.dateTo).diff(moment(item.dateFrom), 'years'); let diffYears = moment(item.dateTo).diff(moment(item.dateFrom), 'years');
let diffDays = moment(item.dateTo).diff(moment(item.dateFrom), 'days'); let diffDays = moment(item.dateTo).diff(moment(item.dateFrom), 'days');
let diffHours = moment(item.dateTo).diff(moment(item.dateFrom), 'hours'); let diffHours = moment(item.dateTo).diff(moment(item.dateFrom), 'hours');
...@@ -1116,8 +1120,14 @@ const HistoryView = (props) => { ...@@ -1116,8 +1120,14 @@ const HistoryView = (props) => {
: !isDilute : !isDilute
? {zoom: '', unit: ''} ? {zoom: '', unit: ''}
: {}; // 表格也支持全数据模式; : {}; // 表格也支持全数据模式;
let _finalParams = {...param, ...zoomParam};
requestArr.push(getHistoryInfo({...param, ...zoomParam})); // 2024年1月8日 抽稀间隔大于等于12小时时,会存在线性插值导致抽稀间隔内数据条数大于预期的问题。需要增加一个额外参数处理该情况。
if (_finalParams.zoom) {
let _num = Number(_finalParams.zoom);
let _isNaN = isNaN(_num);
if (!_isNaN && _num >= 12) _finalParams.isInterpolation = false;
}
requestArr.push(getHistoryInfo(_finalParams));
}); });
setLoading(true); setLoading(true);
Promise.all(requestArr) Promise.all(requestArr)
......
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