Commit 1d4f9c9d authored by 崔佳豪's avatar 崔佳豪

fix(EC_HistoryView): 空图表容错处理、滤波配置描述

parent ba383392
......@@ -28,7 +28,7 @@ const SimgleChart = memo((props) => {
useEffect(() => {
chartRef.current?.resize?.();
const chart = chartRef.current.getEchartsInstance();
const chart = chartRef.current?.getEchartsInstance?.();
function hander(params) {
const { selected } = params;
......@@ -52,7 +52,7 @@ const SimgleChart = memo((props) => {
// 网格开关,不更新整个图表
useEffect(() => {
const chart = chartRef.current.getEchartsInstance();
const chart = chartRef.current?.getEchartsInstance?.();
if (!chart) return;
const option = chart.getOption();
// 交互指针
......
import React, { useContext, useEffect, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Checkbox, ConfigProvider, DatePicker, Radio, Select, Spin, Tabs } from 'antd';
import { CloseCircleFilled, DownloadOutlined, PlusCircleOutlined } from '@ant-design/icons';
import { Checkbox, ConfigProvider, DatePicker, Radio, Select, Spin, Tabs, Tooltip } from 'antd';
import {
CloseCircleFilled,
DownloadOutlined,
PlusCircleOutlined,
QuestionCircleFilled,
} from '@ant-design/icons';
import moment from 'moment';
import _ from 'lodash';
import TimeRangePicker from '@wisdom-components/timerangepicker';
......@@ -60,11 +65,12 @@ const CheckboxData = [
},
{
key: 'ignoreOutliers',
label: '滤波',
label: '数据滤波',
type: 'updateIgnoreOutliers',
checked: false,
showInCurve: true,
showInTable: true,
tooltip: '数据滤波针对与样本平均值相差2个标准差以上的值进行过滤。',
},
{
key: 'dataThin',
......@@ -403,14 +409,27 @@ const HistoryView = (props) => {
setDataThinKey(value);
};
const renderCheckbox = (child) =>
((activeTabKey === 'curve' && !grid && child.showInCurve) ||
(activeTabKey === 'curve' && grid && child.key === 'curveCenter') ||
(activeTabKey === 'table' && child.showInTable)) && (
<Checkbox checked={child.checked} onChange={(e) => onCheckboxChange(e, child.key)}>
{child.label}
</Checkbox>
const renderCheckbox = (child) => {
const curveAccess = activeTabKey === 'curve' && child.showInCurve;
const tableAccess = activeTabKey === 'table' && child.showInTable;
const gridOptions = ['curveCenter'];
if (grid && gridOptions.indexOf(child.key) === -1) return null;
return (
(curveAccess || tableAccess) && (
<>
<Checkbox checked={child.checked} onChange={(e) => onCheckboxChange(e, child.key)}>
{child.label}
</Checkbox>
{child.tooltip && (
<Tooltip title={child.tooltip}>
<QuestionCircleFilled className={`${prefixCls}-question`} />
</Tooltip>
)}
</>
)
);
};
const renderCurveOption = () => {
return (
......
......@@ -176,3 +176,13 @@
border-radius: 4px;
}
}
.@{history-view}-question {
color: @primary-color;
cursor: pointer;
opacity: 0.8;
&:hover {
opacity: 1;
}
}
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