提交 66cbb47e authored 作者: matian's avatar matian

updates

上级 d5c0a18a
<template>
<el-card>
<el-transfer
filterable
filter-placeholder="请输入关键词搜索"
v-model="q"
:data="ExamParerList"
:filterMethod="filterMethod"
:titles="['备选栏', '已选栏']"
>
</el-transfer>
<el-input v-model="queryItem" style="margin-bottom: 10px; width: 200px" clearable></el-input>
<el-button type="primary" size="small" style="margin-left: 10px" @click="getExamParerList">搜索</el-button>
<el-button type="plain" size="small" @click="restValue">重置</el-button>
<el-transfer :data="ExamParerList" :titles="['备选栏', '已选栏']" style="margin-top: 10px"> </el-transfer>
<el-pagination
:hide-on-single-page="true"
:current-page.sync="page"
......@@ -42,12 +37,12 @@ export default {
total: 0,
page: 1,
limit: 30,
row: {},
ExamParerList: [],
queryItem: '',
q: [],
filterMethod(query, item) {
return item.label.indexOf(query) > -1
},
// filterMethod(query, item) {
// return item.label.indexOf(query) > -1
// },
checkedArrs: []
}
},
......@@ -59,15 +54,18 @@ export default {
},
methods: {
handleChange() {},
restValue() {
this.queryItem = ''
this.getExamParerList()
},
handleCurrentChange(val) {
// console.log(val)
this.page = val
this.getExamParerList()
},
// 获取试卷列表
getExamParerList() {
const params = { q: '', page: this.page, 'per-page': this.limit }
// params['per-page'] = this.perPage
const params = { q: this.queryItem, page: 1, 'per-page': this.limit }
this.ExamParerList = []
getExamPaperList(params).then(res => {
this.total = res.data.total
......@@ -75,11 +73,6 @@ export default {
this.ExamParerList.push({ label: b.paper_title, key: b.id })
return this.ExamParerList
}, [])
// this.perPage = res.data.total
// if (this.perPage !== res.data.list.length) {
// this.getExamParerList()
// }
// this.getCheckedExam()
if (this.$route.query.exam_id && this.$route.query.isEdit === '2') {
this.getDetailInfo() // 获取详情
}
......@@ -126,12 +119,13 @@ export default {
getDetailInfo() {
getExamPaperDetail({ id: this.$route.query.exam_id }).then(res => {
const parperList = res.data.exam_info.paper_list
console.log(parperList)
const arr = []
parperList.forEach(element => {
console.log(element)
const findItem = this.ExamParerList.find(item => {
return item.label === element.paper_title
}).key
console.log(this.ExamParerList)
findItem && arr.push(findItem)
})
this.q = arr
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论