Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
admin
Overview
Overview
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
baihong
admin
Commits
39e070bb
Commit
39e070bb
authored
Apr 26, 2021
by
baihong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出早起活动
parent
2eaafe08
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
8 deletions
+43
-8
activityClocks.js
src/api/clock/activityClocks.js
+3
-0
http.js
src/libs/http.js
+15
-0
clockInList.vue
src/view/clockEarly/clockInList.vue
+25
-8
No files found.
src/api/clock/activityClocks.js
View file @
39e070bb
...
...
@@ -5,6 +5,9 @@ export const activityClocks = (data) => {
export
const
getActivityConfigByPay
=
(
data
)
=>
{
return
$http
.
get
(
'/cms/configs/getActivityConfigByPay'
,
data
)
}
export
const
exportList
=
(
data
)
=>
{
return
$http
.
getExport
(
'/cms/activityClocks/exportList'
,
data
)
}
//奖励列表
export
const
configAwards
=
(
data
)
=>
{
return
$http
.
get
(
'/cms/configs/configAwards?type='
+
data
)
...
...
src/libs/http.js
View file @
39e070bb
...
...
@@ -144,6 +144,21 @@ const _HttpService = {
config
=
Object
.
assign
({},
_selfConfig
,
config
);
return
_http
.
get
(
url
,
config
);
},
getExport
:
(
url
,
data
,
config
)
=>
{
const
_selfConfig
=
{
headers
:
{
language
:
"cn"
,
"Content-Type"
:
"application/x-download"
,
"X-Access-Token"
:
sessionStorage
.
getItem
(
"token"
)
||
"1b8cc15a59947ce27dd62b"
},
responseType
:
'blob'
,
params
:
data
,
setLoading
:
true
};
config
=
Object
.
assign
({},
_selfConfig
,
config
);
return
_http
.
get
(
url
,
config
);
},
delete
:
(
url
,
data
,
config
)
=>
{
const
_selfConfig
=
{
headers
:
{
...
...
src/view/clockEarly/clockInList.vue
View file @
39e070bb
...
...
@@ -21,7 +21,7 @@
<Button
type=
"primary"
ghost
>
重 置
</Button>
</div>
<div
class=
"right"
>
<Button
type=
"primary"
>
导 出
</Button>
<Button
type=
"primary"
@
click=
"exportlist"
>
导 出
</Button>
</div>
</div>
<Table
...
...
@@ -35,7 +35,9 @@
<span>
{{
row
.
activity_date
|
format
}}
</span>
</
template
>
<
template
slot-scope=
"{ row }"
slot=
"status"
>
<span>
{{
row
.
status
===
0
?
'未开始'
:
row
.
status
===
1
?
'进行中'
:
'已结束'
}}
</span>
<span>
{{
row
.
status
===
0
?
"未开始"
:
row
.
status
===
1
?
"进行中"
:
"已结束"
}}
</span>
</
template
>
<
template
slot-scope=
"{ row }"
slot=
"created_at"
>
<span>
{{
row
.
created_at
|
format
}}
</span>
...
...
@@ -53,17 +55,17 @@
</template>
<
script
>
import
{
activityClocks
}
from
"@/api/clock/activityClocks"
;
import
{
formatDate
}
from
'@/libs/util'
import
{
activityClocks
,
exportList
}
from
"@/api/clock/activityClocks"
;
import
{
formatDate
}
from
"@/libs/util"
;
import
Pager
from
"@/view/common/Pager.vue"
;
export
default
{
name
:
"categories"
,
components
:
{
Pager
},
filters
:
{
format
(
value
)
{
return
formatDate
(
value
)
filters
:
{
format
(
value
)
{
return
formatDate
(
value
)
;
}
},
data
()
{
...
...
@@ -117,7 +119,22 @@ export default {
};
activityClocks
(
params
).
then
(
res
=>
{
this
.
config
.
total
=
res
.
total
;
this
.
data
=
res
.
data
this
.
data
=
res
.
data
;
});
},
exportlist
()
{
exportList
().
then
(
res
=>
{
if
(
res
)
{
const
xlsx
=
"application/vnd.ms-excel"
;
const
blob
=
new
Blob
([
res
],
{
type
:
xlsx
});
const
a
=
document
.
createElement
(
"a"
);
// 转换完成,创建一个a标签用于下载
a
.
download
=
"早起活动.xls"
;
a
.
href
=
window
.
URL
.
createObjectURL
(
blob
);
a
.
click
();
a
.
remove
();
}
else
{
this
.
$message
.
error
(
"导出失败"
);
}
});
},
handlePager
(
pager
)
{
...
...
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