Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Chatopera OpenSource
/
ferry_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
888b6bfc
authored
Mar 14, 2021
by
Mr. Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加日期选择筛选。
parent
bda74861
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
2 deletions
src/views/dashboard/admin/index.vue
src/views/dashboard/admin/index.vue
View file @
888b6bfc
...
...
@@ -31,6 +31,20 @@
</el-col>
</el-row>
<el-card
:bordered=
"false"
:body-style=
"
{padding: '5'}" :style="{ marginBottom: '12px', textAlign: 'center' }">
<el-date-picker
v-model=
"querys"
type=
"daterange"
align=
"right"
unlink-panels
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:picker-options=
"pickerOptions"
@
change=
"timeScreening"
/>
</el-card>
<el-card
:bordered=
"false"
:body-style=
"
{padding: '0'}" :style="{ marginBottom: '12px' }">
<div
class=
"salesCard"
>
<div>
...
...
@@ -90,7 +104,36 @@ export default {
count
:
{}
},
rankList
:
[],
submitData
:
[]
submitData
:
[],
querys
:
''
,
queryList
:
{},
pickerOptions
:
{
shortcuts
:
[{
text
:
'最近一周'
,
onClick
(
picker
)
{
const
end
=
new
Date
()
const
start
=
new
Date
()
start
.
setTime
(
start
.
getTime
()
-
3600
*
1000
*
24
*
7
)
picker
.
$emit
(
'pick'
,
[
start
,
end
])
}
},
{
text
:
'最近一个月'
,
onClick
(
picker
)
{
const
end
=
new
Date
()
const
start
=
new
Date
()
start
.
setTime
(
start
.
getTime
()
-
3600
*
1000
*
24
*
30
)
picker
.
$emit
(
'pick'
,
[
start
,
end
])
}
},
{
text
:
'最近三个月'
,
onClick
(
picker
)
{
const
end
=
new
Date
()
const
start
=
new
Date
()
start
.
setTime
(
start
.
getTime
()
-
3600
*
1000
*
24
*
90
)
picker
.
$emit
(
'pick'
,
[
start
,
end
])
}
}]
}
}
},
created
()
{
...
...
@@ -98,9 +141,17 @@ export default {
},
methods
:
{
getInitData
()
{
initData
().
then
(
response
=>
{
initData
(
this
.
queryList
).
then
(
response
=>
{
this
.
dashboardValue
=
response
.
data
})
},
timeScreening
()
{
console
.
log
(
this
.
querys
)
if
(
this
.
querys
.
length
>
1
)
{
this
.
queryList
.
start_time
=
this
.
querys
[
0
]
this
.
queryList
.
end_time
=
this
.
querys
[
1
]
this
.
getInitData
()
}
}
}
}
...
...
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