提交 ed1a9514 authored 作者: matian's avatar matian

Auto stash before merge of "master" and "origin/master"

上级 17f6d10c
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
:titles="['备选栏', '已选栏']" :titles="['备选栏', '已选栏']"
> >
</el-transfer> </el-transfer>
<el-pagination
:current-page.sync="page"
layout="total, prev, pager, next"
:total="total"
:page-size="limit"
@current-change="handleCurrentChange"
></el-pagination>
<el-card style="margin-top: 30px"> <el-card style="margin-top: 30px">
<ul style="margin-top: 20px"> <ul style="margin-top: 20px">
<li class="paper_desc">考生的试卷会从以上已选的试卷中随机抽取</li> <li class="paper_desc">考生的试卷会从以上已选的试卷中随机抽取</li>
...@@ -31,7 +38,11 @@ import { getExamPaperList, updateExam, getExamPaperDetail } from '../api' ...@@ -31,7 +38,11 @@ import { getExamPaperList, updateExam, getExamPaperDetail } from '../api'
export default { export default {
data() { data() {
return { return {
perPage: 20, total: 0,
page: 1,
limit: 30,
// perPage: 20,
row: {}, row: {},
ExamParerList: [], ExamParerList: [],
q: [], q: [],
...@@ -49,20 +60,26 @@ export default { ...@@ -49,20 +60,26 @@ export default {
}, },
methods: { methods: {
handleCurrentChange(val) {
// console.log(val)
this.page = val
this.getExamParerList()
},
// 获取试卷列表 // 获取试卷列表
getExamParerList() { getExamParerList() {
const params = { q: '' } const params = { q: '', page: this.page, 'per-page': this.limit }
params['per-page'] = this.perPage // params['per-page'] = this.perPage
this.ExamParerList = [] // this.ExamParerList = []
getExamPaperList(params).then(res => { getExamPaperList(params).then(res => {
this.total = res.data.total
this.ExamParerList = res.data.list.reduce((a, b) => { this.ExamParerList = res.data.list.reduce((a, b) => {
this.ExamParerList.push({ label: b.paper_title, key: b.id }) this.ExamParerList.push({ label: b.paper_title, key: b.id })
return this.ExamParerList return this.ExamParerList
}, []) }, [])
this.perPage = res.data.total // this.perPage = res.data.total
if (this.perPage !== res.data.list.length) { // if (this.perPage !== res.data.list.length) {
this.getExamParerList() // this.getExamParerList()
} // }
// this.getCheckedExam() // this.getCheckedExam()
if (this.$route.query.exam_id && this.$route.query.isEdit === '2') { if (this.$route.query.exam_id && this.$route.query.isEdit === '2') {
this.getDetailInfo() // 获取详情 this.getDetailInfo() // 获取详情
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论