perf: 列表记录默认显示条数

This commit is contained in:
“huailei000”
2023-02-15 18:44:33 +08:00
committed by huailei
parent c3e865b407
commit 1f95761d38

View File

@@ -70,6 +70,7 @@ export default {
}, },
pageCount: 5, pageCount: 5,
paginationLayout: 'total, sizes, prev, pager, next', paginationLayout: 'total, sizes, prev, pager, next',
paginationSize: JSON.parse(localStorage.getItem('paginationSize')) || 15,
paginationSizes: [15, 30, 50, 100], paginationSizes: [15, 30, 50, 100],
paginationBackground: true, paginationBackground: true,
transformQuery: query => { transformQuery: query => {
@@ -107,7 +108,6 @@ export default {
}, },
tableConfig() { tableConfig() {
const tableDefaultConfig = this.defaultConfig const tableDefaultConfig = this.defaultConfig
tableDefaultConfig.paginationSize = 15
let tableAttrs = tableDefaultConfig.tableAttrs let tableAttrs = tableDefaultConfig.tableAttrs
if (this.config.tableAttrs) { if (this.config.tableAttrs) {
tableAttrs = Object.assign(tableAttrs, this.config.tableAttrs) tableAttrs = Object.assign(tableAttrs, this.config.tableAttrs)
@@ -155,6 +155,7 @@ export default {
} }
}, },
handleSizeChange(val) { handleSizeChange(val) {
localStorage.setItem('paginationSize', val)
this.$store.commit('table/SET_TABLE_CONFIG', this.$store.commit('table/SET_TABLE_CONFIG',
{ {
key: 'paginationSize', key: 'paginationSize',