mirror of https://github.com/halo-dev/halo
fix: log list pagination error.
parent
606b84fa79
commit
7cbc176dd6
|
@ -272,17 +272,17 @@
|
||||||
:visible="logDrawerVisible"
|
:visible="logDrawerVisible"
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
@close="()=>this.logDrawerVisible = false"
|
@close="()=>this.logDrawerVisible = false"
|
||||||
>
|
|
||||||
<a-skeleton
|
|
||||||
active
|
|
||||||
:loading="logsLoading"
|
|
||||||
:paragraph="{rows: 18}"
|
|
||||||
>
|
>
|
||||||
<a-row
|
<a-row
|
||||||
type="flex"
|
type="flex"
|
||||||
align="middle"
|
align="middle"
|
||||||
>
|
>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
<a-skeleton
|
||||||
|
active
|
||||||
|
:loading="logsLoading"
|
||||||
|
:paragraph="{rows: 18}"
|
||||||
|
>
|
||||||
<a-list :dataSource="formattedLogsDatas">
|
<a-list :dataSource="formattedLogsDatas">
|
||||||
<a-list-item
|
<a-list-item
|
||||||
slot="renderItem"
|
slot="renderItem"
|
||||||
|
@ -294,22 +294,22 @@
|
||||||
</a-list-item-meta>
|
</a-list-item-meta>
|
||||||
<div>{{ item.content }}</div>
|
<div>{{ item.content }}</div>
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
|
</a-list>
|
||||||
|
</a-skeleton>
|
||||||
|
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<a-pagination
|
<a-pagination
|
||||||
class="pagination"
|
class="pagination"
|
||||||
:total="logPagination.total"
|
:total="logPagination.total"
|
||||||
:defaultPageSize="logPagination.size"
|
:defaultPageSize="50"
|
||||||
:pageSizeOptions="['50', '100','150','200']"
|
:pageSizeOptions="['50', '100','150','200']"
|
||||||
showSizeChanger
|
showSizeChanger
|
||||||
@showSizeChange="onPaginationChange"
|
@showSizeChange="onPaginationChange"
|
||||||
@change="onPaginationChange"
|
@change="onPaginationChange"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</a-list>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-skeleton>
|
|
||||||
<a-divider class="divider-transparent" />
|
<a-divider class="divider-transparent" />
|
||||||
<div class="bottom-control">
|
<div class="bottom-control">
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
|
@ -348,7 +348,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// showMoreOptions: false,
|
|
||||||
startVal: 0,
|
startVal: 0,
|
||||||
logType: logApi.logType,
|
logType: logApi.logType,
|
||||||
activityLoading: true,
|
activityLoading: true,
|
||||||
|
@ -366,10 +365,18 @@ export default {
|
||||||
},
|
},
|
||||||
logs: [],
|
logs: [],
|
||||||
logPagination: {
|
logPagination: {
|
||||||
page: 1,
|
current: 1,
|
||||||
size: 50,
|
pageSize: 50,
|
||||||
sort: null
|
sort: null
|
||||||
},
|
},
|
||||||
|
logQueryParam: {
|
||||||
|
page: 0,
|
||||||
|
size: 50,
|
||||||
|
sort: null,
|
||||||
|
keyword: null,
|
||||||
|
categoryId: null,
|
||||||
|
status: null
|
||||||
|
},
|
||||||
interval: null
|
interval: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -468,8 +475,10 @@ export default {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.logsLoading = false
|
this.logsLoading = false
|
||||||
}, 500)
|
}, 500)
|
||||||
this.logPagination.page = this.logPagination.page - 1
|
this.logQueryParam.page = this.logPagination.current - 1
|
||||||
logApi.pageBy(this.logPagination).then(response => {
|
this.logQueryParam.size = this.logPagination.pageSize
|
||||||
|
this.logQueryParam.sort = this.logPagination.sort
|
||||||
|
logApi.pageBy(this.logQueryParam).then(response => {
|
||||||
this.logs = response.data.data.content
|
this.logs = response.data.data.content
|
||||||
this.logPagination.total = response.data.data.total
|
this.logPagination.total = response.data.data.total
|
||||||
})
|
})
|
||||||
|
@ -488,8 +497,8 @@ export default {
|
||||||
},
|
},
|
||||||
onPaginationChange(page, pageSize) {
|
onPaginationChange(page, pageSize) {
|
||||||
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
|
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
|
||||||
this.logPagination.page = page
|
this.logPagination.current = page
|
||||||
this.logPagination.size = pageSize
|
this.logPagination.pageSize = pageSize
|
||||||
this.loadLogs()
|
this.loadLogs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue