Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ant-design-pro
Project
Project
Details
Activity
Releases
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thiago Borges
ant-design-pro
Commits
224e5667
Commit
224e5667
authored
Oct 24, 2017
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
active date selection
parent
60447384
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
Analysis.js
src/routes/Dashboard/Analysis.js
+23
-4
Analysis.less
src/routes/Dashboard/Analysis.less
+3
-0
No files found.
src/routes/Dashboard/Analysis.js
View file @
224e5667
...
@@ -75,6 +75,17 @@ export default class Analysis extends Component {
...
@@ -75,6 +75,17 @@ export default class Analysis extends Component {
});
});
}
}
isActive
(
type
)
{
const
{
rangePickerValue
}
=
this
.
state
;
const
value
=
getTimeDistance
(
type
);
if
(
!
rangePickerValue
[
0
]
||
!
rangePickerValue
[
1
])
{
return
;
}
if
(
rangePickerValue
[
0
].
isSame
(
value
[
0
],
'day'
)
&&
rangePickerValue
[
1
].
isSame
(
value
[
1
],
'day'
))
{
return
styles
.
currentDate
;
}
}
render
()
{
render
()
{
const
{
rangePickerValue
,
salesType
,
currentTabKey
}
=
this
.
state
;
const
{
rangePickerValue
,
salesType
,
currentTabKey
}
=
this
.
state
;
const
{
chart
}
=
this
.
props
;
const
{
chart
}
=
this
.
props
;
...
@@ -104,10 +115,18 @@ export default class Analysis extends Component {
...
@@ -104,10 +115,18 @@ export default class Analysis extends Component {
const
salesExtra
=
(
const
salesExtra
=
(
<
div
className
=
{
styles
.
salesExtraWrap
}
>
<
div
className
=
{
styles
.
salesExtraWrap
}
>
<
div
className
=
{
styles
.
salesExtra
}
>
<
div
className
=
{
styles
.
salesExtra
}
>
<
a
onClick
=
{()
=>
this
.
selectDate
(
'today'
)}
>
今日
<
/a
>
<
a
className
=
{
this
.
isActive
(
'today'
)}
onClick
=
{()
=>
this
.
selectDate
(
'today'
)}
>
<
a
onClick
=
{()
=>
this
.
selectDate
(
'week'
)}
>
本周
<
/a
>
今日
<
a
onClick
=
{()
=>
this
.
selectDate
(
'month'
)}
>
本月
<
/a
>
<
/a
>
<
a
onClick
=
{()
=>
this
.
selectDate
(
'year'
)}
>
全年
<
/a
>
<
a
className
=
{
this
.
isActive
(
'week'
)}
onClick
=
{()
=>
this
.
selectDate
(
'week'
)}
>
本周
<
/a
>
<
a
className
=
{
this
.
isActive
(
'month'
)}
onClick
=
{()
=>
this
.
selectDate
(
'month'
)}
>
本月
<
/a
>
<
a
className
=
{
this
.
isActive
(
'year'
)}
onClick
=
{()
=>
this
.
selectDate
(
'year'
)}
>
全年
<
/a
>
<
/div
>
<
/div
>
<
RangePicker
<
RangePicker
value
=
{
rangePickerValue
}
value
=
{
rangePickerValue
}
...
...
src/routes/Dashboard/Analysis.less
View file @
224e5667
...
@@ -55,6 +55,9 @@
...
@@ -55,6 +55,9 @@
&:hover {
&:hover {
color: @primary-color;
color: @primary-color;
}
}
&.currentDate {
color: @primary-color;
}
}
}
}
}
...
...
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