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
31a943d0
Commit
31a943d0
authored
Jul 04, 2023
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 历史数据添加默认对比时间参数
parent
fce12eee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
index.js
packages/extend-components/EC_HistoryView/src/index.js
+6
-2
No files found.
packages/extend-components/EC_HistoryView/src/index.js
View file @
31a943d0
...
...
@@ -233,6 +233,7 @@ const HistoryView = (props) => {
defaultModel
,
showModels
,
needMarkLine
,
defaultDate
,
}
=
props
;
const
isBoxPlots
=
deviceParams
?.
length
===
1
&&
deviceParams
[
0
]?.
sensors
?.
split
(
','
).
length
===
1
;
...
...
@@ -248,7 +249,7 @@ const HistoryView = (props) => {
// 同期对比模式
const
[
contrastOption
,
setContrastOption
]
=
useState
(
'day'
);
// 对比时间类型: 日/月
const
[
datePickerArr
,
setDatePickerArr
]
=
useState
(
DefaultDatePicker
(
'day'
));
// 对比时间段配置值
const
[
datePickerArr
,
setDatePickerArr
]
=
useState
(
DefaultDatePicker
(
defaultDate
));
// 对比时间段配置值
const
[
checkboxData
,
setCheckboxData
]
=
useState
(()
=>
[...
CheckboxData
]);
// 曲线设置项
const
[
dataThinKey
,
setDataThinKey
]
=
useState
(
timeIntervalList
[
0
].
key
);
// 曲线抽稀时间设置
...
...
@@ -322,7 +323,8 @@ const HistoryView = (props) => {
// 同期对比模式: 选择(日/月)
const
onContrastChange
=
(
value
)
=>
{
setContrastOption
(
value
);
setDatePickerArr
([...
DefaultDatePicker
(
value
)]);
// 模式为日时,默认对比时间根据defaultDate判断 是昨天、上月、还是去年
setDatePickerArr
([...
DefaultDatePicker
(
value
===
'day'
?
defaultDate
:
value
)]);
};
// 同期对比模式: 时间段选择
...
...
@@ -905,6 +907,7 @@ HistoryView.propTypes = {
),
defaultModel: PropTypes.oneOf(['curve', 'table']),
showModels: PropTypes.arrayOf(PropTypes.oneOf(['curve', 'table'])),
defaultDate: PropTypes.string,
};
HistoryView.defaultProps = {
...
...
@@ -915,6 +918,7 @@ HistoryView.defaultProps = {
defaultModel: 'curve',
showModels: ['curve', 'table'],
needMarkLine: true,
defaultDate: 'day',
};
export default HistoryView;
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