Commit e5273655 authored by daywrite's avatar daywrite

修复分页

parent ea0e104d
......@@ -27,7 +27,7 @@
</span>
</ScheduleItem>
<Pagenation
:pager.sync="result.pagenation"
@update:pager="pager => {updatePage(pager)}"
:total="result.pagenation.totalcount">
</Pagenation>
<leave-message
......@@ -112,6 +112,13 @@ export default {
}
],
filter: [],
form: {
'ClientSearch[keyword]': ''
},
pagenation: {
thispage: 1,
pagesize: 10
},
result: {
list: [],
pagenation: {
......@@ -143,8 +150,13 @@ export default {
},
updateForm (search) {
let _form = Object.assign({}, this.form, search)
this.getScheduleList(_form)
Object.assign(this.form, search)
this.getScheduleList()
},
updatePage (pager) {
Object.assign(this.pagenation, pager)
this.getScheduleList()
},
getFilter () {
......@@ -185,11 +197,10 @@ export default {
})
},
getScheduleList (form) {
let _page = this.result.pagenation
getScheduleList () {
requestAPI(api.getScheduleList, {
...form,
page: _page.thispage
...this.form,
page: this.pagenation.thispage
}).then((res) => {
const {
list = [],
......
<template>
<section>
<section class="pull-right">
<el-pagination v-if="total > 0" class="mb20 mt20"
background
@size-change="handleSizeChange"
......@@ -7,7 +7,7 @@
:current-page="pager.thispage"
:page-sizes="[10, 20, 40, 60, 80, 100]"
:page-size="pager.pagesize"
layout="total, sizes, prev, pager, next, jumper"
layout="total, prev, pager, next, jumper"
:total="total">
</el-pagination>
</section>
......@@ -26,7 +26,7 @@ export default {
return {
pager: {
thispage: 1,
pagesize: 10,
pagesize: 20,
totalcount: 0
}
}
......@@ -42,13 +42,11 @@ export default {
this.pager.pagesize = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
// this.$parent.loadList()
},
handleCurrentChange (val) {
this.pager.thispage = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
// this.$parent.loadList()
}
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment