Commit e5273655 authored by daywrite's avatar daywrite

修复分页

parent ea0e104d
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</span> </span>
</ScheduleItem> </ScheduleItem>
<Pagenation <Pagenation
:pager.sync="result.pagenation" @update:pager="pager => {updatePage(pager)}"
:total="result.pagenation.totalcount"> :total="result.pagenation.totalcount">
</Pagenation> </Pagenation>
<leave-message <leave-message
...@@ -112,6 +112,13 @@ export default { ...@@ -112,6 +112,13 @@ export default {
} }
], ],
filter: [], filter: [],
form: {
'ClientSearch[keyword]': ''
},
pagenation: {
thispage: 1,
pagesize: 10
},
result: { result: {
list: [], list: [],
pagenation: { pagenation: {
...@@ -143,8 +150,13 @@ export default { ...@@ -143,8 +150,13 @@ export default {
}, },
updateForm (search) { updateForm (search) {
let _form = Object.assign({}, this.form, search) Object.assign(this.form, search)
this.getScheduleList(_form) this.getScheduleList()
},
updatePage (pager) {
Object.assign(this.pagenation, pager)
this.getScheduleList()
}, },
getFilter () { getFilter () {
...@@ -185,11 +197,10 @@ export default { ...@@ -185,11 +197,10 @@ export default {
}) })
}, },
getScheduleList (form) { getScheduleList () {
let _page = this.result.pagenation
requestAPI(api.getScheduleList, { requestAPI(api.getScheduleList, {
...form, ...this.form,
page: _page.thispage page: this.pagenation.thispage
}).then((res) => { }).then((res) => {
const { const {
list = [], list = [],
......
<template> <template>
<section> <section class="pull-right">
<el-pagination v-if="total > 0" class="mb20 mt20" <el-pagination v-if="total > 0" class="mb20 mt20"
background background
@size-change="handleSizeChange" @size-change="handleSizeChange"
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:current-page="pager.thispage" :current-page="pager.thispage"
:page-sizes="[10, 20, 40, 60, 80, 100]" :page-sizes="[10, 20, 40, 60, 80, 100]"
:page-size="pager.pagesize" :page-size="pager.pagesize"
layout="total, sizes, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
:total="total"> :total="total">
</el-pagination> </el-pagination>
</section> </section>
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
return { return {
pager: { pager: {
thispage: 1, thispage: 1,
pagesize: 10, pagesize: 20,
totalcount: 0 totalcount: 0
} }
} }
...@@ -42,13 +42,11 @@ export default { ...@@ -42,13 +42,11 @@ export default {
this.pager.pagesize = val this.pager.pagesize = val
this.pager.totalcount = this.total this.pager.totalcount = this.total
this.$emit('update:pager', this.pager) this.$emit('update:pager', this.pager)
// this.$parent.loadList()
}, },
handleCurrentChange (val) { handleCurrentChange (val) {
this.pager.thispage = val this.pager.thispage = val
this.pager.totalcount = this.total this.pager.totalcount = this.total
this.$emit('update:pager', this.pager) 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