|
@@ -108,6 +108,12 @@
|
|
|
<el-button type="primary" @click="handOk">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="getCategoryDataLength"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -133,18 +139,21 @@ export default {
|
|
|
sort: [
|
|
|
{ required: true, message: '请输入排序', trigger: 'blur' }
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ page: 1
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.$store.dispatch('categoryList/getBlockList', {
|
|
|
- blockType: ''
|
|
|
+ blockType: '',
|
|
|
+ page: this.page
|
|
|
})
|
|
|
},
|
|
|
// eslint-disable-next-line vue/order-in-components
|
|
|
computed: {
|
|
|
...mapGetters([
|
|
|
- 'getCategoryData'
|
|
|
+ 'getCategoryData',
|
|
|
+ 'getCategoryDataLength'
|
|
|
])
|
|
|
},
|
|
|
methods: {
|
|
@@ -190,7 +199,8 @@ export default {
|
|
|
this.$store.dispatch('categoryList/setBlockList', this.form).then(() => {
|
|
|
this.dialogFormVisible = false
|
|
|
this.$store.dispatch('categoryList/getBlockList', {
|
|
|
- blockType: ''
|
|
|
+ blockType: '',
|
|
|
+ page: this.page
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -200,14 +210,16 @@ export default {
|
|
|
this.$store.dispatch('categoryList/setBlockList', this.form).then(() => {
|
|
|
this.dialogFormVisible = false
|
|
|
this.$store.dispatch('categoryList/getBlockList', {
|
|
|
- blockType: ''
|
|
|
+ blockType: '',
|
|
|
+ page: this.page
|
|
|
})
|
|
|
})
|
|
|
} else if (this.form.code !== '' && this.form.title !== '' && this.form.status !== '' && this.form.courseType !== '' && this.form.sort !== '') {
|
|
|
this.$store.dispatch('categoryList/addBlockList', this.form).then(() => {
|
|
|
this.dialogFormVisible = false
|
|
|
this.$store.dispatch('categoryList/getBlockList', {
|
|
|
- blockType: ''
|
|
|
+ blockType: '',
|
|
|
+ page: this.page
|
|
|
})
|
|
|
})
|
|
|
}
|
|
@@ -223,6 +235,14 @@ export default {
|
|
|
sort: ''
|
|
|
}
|
|
|
},
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ console.log(val)
|
|
|
+ this.page = val
|
|
|
+ this.$store.dispatch('categoryList/getBlockList', {
|
|
|
+ blockType: '',
|
|
|
+ page: this.page
|
|
|
+ })
|
|
|
+ },
|
|
|
setForm(data) {
|
|
|
this.form.id = data.id
|
|
|
this.form.courseType = data.courseType
|
|
@@ -251,4 +271,8 @@ export default {
|
|
|
.el-select>.el-input {
|
|
|
width: 300px;
|
|
|
}
|
|
|
+ .el-pagination {
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
</style>
|