修复设备点检日志分页翻页
This commit is contained in:
@@ -36,14 +36,25 @@
|
||||
:loading="loading"
|
||||
:toolbar-buttons="[]"
|
||||
:row-buttons="[]"
|
||||
:pagination="pagination"
|
||||
auto-height
|
||||
@page-change="onPageChange"
|
||||
:pagination="null"
|
||||
>
|
||||
<template #col-result="{ row }">
|
||||
<el-tag :type="row.result === 'OK' ? 'success' : 'danger'" size="mini">{{ row.result }}</el-tag>
|
||||
</template>
|
||||
</page-table>
|
||||
|
||||
<div class="logs-pagination">
|
||||
<el-pagination
|
||||
:current-page="pagination.current"
|
||||
:page-size="pagination.size"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 25, 50, 100, 250, 500]"
|
||||
:disabled="loading"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="onSizeChange"
|
||||
@current-change="onCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</d2-container>
|
||||
</template>
|
||||
|
||||
@@ -128,9 +139,7 @@ export default {
|
||||
const res = await getDetailsList({
|
||||
...this.buildSearchParams(),
|
||||
page_no: pageNo,
|
||||
page_size: pageSize,
|
||||
page: pageNo,
|
||||
size: pageSize
|
||||
page_size: pageSize
|
||||
})
|
||||
const page = readPageData(res)
|
||||
this.tableData = page.list
|
||||
@@ -148,9 +157,13 @@ export default {
|
||||
this.pagination.current = 1
|
||||
this.fetchData()
|
||||
},
|
||||
onPageChange (page) {
|
||||
this.pagination.current = Number(page.current || page.currentPage || 1)
|
||||
this.pagination.size = Number(page.size || page.pageSize || this.pagination.size || 10)
|
||||
onSizeChange (size) {
|
||||
this.pagination.current = 1
|
||||
this.pagination.size = Number(size) || 10
|
||||
this.fetchData()
|
||||
},
|
||||
onCurrentChange (current) {
|
||||
this.pagination.current = Number(current) || 1
|
||||
this.fetchData()
|
||||
},
|
||||
async handleExport () {
|
||||
@@ -168,6 +181,11 @@ export default {
|
||||
.search-bar {
|
||||
padding: 10px 0;
|
||||
}
|
||||
.logs-pagination {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-top: 12px;
|
||||
}
|
||||
/deep/ .el-form-item--mini.el-form-item {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user