-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
黄冠
committed
Jun 24, 2019
1 parent
5600199
commit 95ec92c
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<template> | ||
<div> | ||
<el-page-header @back="goBack" title="" content="Today Logs Rank"> | ||
</el-page-header> | ||
<el-table | ||
|
||
:data="tableData" | ||
style="width: 100%"> | ||
<el-table-column | ||
label="Name" | ||
width="500"> | ||
<template slot-scope="scope"> | ||
<a :href="'/h/' + scope.row.info.id">{{ scope.row.info.name }}</a> | ||
</template> | ||
</el-table-column> | ||
<el-table-column | ||
prop="reqs" | ||
label="Requests" | ||
width="90"> | ||
</el-table-column> | ||
<el-table-column | ||
label="Last Log Time"> | ||
<template slot-scope="scope"> | ||
{{ scope.row.atime | datetime }} | ||
</template> | ||
</el-table-column> | ||
</el-table> | ||
<div> | ||
<el-pagination | ||
background | ||
layout="prev, pager, next" | ||
@current-change="handleChangePage" | ||
:current-page="currentPage" | ||
:page-size="20" | ||
:pager-count="11" | ||
:total="2000"> | ||
</el-pagination> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
|
||
<script type="text/javascript"> | ||
export default { | ||
layout: 'search', | ||
async asyncData({$axios, error, query}) { | ||
const page = parseInt(query.p || 1) | ||
const params = { | ||
start: (page - 1) * 10, | ||
count: 20 | ||
} | ||
const res = await $axios.$get('/apis/log', {params: params}) | ||
return {tableData: res.items, currentPage: page} | ||
}, | ||
methods: { | ||
handleChangePage(val) { | ||
window.location = '/log?p=' + val | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style type="text/css" scoped> | ||
.el-pagination { | ||
margin: 30px 0 10px 0; | ||
} | ||
.el-page-header { | ||
margin: 0 0 10px 0; | ||
} | ||
</style> | ||
|