Commit 81994548 authored by 周宏民's avatar 周宏民

fix: 修改历史曲线bug

parent 942a536c
...@@ -354,6 +354,10 @@ const HistoryInfo = (props) => { ...@@ -354,6 +354,10 @@ const HistoryInfo = (props) => {
// 处理接口服务参数的变化 // 处理接口服务参数的变化
const onChangeParams = (value = []) => { const onChangeParams = (value = []) => {
const { dateRange, ignoreOutliers, zoom, unit } = value; const { dateRange, ignoreOutliers, zoom, unit } = value;
if(!dateRange.length){
handleTableData([]);
handleSeries([]);
}
const requestArr = []; const requestArr = [];
dateRange.forEach((item) => { dateRange.forEach((item) => {
const param = { const param = {
...@@ -371,6 +375,7 @@ const HistoryInfo = (props) => { ...@@ -371,6 +375,7 @@ const HistoryInfo = (props) => {
}); });
setLoading(true); setLoading(true);
Promise.all(requestArr).then((values) => { Promise.all(requestArr).then((values) => {
setLoading(false);
if (values.length) { if (values.length) {
let data = []; let data = [];
values.forEach((res) => { values.forEach((res) => {
...@@ -378,7 +383,6 @@ const HistoryInfo = (props) => { ...@@ -378,7 +383,6 @@ const HistoryInfo = (props) => {
data = data.concat(res.data); data = data.concat(res.data);
} }
}); });
setLoading(false);
handleTableData(data); handleTableData(data);
handleSeries(data); handleSeries(data);
} }
...@@ -572,6 +576,7 @@ const HistoryInfo = (props) => { ...@@ -572,6 +576,7 @@ const HistoryInfo = (props) => {
onChange={(date, dateString) => onChange={(date, dateString) =>
onContrastPickerChange(date, dateString, child) onContrastPickerChange(date, dateString, child)
} }
style={{width: 130}}
/> />
{datePickerArr.length > 2 && ( {datePickerArr.length > 2 && (
<div <div
......
...@@ -412,6 +412,7 @@ const HistoryView = (props) => { ...@@ -412,6 +412,7 @@ const HistoryView = (props) => {
picker={contrastOption} picker={contrastOption}
value={child.value} value={child.value}
onChange={(date, dateString) => onContrastPickerChange(date, dateString, child)} onChange={(date, dateString) => onContrastPickerChange(date, dateString, child)}
style={{width: 130}}
/> />
{datePickerArr.length > 2 && ( {datePickerArr.length > 2 && (
<div <div
...@@ -722,7 +723,7 @@ const HistoryView = (props) => { ...@@ -722,7 +723,7 @@ const HistoryView = (props) => {
if (i.sensors && i.deviceCode && i.deviceCode) if (i.sensors && i.deviceCode && i.deviceCode)
acrossTables.push(_.omit(i, ['pointAddressID'])); acrossTables.push(_.omit(i, ['pointAddressID']));
}); });
if (!acrossTables?.length) { if (!acrossTables?.length||!dateRange.length) {
handleTableData([]); handleTableData([]);
setChartDataSource([]); setChartDataSource([]);
return; return;
...@@ -745,6 +746,7 @@ const HistoryView = (props) => { ...@@ -745,6 +746,7 @@ const HistoryView = (props) => {
}); });
setLoading(true); setLoading(true);
Promise.all(requestArr).then((results) => { Promise.all(requestArr).then((results) => {
setLoading(false);
if (results.length) { if (results.length) {
let data = []; let data = [];
results.forEach((res, index) => { results.forEach((res, index) => {
......
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