|
@@ -60,8 +60,8 @@
|
|
<el-pagination
|
|
<el-pagination
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
:current-page="currentPage"
|
|
:current-page="currentPage"
|
|
- layout="total, prev, pager, next, jumper"
|
|
|
|
- :total="pastTotal"
|
|
|
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
|
+ :total="total"
|
|
:page-size="pageSize"
|
|
:page-size="pageSize"
|
|
>
|
|
>
|
|
</el-pagination>
|
|
</el-pagination>
|
|
@@ -88,6 +88,7 @@ import achiDetail from '@/views/market/detail/achiDetail.vue';
|
|
import busiDetail from '@/views/market/detail/busiDetail.vue';
|
|
import busiDetail from '@/views/market/detail/busiDetail.vue';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
|
|
const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
|
|
|
|
+import _ from 'lodash';
|
|
export default {
|
|
export default {
|
|
name: 'stay',
|
|
name: 'stay',
|
|
props: {},
|
|
props: {},
|
|
@@ -98,11 +99,11 @@ export default {
|
|
},
|
|
},
|
|
data: function() {
|
|
data: function() {
|
|
return {
|
|
return {
|
|
- list: [],
|
|
|
|
- pastTotal: 0,
|
|
|
|
- currentPage: 0,
|
|
|
|
|
|
+ currentPage: 1,
|
|
pageSize: 6,
|
|
pageSize: 6,
|
|
- skip: '',
|
|
|
|
|
|
+ origin: [],
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
// 信息预览
|
|
// 信息预览
|
|
type: '0',
|
|
type: '0',
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
@@ -110,10 +111,12 @@ export default {
|
|
displayBtn: false,
|
|
displayBtn: false,
|
|
// 信息显示
|
|
// 信息显示
|
|
detailInfo: {},
|
|
detailInfo: {},
|
|
|
|
+ // 请求数据
|
|
|
|
+ newDataList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- created() {
|
|
|
|
- this.searchInfo();
|
|
|
|
|
|
+ async created() {
|
|
|
|
+ await this.searchInfo();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
|
|
...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
|
|
@@ -121,12 +124,12 @@ export default {
|
|
async searchInfo({ skip = 0, limit = 6, ...info } = {}) {
|
|
async searchInfo({ skip = 0, limit = 6, ...info } = {}) {
|
|
skip = this.skip;
|
|
skip = this.skip;
|
|
let userid = this.user.uid;
|
|
let userid = this.user.uid;
|
|
- const res = await this.productList({ skip, limit, status: 2, userid, ...info });
|
|
|
|
- const resTwo = await this.productList({ skip, limit, status: 3, userid, ...info });
|
|
|
|
|
|
+ const res = await this.productList({ skip, status: 2, userid, ...info });
|
|
|
|
+ const resTwo = await this.productList({ skip, status: 3, userid, ...info });
|
|
var newData = res.data.concat(resTwo.data);
|
|
var newData = res.data.concat(resTwo.data);
|
|
if (newData.length != 0) {
|
|
if (newData.length != 0) {
|
|
- this.$set(this, `list`, newData);
|
|
|
|
- this.$set(this, `pastTotal`, newData.length);
|
|
|
|
|
|
+ this.$set(this, `newDataList`, newData);
|
|
|
|
+ this.$set(this, `total`, newData.length);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 预览
|
|
// 预览
|
|
@@ -169,9 +172,11 @@ export default {
|
|
this.$message.error('信息删除失败');
|
|
this.$message.error('信息删除失败');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ search(page = 1) {
|
|
|
|
+ this.$set(this, `list`, this.origin[page - 1]);
|
|
|
|
+ },
|
|
handleCurrentChange(currentPage) {
|
|
handleCurrentChange(currentPage) {
|
|
- this.$set(this, `skip`, (currentPage - 1) * this.pageSize);
|
|
|
|
- this.searchInfo();
|
|
|
|
|
|
+ this.search(currentPage);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -180,6 +185,17 @@ export default {
|
|
return `${this.$route.meta.title}`;
|
|
return `${this.$route.meta.title}`;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ newDataList: {
|
|
|
|
+ immediate: true,
|
|
|
|
+ deep: true,
|
|
|
|
+ handler(val) {
|
|
|
|
+ console.log(val);
|
|
|
|
+ if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
metaInfo() {
|
|
metaInfo() {
|
|
return { title: this.$route.meta.title };
|
|
return { title: this.$route.meta.title };
|
|
},
|
|
},
|