Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
1d4f9c9d
Commit
1d4f9c9d
authored
Feb 08, 2023
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(EC_HistoryView): 空图表容错处理、滤波配置描述
parent
ba383392
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
12 deletions
+41
-12
SingleChart.js
packages/extend-components/EC_HistoryView/src/SingleChart.js
+2
-2
index.js
packages/extend-components/EC_HistoryView/src/index.js
+29
-10
index.less
packages/extend-components/EC_HistoryView/src/index.less
+10
-0
No files found.
packages/extend-components/EC_HistoryView/src/SingleChart.js
View file @
1d4f9c9d
...
...
@@ -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
();
// 交互指针
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
1d4f9c9d
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
(
...
...
packages/extend-components/EC_HistoryView/src/index.less
View file @
1d4f9c9d
...
...
@@ -176,3 +176,13 @@
border-radius: 4px;
}
}
.@{history-view}-question {
color: @primary-color;
cursor: pointer;
opacity: 0.8;
&:hover {
opacity: 1;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment