提交 cdf4a22c authored 作者: lihuihui's avatar lihuihui
......@@ -5,7 +5,11 @@
<el-link type="primary">{{ row.paper_title }}</el-link>
</template>
</app-list>
<review-students @studentReview="studentReview" :visible.sync="visible" :students="currentClickRow.students"></review-students>
<review-students
@studentReview="studentReview"
:visible.sync="visible"
:students="currentClickRow.students"
></review-students>
</app-container>
</template>
......@@ -20,7 +24,9 @@ export default {
data() {
return {
visible: false,
currentClickRow: {}
currentClickRow: {},
all_courses: [],
courseId: ''
}
},
computed: {
......@@ -29,11 +35,27 @@ export default {
return {
remote: {
httpRequest: getTestReivewList,
params: { course_id: '', chapter_id: '' }
params: { course_id: this.courseId, chapter_id: '' },
beforeRequest: this.beforeRequest,
callback: this.callback
},
filters: [
{ type: 'select', prop: 'course_id', placeholder: '选择课程' },
{ type: 'select', prop: 'chapter_id', placeholder: '选择章节' }
{
type: 'select',
prop: 'course_id',
placeholder: '选择课程',
options: this.all_courses,
labelKey: 'course_name',
valueKey: 'id'
},
{
type: 'select',
prop: 'chapter_id',
placeholder: '选择章节',
options: this.chapters,
labelKey: 'chapter_name',
valueKey: 'id'
}
],
columns: [
{ label: '考卷名称', prop: 'paper_title', slots: 'table-name' },
......@@ -41,6 +63,10 @@ export default {
{ label: '未批阅学生数量', prop: 'commit_num', align: 'center' }
]
}
},
chapters() {
const found = this.all_courses.find(item => item.id === this.courseId)
return found ? found.chapters : []
}
},
methods: {
......@@ -57,6 +83,16 @@ export default {
stu_id: data.id
}
})
},
beforeRequest(params) {
this.courseId = params.course_id
return params
},
callback(data) {
if (!this.all_courses.length) {
this.all_courses = data.all_courses
}
return data.list
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论