分页整理

feature/0423
fanfan 11 months ago
parent c10680b719
commit 0feea13468
  1. 25
      src/views/order/Index.vue

@ -215,8 +215,15 @@
<div v-if="orderList.data.length" class="pagination"> <div v-if="orderList.data.length" class="pagination">
<a-pagination <a-pagination
:current="page" :current="page"
:pageSize="orderList.per_page" :default-page-size="pageSizes"
:pageSizes="pageSizes"
:total="orderList.total" :total="orderList.total"
:showSizeChanger='true'
:showQuickJumper='true'
:pageSizeOptions='pageSizeOptions'
:layout="'total, sizes, prev, pager, next, jumper'"
:showTotal="showTotal"
@showSizeChange="handleSizeChange"
@change="onChangePage" @change="onChangePage"
/> />
</div> </div>
@ -326,8 +333,11 @@ export default {
columns, columns,
// //
page: 1, page: 1,
pageSizes:15,
// //
orderList: { data: [], total: 0, per_page: 10 }, orderList: { data: [], total: 0},
pageSizeOptions:['15', '30', '50'],
showTotal: (total) => `${total} 条记录`, //
// //
shopList: [] shopList: []
} }
@ -383,7 +393,7 @@ export default {
getList () { getList () {
const { dataType, queryParam, page } = this const { dataType, queryParam, page } = this
this.isLoading = true this.isLoading = true
return Api.list({ dataType, ...queryParam, page }) return Api.list({ dataType, ...queryParam, page,pageSize:this.pageSizes })
.then(response => { .then(response => {
this.orderList = response.data.list this.orderList = response.data.list
}) })
@ -428,11 +438,16 @@ export default {
}, },
// //
onChangePage (current) { onChangePage (current, size) {
this.page = current this.page = current
this.pageSizes = size
this.handleRefresh()
},
handleSizeChange(current, size){
this.page = current
this.pageSizes = size
this.handleRefresh() this.handleRefresh()
}, },
// //
handleDelete (item) { handleDelete (item) {
const app = this const app = this

Loading…
Cancel
Save