提交 5260b868 authored 作者: matian's avatar matian

updates

上级 ebec034a
<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="handleSearch">搜索</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" v-model="q">
:data="ExamParerList"
:filterMethod="filterMethod"
:titles="['备选栏', '已选栏']"
>
</el-transfer> </el-transfer>
<el-pagination <el-pagination
:hide-on-single-page="true" :hide-on-single-page="true"
...@@ -41,13 +37,13 @@ export default { ...@@ -41,13 +37,13 @@ export default {
return { return {
total: 0, total: 0,
page: 1, page: 1,
limit: 10000, 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: []
} }
}, },
...@@ -57,15 +53,25 @@ export default { ...@@ -57,15 +53,25 @@ export default {
default: '' default: ''
} }
}, },
computed: {},
methods: { methods: {
handleSearch() {
this.page = 1
this.getExamParerList()
},
handleChange() {},
restValue() {
this.queryItem = ''
this.getExamParerList()
},
handleCurrentChange(val) { handleCurrentChange(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: this.page, 'per-page': this.limit }
this.ExamParerList = [] this.ExamParerList = []
getExamPaperList(params).then(res => { getExamPaperList(params).then(res => {
this.total = res.data.total this.total = res.data.total
...@@ -99,6 +105,7 @@ export default { ...@@ -99,6 +105,7 @@ export default {
} }
} }
this.checkedArrs = listArray this.checkedArrs = listArray
console.log(this.checkedArrs)
const qs = this.q.toString() const qs = this.q.toString()
this.$emit('getCheckPaper', qs) this.$emit('getCheckPaper', qs)
this.$emit('getCheckPaperList', this.checkedArrs) this.$emit('getCheckPaperList', this.checkedArrs)
...@@ -118,12 +125,13 @@ export default { ...@@ -118,12 +125,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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论