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