分页整理

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

Loading…
Cancel
Save