|
@@ -24,7 +24,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="list">
|
|
|
<template>
|
|
|
- <el-table :data="recruitInfo" style="width: 100%">
|
|
|
+ <el-table :data="list" style="width: 100%">
|
|
|
<el-table-column prop="name" label="产品名称" align="center"> </el-table-column>
|
|
|
<el-table-column prop="totaltype" label="产品类型 " align="center">
|
|
|
<template v-slot="scoped">
|
|
@@ -73,7 +73,6 @@
|
|
|
</el-table>
|
|
|
<el-col :span="24" class="page">
|
|
|
<el-pagination
|
|
|
- @size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page="currentPage"
|
|
|
layout="total, prev, pager, next, jumper"
|
|
@@ -90,6 +89,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import _ from 'lodash';
|
|
|
import { mapActions, mapState, mapMutations, createNamespacedHelpers } from 'vuex';
|
|
|
export default {
|
|
|
name: 'column',
|
|
@@ -100,14 +100,20 @@ export default {
|
|
|
},
|
|
|
components: {},
|
|
|
data: () => ({
|
|
|
- currentPage: 0,
|
|
|
+ currentPage: 1,
|
|
|
pageSize: 10,
|
|
|
+ origin: [],
|
|
|
+ list: [],
|
|
|
}),
|
|
|
created() {},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|
|
|
methods: {
|
|
|
+ search(page = 1) {
|
|
|
+ console.log(page);
|
|
|
+ this.$set(this, `list`, this.origin[page - 1]);
|
|
|
+ },
|
|
|
submit() {
|
|
|
this.$emit('submit');
|
|
|
},
|
|
@@ -123,12 +129,19 @@ export default {
|
|
|
handleDelete(data) {
|
|
|
this.$emit('handleDelete', data.id);
|
|
|
},
|
|
|
- handleSizeChange(val) {
|
|
|
- console.log(`每页 ${val} 条`);
|
|
|
- },
|
|
|
handleCurrentChange(currentPage) {
|
|
|
- console.log(currentPage);
|
|
|
- this.$emit('handleCurrentChange', { skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
|
|
|
+ this.search(currentPage);
|
|
|
+ // this.$emit('handleCurrentChange', { skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ recruitInfo: {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ handler(val) {
|
|
|
+ if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
},
|
|
|
},
|
|
|
};
|