|
@@ -53,19 +53,20 @@ export default {
|
|
searchModel: { type: String, default: 'title' },
|
|
searchModel: { type: String, default: 'title' },
|
|
title: { type: String },
|
|
title: { type: String },
|
|
total: { type: Number, default: 0 },
|
|
total: { type: Number, default: 0 },
|
|
|
|
+ pageSize: { type: Number, default: 5 },
|
|
usePage: { type: Boolean, default: true },
|
|
usePage: { type: Boolean, default: true },
|
|
},
|
|
},
|
|
components: { tabs, search },
|
|
components: { tabs, search },
|
|
data: function() {
|
|
data: function() {
|
|
return {
|
|
return {
|
|
searchInfo: '',
|
|
searchInfo: '',
|
|
- pageSize: 10,
|
|
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
methods: {
|
|
methods: {
|
|
- search() {
|
|
|
|
|
|
+ search(page = 1) {
|
|
|
|
+ this.currentPage = page;
|
|
const skip = (this.currentPage - 1) * this.pageSize;
|
|
const skip = (this.currentPage - 1) * this.pageSize;
|
|
let condition = { skip, limit: this.pageSize };
|
|
let condition = { skip, limit: this.pageSize };
|
|
if (this.searchInfo && this.searchInfo !== '') condition[this.searchModel] = this.searchInfo;
|
|
if (this.searchInfo && this.searchInfo !== '') condition[this.searchModel] = this.searchInfo;
|