[HTML] 纯文本查看 复制代码
<table class="table table-page">
<thead>
<tr>
<td align="center">
用户名
</td>
<td align="center">
登录时间
</td>
<td align="center">
登录IP
</td>
<td align="center">
useragent
</td>
</tr>
</thead>
<tbody>
<tr v-for="info in userlogs">
<td align="center">
{{ info.User_name}}
</td>
<td align="center">
{{ info.StrUser_createdate}}
</td>
<td align="center">
{{ info.User_ip}}
</td>
<td align="center">
{{ info.User_useragent}}
</td>
</tr>
</tbody>
[HTML] 纯文本查看 复制代码
<tfoot>
<tr>
<td colspan="11">
<div class="pagination-wrap">
<div class="count">
<div >总页数 {{ pageCount}} 总记录数 {{ totalcount}} </div>
</div>
<ul class="pagination" v-if="pageCount > 1">
<li v-for="n in pageCount"><a href="javascripit:void(0)" v-bind:class="pageIndex === n + 1 ? 'active' : ''">
{{ n + 1 }}</a> </li>
</ul>
</div>
</td>
</tr>
</tfoot>
[JavaScript] 纯文本查看 复制代码
<script type="text/javascript">
var rw = new Vue({
el: "#grid",
data: {
pageIndex: 1, //当前页
pageCount: 0, //一共多少页
totalcount: 0, //总行数
pageSize: 10, //显示多少页
username: "", //用户名
userlogs: "" //用户列表集合
},
methods: {
getdata: function (event) {
axios({
method: 'get',
url: "/System/Crm_User_logs.aspx?action=getpagelist&username=" + this.username + "&pageIndex=" + this.pageIndex
}).then(function (res) {
var data = res.data;
if (data.reCode > 0) {
rw.$data.pageCount = Math.floor(data.TotalCount / data.pageSize);
rw.$data.totalcount = data.TotalCount;
rw.$data.username = data.username;
rw.$data.pageSize = data.pageSize;
rw.$data.pageIndex = data.pageIndex;
rw.$data.userlogs = data.info;
}
});
}
}
});
</script>