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

updates

上级 ebec034a
<template>
<el-card>
<el-transfer
filterable
filter-placeholder="请输入关键词搜索"
v-model="q"
:data="ExamParerList"
:filterMethod="filterMethod"
:titles="['备选栏', '已选栏']"
>
<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="handleSearch">搜索</el-button>
<el-button type="plain" size="small" @click="restValue">重置</el-button>
<el-transfer :data="ExamParerList" :titles="['备选栏', '已选栏']" style="margin-top: 10px" v-model="q">
</el-transfer>
<el-pagination
:hide-on-single-page="true"
......@@ -41,13 +37,13 @@ export default {
return {
total: 0,
page: 1,
limit: 10000,
row: {},
limit: 30,
ExamParerList: [],
queryItem: '',
q: [],
filterMethod(query, item) {
return item.label.indexOf(query) > -1
},
// filterMethod(query, item) {
// return item.label.indexOf(query) > -1
// },
checkedArrs: []
}
},
......@@ -57,15 +53,25 @@ export default {
default: ''
}
},
computed: {},
methods: {
handleSearch() {
this.page = 1
this.getExamParerList()
},
handleChange() {},
restValue() {
this.queryItem = ''
this.getExamParerList()
},
handleCurrentChange(val) {
this.page = val
this.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 = []
getExamPaperList(params).then(res => {
this.total = res.data.total
......@@ -99,6 +105,7 @@ export default {
}
}
this.checkedArrs = listArray
console.log(this.checkedArrs)
const qs = this.q.toString()
this.$emit('getCheckPaper', qs)
this.$emit('getCheckPaperList', this.checkedArrs)
......@@ -118,12 +125,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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论