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

updates

上级 880a5539
<template> <template>
<el-card> <el-card>
<el-input v-model="queryItem" style="margin-bottom: 10px; width: 200px" clearable></el-input> <el-transfer
<el-button type="primary" size="small" style="margin-left: 10px" @click="handleSearch">搜索</el-button> filterable
<el-button type="plain" size="small" @click="restValue">重置</el-button> filter-placeholder="请输入关键词搜索"
<el-transfer :data="ExamParerList" :titles="['备选栏', '已选栏']" style="margin-top: 10px" v-model="q"> 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"
...@@ -37,13 +41,13 @@ export default { ...@@ -37,13 +41,13 @@ export default {
return { return {
total: 0, total: 0,
page: 1, page: 1,
limit: 30, limit: 10000,
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: []
} }
}, },
...@@ -53,25 +57,15 @@ export default { ...@@ -53,25 +57,15 @@ 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: this.queryItem, page: this.page, 'per-page': this.limit } const params = { q: '', 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
...@@ -105,7 +99,6 @@ export default { ...@@ -105,7 +99,6 @@ 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)
...@@ -125,13 +118,12 @@ export default { ...@@ -125,13 +118,12 @@ 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论