Commit b935d842 authored by 陈龙's avatar 陈龙

fix: 剔除isVertical参数;修复x轴错误的问题

parent 206b3f82
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
import { request } from '@wisdom-utils/utils'; import { request } from '@wisdom-utils/utils';
import * as constants from '../constants'; import * as constants from '../constants';
const BASEURL = '/PandaAssets/Assets/ReportManager'; const BASEURL = '/PandaAssets/CityWater/ReportManager';
export const API = { export const API = {
GET_REPORT_INFO: `${BASEURL}/GetReportInfo`, // 获取报表信息 GET_REPORT_INFO: `${BASEURL}/GetReportInfo`, // 获取报表信息
GET_REPORT_FILTER_VALUE: `${BASEURL}/GetReportFilterValue`, // 获取过滤字段的值的枚举 GET_REPORT_FILTER_VALUE: `${BASEURL}/GetReportFilterValue`, // 获取过滤字段的值的枚举
......
...@@ -438,8 +438,9 @@ const HistoryView = (props) => { ...@@ -438,8 +438,9 @@ const HistoryView = (props) => {
if (key === 'chartType') { if (key === 'chartType') {
data[_index1].showInCurve = e.target.value; data[_index1].showInCurve = e.target.value;
data[_index1].checked = false; data[_index1].checked = false;
data[_index].showInCurve = false;
data[_index].checked = false;
} }
debugger
setCheckboxData(data); setCheckboxData(data);
}; };
...@@ -686,7 +687,7 @@ const HistoryView = (props) => { ...@@ -686,7 +687,7 @@ const HistoryView = (props) => {
zoom, zoom,
unit, unit,
ignoreOutliers, ignoreOutliers,
isVertical: false, // 是否查询竖表 // isVertical: false, // 是否查询竖表
dateFrom: item.dateFrom, dateFrom: item.dateFrom,
dateTo: item.dateTo, dateTo: item.dateTo,
acrossTables, acrossTables,
......
...@@ -348,7 +348,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -348,7 +348,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
markArea, markArea,
}; };
}); });
console.log('series: ', series);
// 由于series更新后,没有的数据曲线仍然停留在图表区上,导致图表可视区范围有问题 // 由于series更新后,没有的数据曲线仍然停留在图表区上,导致图表可视区范围有问题
const min = Math.min( const min = Math.min(
...series.map((item) => item.data?.[0]?.[0]).filter((item) => item !== undefined), ...series.map((item) => item.data?.[0]?.[0]).filter((item) => item !== undefined),
...@@ -360,7 +360,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -360,7 +360,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
); );
let xAxis = {type: 'time', min, max}; let xAxis = {type: 'time', min, max};
decorateAxisGridLine(xAxis, showGridLine); decorateAxisGridLine(xAxis, showGridLine);
console.log('series: ', series);
const tooltipTimeFormat = !contrast const tooltipTimeFormat = !contrast
? 'YYYY-MM-DD HH:mm:ss' ? 'YYYY-MM-DD HH:mm:ss'
: contrastOption === 'day' : contrastOption === 'day'
...@@ -380,8 +380,9 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -380,8 +380,9 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
const {firstPV, lastPV, maxPV, minPV} = item; const {firstPV, lastPV, maxPV, minPV} = item;
return [firstPV, lastPV, minPV, maxPV] return [firstPV, lastPV, minPV, maxPV]
}) || []; //当存在othersData的时候,只是单曲线 }) || []; //当存在othersData的时候,只是单曲线
xAxis = {type: 'category', data: series[0].data.map(item => moment(item[0]).format('YYYY-MM-DD'))};
series = series.map(item => { series = series.map(item => {
let _item = {...item, symbol: false}; let _item = {...item, symbol: null};
_item.data = _item?.data?.map(d => { _item.data = _item?.data?.map(d => {
return d[1] || null return d[1] || null
}) || []; }) || [];
...@@ -390,7 +391,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -390,7 +391,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
series.push({ series.push({
type: 'candlestick', type: 'candlestick',
name: '箱线图', name: '箱线图',
symbol: false, symbol: null,
data: otherData data: otherData
}); });
} else { } else {
...@@ -401,6 +402,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -401,6 +402,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
_maxData.push(maxPV); _maxData.push(maxPV);
_minData.push(minPV); _minData.push(minPV);
}); //当存在othersData的时候,只是单曲线 }); //当存在othersData的时候,只是单曲线
xAxis = {type: 'category', data: series[0].data.map(item => moment(item[0]).format('YYYY-MM-DD'))};
series = series.map(item => { series = series.map(item => {
let _item = {...item, symbol: false}; let _item = {...item, symbol: false};
_item.data = _item?.data?.map(d => { _item.data = _item?.data?.map(d => {
...@@ -426,12 +428,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -426,12 +428,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
}); });
}) })
} }
xAxis = {type: 'category', data: series[0].data.map(item => moment(item[0]).format('YYYY-MM-DD'))};
tooltip.formatter = (e) => {
console.log(e);
}
} }
debugger
return { return {
yAxis, yAxis,
grid, grid,
......
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