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
19c7264d
Commit
19c7264d
authored
Aug 24, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化历史曲线
parent
9a26edf0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+3
-3
index.js
packages/extend-components/EC_HistoryView/src/index.js
+19
-15
No files found.
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
19c7264d
...
...
@@ -47,10 +47,10 @@ const deviceParams = [
"deviceCode"
:
"LLJ00000001"
,
"sensors"
:
"出水累计流量"
,
"deviceType"
:
"流量计"
}
/*
{
}
,
/*
{
"deviceCode": "JFJ00000001",
"sensors": "沉淀池投矾量瞬时,
是否在线
",
"sensors": "沉淀池投矾量瞬时,",
"deviceType": "加矾间"
}*/
];
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
19c7264d
...
...
@@ -64,8 +64,8 @@ const shortcutsForDay = [
value
:
'近3天'
},
{
label
:
'近
5
天'
,
value
:
'近
5
天'
label
:
'近
7
天'
,
value
:
'近
7
天'
},
/* {
label: '去年同期',
...
...
@@ -79,8 +79,8 @@ const shortcutsForMonth = [
value
:
'近3月'
},
{
label
:
'近
5
月'
,
value
:
'近
5
月'
label
:
'近
6
月'
,
value
:
'近
6
月'
},
/* {
label: '去年同期',
...
...
@@ -442,7 +442,7 @@ const HistoryView = (props) => {
{
key
:
3
,
value
:
moment
().
subtract
(
2
,
'days'
)},
]
break
;
case
'近
5
天'
:
case
'近
7
天'
:
_arr
=
[
{
key
:
1
,
value
:
moment
()},
{
key
:
2
,
value
:
moment
().
subtract
(
1
,
'days'
)},
...
...
@@ -450,6 +450,7 @@ const HistoryView = (props) => {
{
key
:
4
,
value
:
moment
().
subtract
(
3
,
'days'
)},
{
key
:
5
,
value
:
moment
().
subtract
(
4
,
'days'
)},
{
key
:
6
,
value
:
moment
().
subtract
(
5
,
'days'
)},
{
key
:
7
,
value
:
moment
().
subtract
(
6
,
'days'
)},
]
break
;
case
'近3月'
:
...
...
@@ -459,7 +460,7 @@ const HistoryView = (props) => {
{
key
:
3
,
value
:
moment
().
subtract
(
2
,
'months'
)},
]
break
;
case
'近
5
月'
:
case
'近
6
月'
:
_arr
=
[
{
key
:
1
,
value
:
moment
()},
{
key
:
2
,
value
:
moment
().
subtract
(
1
,
'months'
)},
...
...
@@ -502,15 +503,18 @@ const HistoryView = (props) => {
<
Option
value
=
"month"
>
月
<
/Option
>
<
/Select
>
{
/*增加快捷日期*/
}
<
Radio
.
Group
value
=
{
shortcutsValue
}
onChange
=
{
onShortcutsChange
}
>
{
(
contrastOption
===
'day'
?
shortcutsForDay
:
shortcutsForMonth
).
map
(
item
=>
{
return
<
Radio
.
Button
value
=
{
item
.
value
}
>
{
item
.
label
}
<
/Radio.Button
>
})
}
<
/Radio.Group
>
{
deviceParams
?.
length
===
1
&&
deviceParams
?.[
0
]?.
sensors
?.
split
(
','
).
length
===
1
?
<
Radio
.
Group
value
=
{
shortcutsValue
}
onChange
=
{
onShortcutsChange
}
>
{
(
contrastOption
===
'day'
?
shortcutsForDay
:
shortcutsForMonth
).
map
(
item
=>
{
return
<
Radio
.
Button
value
=
{
item
.
value
}
>
{
item
.
label
}
<
/Radio.Button
>
})
}
<
/Radio.Group> : '
'
}
{
datePickerArr
.
map
((
child
,
index
)
=>
(
<
div
key
=
{
child
.
key
}
className
=
{
classNames
(
`
${
prefixCls
}
-contrast-list`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-contrast-wrap`
)}
>
...
...
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