Commit 70d93ba9 authored by 陈龙's avatar 陈龙

feat: 新增移动版本

parent 977a05fc
--- ---
title: EC_HistoryView - 历史曲线 title: EC_HistoryView - 历史曲线
nav: nav:
title: 业务组件 title: 业务组件
path: /extend-components path: /extend-components
group: group:
path: / path: /
--- ---
# HistoryView 历史数据查看 # HistoryView 历史数据查看
...@@ -53,3 +53,23 @@ group: ...@@ -53,3 +53,23 @@ group:
... ...
] ]
``` ```
移动端参数
```javascript
{
// date
date:{
dateFrom: '2022-02-02 00:00:00',
dateTo: '2022-02-02 23:59:59',
}
// deviceParams
deviceParams:[{
deviceCode: 'EGBF00000146', // 设备编码
sensors: '进水压力,出水瞬时流量', // 设备查询指标
deviceCode: '二供泵房', // 设备类型
},...],
// chartType
chartType: 'lineChart' || 'boxChart'
}
```
import React from 'react'; import React from 'react';
import HistoryView from '../index'; import HistoryView from '../index';
import {MobileHistoryChart} from "../mobile";
const deviceParams = [ const deviceParams = [
// { // {
...@@ -27,9 +28,15 @@ const deviceParams = [ ...@@ -27,9 +28,15 @@ const deviceParams = [
]; ];
const Demo = () => { const Demo = () => {
return ( return (
<div style={{ height: 700 }}> <div>
<HistoryView deviceParams={deviceParams} defaultModel="table" /> <div style={{height: 700}}>
<HistoryView deviceParams={deviceParams} defaultModel="curve"/>
</div> </div>
<div style={{height: 300}}>
<MobileHistoryChart deviceParams={deviceParams} chartType={'lineChart'}/>
</div>
</div>
); );
}; };
......
import React, { useContext, useEffect, useMemo, useState } from 'react'; import React, {useContext, useEffect, useMemo, useState} from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { import {
...@@ -23,14 +23,14 @@ import _ from 'lodash'; ...@@ -23,14 +23,14 @@ import _ from 'lodash';
import TimeRangePicker from '@wisdom-components/timerangepicker'; import TimeRangePicker from '@wisdom-components/timerangepicker';
import PandaEmpty from '@wisdom-components/empty'; import PandaEmpty from '@wisdom-components/empty';
import BasicTable from '@wisdom-components/basictable'; import BasicTable from '@wisdom-components/basictable';
import { getHistoryInfo, getDeviceAlarmScheme, getExportDeviceHistoryUrl } from './apis'; import {getHistoryInfo, getDeviceAlarmScheme, getExportDeviceHistoryUrl} from './apis';
import SimgleChart from './SingleChart'; import SimgleChart from './SingleChart';
import GridChart from './GridChart'; import GridChart from './GridChart';
import './index.less'; import './index.less';
import { globalConfig } from 'antd/lib/config-provider'; import {globalConfig} from 'antd/lib/config-provider';
const { RangePicker } = DatePicker; const {RangePicker} = DatePicker;
const { Option } = Select; const {Option} = Select;
const startFormat = 'YYYY-MM-DD 00:00:00'; const startFormat = 'YYYY-MM-DD 00:00:00';
const endFormat = 'YYYY-MM-DD 23:59:59'; const endFormat = 'YYYY-MM-DD 23:59:59';
...@@ -221,7 +221,7 @@ const timeColumn = { ...@@ -221,7 +221,7 @@ const timeColumn = {
}; };
const HistoryView = (props) => { const HistoryView = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const {getPrefixCls} = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('history-view'); const prefixCls = getPrefixCls('history-view');
const { const {
...@@ -324,7 +324,7 @@ const HistoryView = (props) => { ...@@ -324,7 +324,7 @@ const HistoryView = (props) => {
const onContrastChange = (value) => { const onContrastChange = (value) => {
setContrastOption(value); setContrastOption(value);
// 模式为日时,默认对比时间根据defaultDate判断 是昨天、上月、还是去年 // 模式为日时,默认对比时间根据defaultDate判断 是昨天、上月、还是去年
setDatePickerArr([...DefaultDatePicker(value==='day'&&defaultDate?defaultDate:value)]); setDatePickerArr([...DefaultDatePicker(value === 'day' && defaultDate ? defaultDate : value)]);
}; };
// 同期对比模式: 时间段选择 // 同期对比模式: 时间段选择
...@@ -364,13 +364,13 @@ const HistoryView = (props) => { ...@@ -364,13 +364,13 @@ const HistoryView = (props) => {
onContrastChange(contrastOption); onContrastChange(contrastOption);
setShowBoxOption(false); setShowBoxOption(false);
setChartType('lineChart'); setChartType('lineChart');
onCheckboxChange({ target: { value: false } }, 'chartType'); onCheckboxChange({target: {value: false}}, 'chartType');
onCheckboxChange({ target: { value: false } }, 'ignoreOutliers'); onCheckboxChange({target: {value: false}}, 'ignoreOutliers');
} else { } else {
// 自定义 // 自定义
// 不需要处理 // 不需要处理
setShowBoxOption(true); setShowBoxOption(true);
onCheckboxChange({ target: { value: true } }, 'chartType'); onCheckboxChange({target: {value: true}}, 'chartType');
} }
}; };
...@@ -399,7 +399,7 @@ const HistoryView = (props) => { ...@@ -399,7 +399,7 @@ const HistoryView = (props) => {
)} )}
{timeValue === 'contrast' && ( // 同期对比 {timeValue === 'contrast' && ( // 同期对比
<> <>
<Select value={contrastOption} style={{ width: 60 }} onChange={onContrastChange}> <Select value={contrastOption} style={{width: 60}} onChange={onContrastChange}>
<Option value="day"></Option> <Option value="day"></Option>
<Option value="month"></Option> <Option value="month"></Option>
</Select> </Select>
...@@ -416,7 +416,7 @@ const HistoryView = (props) => { ...@@ -416,7 +416,7 @@ const HistoryView = (props) => {
className={classNames(`${prefixCls}-contrast-delete`)} className={classNames(`${prefixCls}-contrast-delete`)}
onClick={() => handleDeleteDatePicker(index)} onClick={() => handleDeleteDatePicker(index)}
> >
<CloseCircleFilled /> <CloseCircleFilled/>
</div> </div>
)} )}
</div> </div>
...@@ -425,7 +425,7 @@ const HistoryView = (props) => { ...@@ -425,7 +425,7 @@ const HistoryView = (props) => {
)} )}
</div> </div>
))} ))}
{datePickerArr.length < 5 && <PlusCircleOutlined onClick={handleAddDatePicker} />} {datePickerArr.length < 5 && <PlusCircleOutlined onClick={handleAddDatePicker}/>}
</> </>
)} )}
</div> </div>
...@@ -481,7 +481,7 @@ const HistoryView = (props) => { ...@@ -481,7 +481,7 @@ const HistoryView = (props) => {
</Checkbox> </Checkbox>
{child.tooltip && ( {child.tooltip && (
<Tooltip title={child.tooltip}> <Tooltip title={child.tooltip}>
<QuestionCircleFilled className={`${prefixCls}-question`} /> <QuestionCircleFilled className={`${prefixCls}-question`}/>
</Tooltip> </Tooltip>
)} )}
</> </>
...@@ -493,18 +493,18 @@ const HistoryView = (props) => { ...@@ -493,18 +493,18 @@ const HistoryView = (props) => {
return ( return (
<div <div
className={classNames(`${prefixCls}-cover`)} className={classNames(`${prefixCls}-cover`)}
style={isChart && isSingle ? { width: '100%' } : {}} style={isChart && isSingle ? {width: '100%'} : {}}
> >
{isChart && isSingle && showBoxOption ? ( {isChart && isSingle && showBoxOption ? (
<> <>
<div className={classNames(`${prefixCls}-label`)}>曲线形态</div> <div className={classNames(`${prefixCls}-label`)}>曲线形态</div>
<Radio.Group <Radio.Group
value={chartType} value={chartType}
style={{ marginRight: 16 }} style={{marginRight: 16}}
onChange={(e) => { onChange={(e) => {
let _value = e.target.value; let _value = e.target.value;
setChartType(_value); setChartType(_value);
onCheckboxChange({ target: { value: _value !== 'boxChart' } }, 'chartType'); onCheckboxChange({target: {value: _value !== 'boxChart'}}, 'chartType');
}} }}
> >
<Radio.Button value={'lineChart'}>线形图</Radio.Button> <Radio.Button value={'lineChart'}>线形图</Radio.Button>
...@@ -529,7 +529,7 @@ const HistoryView = (props) => { ...@@ -529,7 +529,7 @@ const HistoryView = (props) => {
{activeTabKey === 'table' && ( {activeTabKey === 'table' && (
<Select <Select
value={dataThinKey} value={dataThinKey}
style={{ width: 90 }} style={{width: 90}}
onChange={onTimeIntervalChange} onChange={onTimeIntervalChange}
disabled={!dataConfig.dataThin} disabled={!dataConfig.dataThin}
> >
...@@ -567,14 +567,15 @@ const HistoryView = (props) => { ...@@ -567,14 +567,15 @@ const HistoryView = (props) => {
aDom.click(); aDom.click();
aDom.remove(); aDom.remove();
}) })
.catch((err) => {}); .catch((err) => {
});
}); });
}; };
const handleTableData = (data) => { const handleTableData = (data) => {
const ignoreOutliers = checkboxData.find((item) => item.key === 'ignoreOutliers').checked; const ignoreOutliers = checkboxData.find((item) => item.key === 'ignoreOutliers').checked;
const dataIndexAccess = (dataItem, index) => { const dataIndexAccess = (dataItem, index) => {
const { stationCode, sensorName } = dataItem; const {stationCode, sensorName} = dataItem;
return `${stationCode}-${sensorName}-${index}`; return `${stationCode}-${sensorName}-${index}`;
}; };
...@@ -585,7 +586,7 @@ const HistoryView = (props) => { ...@@ -585,7 +586,7 @@ const HistoryView = (props) => {
// 处理表头数据 // 处理表头数据
const columnsData = data.map((item, index) => { const columnsData = data.map((item, index) => {
const { stationCode, equipmentName, sensorName, unit, dataModel } = item; const {stationCode, equipmentName, sensorName, unit, dataModel} = item;
const dataIndex = dataIndexAccess(item, index); const dataIndex = dataIndexAccess(item, index);
let col = { let col = {
title: `${equipmentName}-${sensorName}${unit ? `(${unit})` : ''}`, title: `${equipmentName}-${sensorName}${unit ? `(${unit})` : ''}`,
...@@ -608,7 +609,7 @@ const HistoryView = (props) => { ...@@ -608,7 +609,7 @@ const HistoryView = (props) => {
const timeData = {}; const timeData = {};
const buildDefaultData = (time) => { const buildDefaultData = (time) => {
const obj = { key: time, time: time }; const obj = {key: time, time: time};
data.forEach((item, index) => { data.forEach((item, index) => {
const dataIndex = dataIndexAccess(item, index); const dataIndex = dataIndexAccess(item, index);
obj[dataIndex] = ''; obj[dataIndex] = '';
...@@ -616,7 +617,7 @@ const HistoryView = (props) => { ...@@ -616,7 +617,7 @@ const HistoryView = (props) => {
return obj; return obj;
}; };
data.forEach((item, index) => { data.forEach((item, index) => {
const { stationCode, sensorName, dataModel } = item; const {stationCode, sensorName, dataModel} = item;
dataModel && dataModel &&
dataModel.forEach((data) => { dataModel.forEach((data) => {
const formatTime = moment(data.pt).format(format); const formatTime = moment(data.pt).format(format);
...@@ -632,7 +633,7 @@ const HistoryView = (props) => { ...@@ -632,7 +633,7 @@ const HistoryView = (props) => {
// 处理表格数据 // 处理表格数据
data.forEach((child, index) => { data.forEach((child, index) => {
const { dataModel } = child; const {dataModel} = child;
const dataIndex = dataIndexAccess(child, index); const dataIndex = dataIndexAccess(child, index);
dataModel && dataModel &&
dataModel.forEach((value, j) => { dataModel.forEach((value, j) => {
...@@ -683,28 +684,28 @@ const HistoryView = (props) => { ...@@ -683,28 +684,28 @@ const HistoryView = (props) => {
const handleDataThinKey = (diffDays) => { const handleDataThinKey = (diffDays) => {
// edit by zy 根据选择的时长控制抽稀频度 // edit by zy 根据选择的时长控制抽稀频度
if (diffDays >= 7 && diffDays < 15) { if (diffDays >= 7 && diffDays < 15) {
return { unit: 'h', zoom: '2' }; return {unit: 'h', zoom: '2'};
} else if (diffDays >= 15 && diffDays < 30) { } else if (diffDays >= 15 && diffDays < 30) {
return { unit: 'h', zoom: '4' }; return {unit: 'h', zoom: '4'};
} else if (diffDays >= 30) { } else if (diffDays >= 30) {
return { unit: 'h', zoom: '6' }; return {unit: 'h', zoom: '6'};
} else if (diffDays < 7 && diffDays >= 2) { } else if (diffDays < 7 && diffDays >= 2) {
return { unit: 'min', zoom: '40' }; return {unit: 'min', zoom: '40'};
} else if (diffDays < 2 && diffDays >= 1) { } else if (diffDays < 2 && diffDays >= 1) {
return { unit: 'min', zoom: '30' }; return {unit: 'min', zoom: '30'};
} else { } else {
return { unit: 'min', zoom: '10' }; return {unit: 'min', zoom: '10'};
} }
}; };
// 处理接口服务参数的变化 // 处理接口服务参数的变化
const onChangeParams = (value = {}) => { const onChangeParams = (value = {}) => {
const { dateRange, isDilute, ignoreOutliers, zoom, unit } = value; const {dateRange, isDilute, ignoreOutliers, zoom, unit} = value;
const requestArr = []; const requestArr = [];
const acrossTables = []; const acrossTables = [];
deviceParams deviceParams
.map((item) => { .map((item) => {
let _item = { ...item }; let _item = {...item};
_item.sensors = _item.sensors =
item.sensors && !item.sensors.includes('是否在线') item.sensors && !item.sensors.includes('是否在线')
? item.sensors + ',是否在线' ? item.sensors + ',是否在线'
...@@ -721,13 +722,11 @@ const HistoryView = (props) => { ...@@ -721,13 +722,11 @@ const HistoryView = (props) => {
return; return;
} }
dateRange.forEach((item) => { dateRange.forEach((item) => {
// let _showLine = checkboxData.find(item => item.key === 'justLine');
const param = { const param = {
isDilute, isDilute,
zoom, zoom,
unit, unit,
ignoreOutliers, ignoreOutliers,
// isVertical: false, // 是否查询竖表
dateFrom: item.dateFrom, dateFrom: item.dateFrom,
dateTo: item.dateTo, dateTo: item.dateTo,
acrossTables, acrossTables,
...@@ -735,14 +734,14 @@ const HistoryView = (props) => { ...@@ -735,14 +734,14 @@ const HistoryView = (props) => {
}; };
let diffDays = moment(item.dateTo).diff(moment(item.dateFrom), 'days'); let diffDays = moment(item.dateTo).diff(moment(item.dateFrom), 'days');
let zoomParam = activeTabKey === 'curve' ? handleDataThinKey(diffDays) : {}; let zoomParam = activeTabKey === 'curve' ? handleDataThinKey(diffDays) : {};
requestArr.push(getHistoryInfo({ ...param, ...zoomParam })); requestArr.push(getHistoryInfo({...param, ...zoomParam}));
}); });
setLoading(true); setLoading(true);
Promise.all(requestArr).then((results) => { Promise.all(requestArr).then((results) => {
if (results.length) { if (results.length) {
let data = []; let data = [];
results.forEach((res, index) => { results.forEach((res, index) => {
const { dateFrom, dateTo } = dateRange?.[index] ?? {}; const {dateFrom, dateTo} = dateRange?.[index] ?? {};
if (res.code === 0 && res.data.length) { if (res.code === 0 && res.data.length) {
res.data.forEach((d) => { res.data.forEach((d) => {
d.dateFrom = dateFrom || ''; d.dateFrom = dateFrom || '';
...@@ -775,7 +774,7 @@ const HistoryView = (props) => { ...@@ -775,7 +774,7 @@ const HistoryView = (props) => {
}; };
useEffect(() => { useEffect(() => {
const { dataThin, ignoreOutliers, zoom, unit } = dataConfig; const {dataThin, ignoreOutliers, zoom, unit} = dataConfig;
beforChangeParams().finally(() => { beforChangeParams().finally(() => {
onChangeParams({ onChangeParams({
isDilute: dataThin, isDilute: dataThin,
...@@ -801,7 +800,7 @@ const HistoryView = (props) => { ...@@ -801,7 +800,7 @@ const HistoryView = (props) => {
</div> </div>
<div className={`${prefixCls}-content`}> <div className={`${prefixCls}-content`}>
{!chartDataSource.length ? ( {!chartDataSource.length ? (
<PandaEmpty /> <PandaEmpty/>
) : grid === true ? ( ) : grid === true ? (
<GridChart <GridChart
curveCenter={curveCenter} curveCenter={curveCenter}
...@@ -843,10 +842,11 @@ const HistoryView = (props) => { ...@@ -843,10 +842,11 @@ const HistoryView = (props) => {
columns={columns} columns={columns}
{...tableProps} {...tableProps}
pagination={false} pagination={false}
onChange={() => {}} onChange={() => {
}}
/> />
) : ( ) : (
<PandaEmpty /> <PandaEmpty/>
)} )}
</div> </div>
</> </>
...@@ -871,7 +871,7 @@ const HistoryView = (props) => { ...@@ -871,7 +871,7 @@ const HistoryView = (props) => {
<div className={`${prefixCls}-extra-right`}> <div className={`${prefixCls}-extra-right`}>
{activeTabKey === 'table' && ( {activeTabKey === 'table' && (
<Button type="link" onClick={exportExcelBtn}> <Button type="link" onClick={exportExcelBtn}>
<DownloadOutlined /> <DownloadOutlined/>
下载 下载
</Button> </Button>
)} )}
......
import React, {useEffect, useMemo, useState, useContext} from 'react';
import GridChart from "./GridChart";
import {ConfigProvider} from "antd";
import moment from "moment";
import {getDeviceAlarmScheme, getHistoryInfo} from "./apis";
import SimgleChart from "./SingleChart";
// deviceAlarmSchemes 用来获取对应的 方案的最大值/最小值 标记状态
// dataSource 获取的报警信息
// deviceParams,
// defaultDate,
// {
// deviceCode: 'XMYL00000345',
// sensors: '进水压力',
// deviceType: '熊猫压力表',
// pointAddressID: 4,
// },
//{
// "isDilute": true, // 抽稀
// "zoom": "30",// 抽稀
// "unit": "min",// 抽稀
// "ignoreOutliers": false, // 滤波
// "dateFrom": "2023-07-09 16:38:32",
// "dateTo": "2023-07-10 16:38:32",
// "acrossTables": [
// {
// "deviceCode": "XMYL00000297",
// "sensors": "进水压力,是否在线",
// "deviceType": "熊猫压力表"
// }
// ],
// "isBoxPlots": true // 箱线图
// }
const DATE_FORMAT = 'YYYY-MM-DD';
const MobileHistoryChart = (
{
date = {
dateFrom: moment().format(`${DATE_FORMAT} 00:00:00`),
dateTo: moment().format(`${DATE_FORMAT} 23:59:59`)
},
deviceParams = [],
ignoreOutliers = true,
isDilute = true,
needMarkLine = true,
showBoxOption = true, //
chartGrid = true,
chartType='lineChart', // lineChart boxChart
}
) => {
const [deviceAlarmSchemes, setDeviceAlarmSchemes] = useState(null);
const [chartDataSource, setChartDataSource] = useState(null);
const {getPrefixCls} = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('history-view');
const isBoxPlots =
deviceParams?.length === 1 && deviceParams[0]?.sensors?.split(',').length === 1;
const handleDataThinKey = (diffDays) => {
// 移动端缩放的抽稀一倍
if (diffDays >= 7 && diffDays < 15) {
return {unit: 'h', zoom: '4'};
} else if (diffDays >= 15 && diffDays < 30) {
return {unit: 'h', zoom: '8'};
} else if (diffDays >= 30) {
return {unit: 'h', zoom: '12'};
} else if (diffDays < 7 && diffDays >= 2) {
return {unit: 'min', zoom: '80'};
} else if (diffDays < 2 && diffDays >= 1) {
return {unit: 'min', zoom: '60'};
} else {
return {unit: 'min', zoom: '20'};
}
};
const getDataSource = () => {
let diffDays = moment(date.dateTo).diff(moment(date.dateFrom), 'days');
const thinKey = handleDataThinKey(diffDays);
const acrossTables = deviceParams.map(item => {
let _item = {...item};
let _sensorArr = _item.sensors.split(',');
if (!_sensorArr.includes('是否在线')) {
_sensorArr.push('是否在线')
}
return _item;
});
let _params = {
...date,
isBoxPlots,
ignoreOutliers,
isDilute,
...thinKey,
acrossTables
};
getHistoryInfo({..._params}).then(res => {
let data = [];
const {dateFrom, dateTo} = date;
if (res.code === 0 && res.data.length) {
res.data.forEach((d) => {
d.dateFrom = dateFrom || '';
d.dateTo = dateTo || '';
});
deviceParams.forEach((p) => {
// 返回数据按查询指标顺序排序
const sensors = p.sensors?.split(',') ?? [];
const list = sensors.map((s) => {
const dataItem = res.data.find(
(d) => d.stationCode === p.deviceCode && d.sensorName === s,
);
if (dataItem) {
dataItem.dateFrom = dateFrom || '';
dataItem.dateTo = dateTo || '';
return dataItem;
} else {
return {};
}
});
data = data.concat(list);
});
}
setChartDataSource(data);
})
};
const getScheme = () => {
getDeviceAlarmScheme({
data: deviceParams.map((item) => ({
deviceType: item.deviceType,
deviceCode: item.deviceCode,
pointAddressID: item.pointAddressID,
sensorName: item.sensors,
})),
}).then((res) => {
if (res.code === 0) setDeviceAlarmSchemes(res.data || []);
else setDeviceAlarmSchemes([]);
return Promise.resolve();
}).catch((err) => {
setDeviceAlarmSchemes([]);
return Promise.resolve();
});
}
useEffect(() => {
getDataSource();
getScheme();
}, [])
return deviceAlarmSchemes && chartDataSource ? <SimgleChart
showBoxOption={showBoxOption}
curveCenter={true}
chartGrid={chartGrid}
prefixCls={prefixCls}
dataSource={chartDataSource}
chartType={isBoxPlots ? chartType : null}
deviceAlarmSchemes={deviceAlarmSchemes}
/> : null
}
export {
MobileHistoryChart
}
\ No newline at end of file
import moment from 'moment'; import moment from 'moment';
import _, { isArray } from 'lodash'; import _, {isArray} from 'lodash';
/** 轴宽度, 用于计算多轴显示时, 轴线偏移和绘图区域尺寸 */ /** 轴宽度, 用于计算多轴显示时, 轴线偏移和绘图区域尺寸 */
const axisWidth = 40; const axisWidth = 40;
...@@ -265,7 +265,6 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -265,7 +265,6 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
const showBoxOption = _.get(config, 'showBoxOption', false); const showBoxOption = _.get(config, 'showBoxOption', false);
// 自定义属性 // 自定义属性
const restOption = _.pick(cusOption, ['title', 'legend']); const restOption = _.pick(cusOption, ['title', 'legend']);
// 一种指标一个y轴 // 一种指标一个y轴
const yAxisMap = new Map(); const yAxisMap = new Map();
dataSource.forEach((item, index) => { dataSource.forEach((item, index) => {
...@@ -336,7 +335,6 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -336,7 +335,6 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
}; };
const seriesTemplate = (param, unit) => { const seriesTemplate = (param, unit) => {
if (!param) return ''; if (!param) return '';
console.log(param);
const { value, encode } = param; const { value, encode } = param;
// const val = value[encode.y[0]]; // const val = value[encode.y[0]];
const _unit = unit || 'Mpa'; const _unit = unit || 'Mpa';
...@@ -535,13 +533,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -535,13 +533,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
let _unit = ''; let _unit = '';
series = series.map((item) => { series = series.map((item) => {
_unit = item.unit; _unit = item.unit;
let _item = { ...item, symbol: 'none' }; return {...item, symbol: 'none'};
/* _item.data = _item?.data?.map(d => {
return d[1] || null
}) || [];*/
return _item;
}); });
console.log(series);
[[..._minData], [..._maxData]].forEach((item, index) => { [[..._minData], [..._maxData]].forEach((item, index) => {
series.push({ series.push({
name: index === 0 ? '最小值' : '最大值', name: index === 0 ? '最小值' : '最大值',
......
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