|
@@ -55,11 +55,13 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="pag">
|
|
<el-col :span="24" class="pag">
|
|
<el-pagination
|
|
<el-pagination
|
|
|
|
+ background
|
|
|
|
+ @size-change="handleCurrentChange"
|
|
@current-change="currentChange"
|
|
@current-change="currentChange"
|
|
:current-page.sync="skip"
|
|
:current-page.sync="skip"
|
|
|
|
+ :page-sizes="[10, 50, 100, 150, 200]"
|
|
:page-size="limit"
|
|
:page-size="limit"
|
|
- background
|
|
|
|
- layout="total, prev, pager, next"
|
|
|
|
|
|
+ layout="sizes,total, prev, pager, next"
|
|
:total="total"
|
|
:total="total"
|
|
>
|
|
>
|
|
</el-pagination>
|
|
</el-pagination>
|
|
@@ -86,7 +88,7 @@ export default {
|
|
goods: {},
|
|
goods: {},
|
|
skip: 1,
|
|
skip: 1,
|
|
total: 0,
|
|
total: 0,
|
|
- limit: 5,
|
|
|
|
|
|
+ limit: 50,
|
|
// 评分颜色
|
|
// 评分颜色
|
|
colors: ['#99A9BF', '#F7BA2A', '#FF0000'],
|
|
colors: ['#99A9BF', '#F7BA2A', '#FF0000'],
|
|
};
|
|
};
|
|
@@ -97,7 +99,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
// 查询
|
|
// 查询
|
|
- async search({ skip = 0, limit = 5, ...info } = {}) {
|
|
|
|
|
|
+ async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
info.goods = this.id;
|
|
info.goods = this.id;
|
|
let res;
|
|
let res;
|
|
res = await this.query({ skip, limit, ...info });
|
|
res = await this.query({ skip, limit, ...info });
|
|
@@ -121,6 +123,10 @@ export default {
|
|
currentChange(val) {
|
|
currentChange(val) {
|
|
this.search({ skip: (val - 1) * this.limit });
|
|
this.search({ skip: (val - 1) * this.limit });
|
|
},
|
|
},
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
+ this.$set(this, 'limit', val);
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
async toSend(item, data) {
|
|
async toSend(item, data) {
|
|
let res;
|
|
let res;
|
|
if (data.id) res = await this.update(data);
|
|
if (data.id) res = await this.update(data);
|