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

fix: 修改历史曲线bug

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