Commit ab1f8da6 by 陈超

A

parent e19c93b2
...@@ -217,6 +217,12 @@ ...@@ -217,6 +217,12 @@
}, },
selectedCondition: function() { selectedCondition: function() {
return this.condition.filter( r => { return r.id != '' && r.select }) return this.condition.filter( r => { return r.id != '' && r.select })
},
conditionId: function() {
let f = this.condition.filter( r => { return r.id != '' && r.select })
if(this.tab == 0) {
return f.length > 0 ? f[0].id : ''
}
} }
}, },
methods: { methods: {
...@@ -236,21 +242,21 @@ ...@@ -236,21 +242,21 @@
this.myTab = tab this.myTab = tab
}, },
onCondition: function(condition) { onCondition: function(condition) {
if(condition.id == '') { this.condition.forEach( r => { r.select = false })
this.condition.forEach( r => { r.select = false }) condition.select = true
this.$refs.item.toggle()
if(this.tab == 0) {
this.loadZhenti()
} else { } else {
this.condition.forEach( r => {
r.select = r.id == '' ? false : r.select
})
} }
condition.select = true
}, },
//加载真题 //加载真题
loadZhenti: function() { loadZhenti: function() {
let that = this let that = this
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "{:U('exams/Index/paper')}" + "&api=1", url: "{:U('exams/Index/paper')}" + "&api=1&c=" + that.conditionId,
dataType: "json", dataType: "json",
success: function(res) { success: function(res) {
if(res.status == 1) { if(res.status == 1) {
...@@ -277,7 +283,9 @@ ...@@ -277,7 +283,9 @@
} }
} }
}) })
} },
//加载试题下载
} }
}) })
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment