diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index 790beaa..db9bd0e 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -4,52 +4,22 @@ - - - - - + - - + @@ -113,7 +83,6 @@ export default { }, }, activated() { - console.log("list view with ehad activated..........", this.triggerUpdate); this.refreshLayoutKey = this.layoutTable(); }, watch: { @@ -121,7 +90,7 @@ export default { if (val && val !== oldVal) { // get list this.page = 1; - this.size = 20; + this.size = 'defaultPageSize' in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20; this.getList(); } }, @@ -145,6 +114,10 @@ export default { }, inject: ["urls"], mounted() { + // 更新页面默认 size + const size = 'defaultPageSize' in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20; + this.size = size; + this.initDataWhenLoad && this.getList(); }, methods: { @@ -155,9 +128,9 @@ export default { const params = queryParams ? { ...queryParams, page: this.page, limit: this.size } : { - page: this.page, - limit: this.size, - }; + page: this.page, + limit: this.size, + }; if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) { this.listQueryExtra.map((nameOrObj) => { @@ -174,11 +147,11 @@ export default { this.urls.page, this.urls.pageIsPostApi ? { - ...params, - } + ...params, + } : { - params, - } + params, + } ) .then(({ data: res }) => { console.log("[http response] res is: ", res); @@ -263,7 +236,7 @@ export default { this.$message.success("删除成功!"); this.page = 1; - this.size = 10; + this.size = 'defaultPageSize' in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20; this.getList(); } else { this.$message({ @@ -274,7 +247,7 @@ export default { } }); }) - .catch((err) => {}); + .catch((err) => { }); } case "edit": { this.openDialog(data); /** data is ==> id */ diff --git a/src/views/modules/pms/car/config.js b/src/views/modules/pms/car/config.js index 1a60a06..4e89056 100644 --- a/src/views/modules/pms/car/config.js +++ b/src/views/modules/pms/car/config.js @@ -6,7 +6,7 @@ import { timeFilter } from '@/utils/filters' export default function () { const tableProps = [ - { type: 'index', label: '序号' }, + // { type: 'index', label: '序号' }, { prop: "code", label: "窑车号" }, { prop: "createTime", label: "添加时间", filter: timeFilter }, // { prop: "code", label: "编码" }, diff --git a/src/views/modules/pms/carHistory/components/ListViewWithHead.vue b/src/views/modules/pms/carHistory/components/ListViewWithHead.vue index c352664..b75448d 100644 --- a/src/views/modules/pms/carHistory/components/ListViewWithHead.vue +++ b/src/views/modules/pms/carHistory/components/ListViewWithHead.vue @@ -20,7 +20,7 @@ @size-change="handleSizeChange" @current-change="handlePageChange" :current-page.sync="page" - :page-sizes="[1, 5, 10, 20, 50, 100]" + :page-sizes="[20, 50, 100]" :page-size="size" :total="totalPage" layout="total, sizes, prev, pager, next, jumper" @@ -118,7 +118,7 @@ export default { if (val && val !== oldVal) { // get list this.page = 1; - this.size = 20; + this.size = 100; this.getList(); } }, @@ -133,7 +133,7 @@ export default { topBtnConfig: null, totalPage: 100, page: 1, - size: 20, // 默认20 + size: 100, // 默认20 dataList: [], tableLoading: false, refreshLayoutKey: null, @@ -262,7 +262,7 @@ export default { this.$message.success("删除成功!"); this.page = 1; - this.size = 10; + this.size = 100; this.getList(); } else { this.$message({ diff --git a/src/views/modules/pms/carHistory/config.js b/src/views/modules/pms/carHistory/config.js index cbc6da4..1d80633 100644 --- a/src/views/modules/pms/carHistory/config.js +++ b/src/views/modules/pms/carHistory/config.js @@ -5,7 +5,7 @@ import { timeFilter } from '@/utils/filters' export default function () { const tableProps = [ - { type: 'index', label: '序号' }, + // { type: 'index', label: '序号' }, // { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "code", label: "窑车号" }, { prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, diff --git a/src/views/modules/pms/currentCarLocation/config.js b/src/views/modules/pms/currentCarLocation/config.js index e67004a..2978197 100644 --- a/src/views/modules/pms/currentCarLocation/config.js +++ b/src/views/modules/pms/currentCarLocation/config.js @@ -6,7 +6,7 @@ import StateSelect from '@/components/StateSelect.vue'; export default function () { const tableProps = [ - { type: "index", label: "序号" }, + // { type: "index", label: "序号" }, // { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "code", label: "窑车号" }, { prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, @@ -29,6 +29,8 @@ export default function () { ], }, ]; + // 设置页面默认的 page size 为 100 条数据 + tableProps.defaultPageSize = 100; const headFormFields = [ { diff --git a/src/views/modules/pms/material/components/ListViewWithHead.vue b/src/views/modules/pms/material/components/ListViewWithHead.vue index 6ed361f..c3f187a 100644 --- a/src/views/modules/pms/material/components/ListViewWithHead.vue +++ b/src/views/modules/pms/material/components/ListViewWithHead.vue @@ -5,7 +5,7 @@ **/ -->