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

updates

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