提交 c9805653 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 e0fa7dab
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
<el-link type="primary">{{ row.paper_title }}</el-link> <el-link type="primary">{{ row.paper_title }}</el-link>
</template> </template>
</app-list> </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> </app-container>
</template> </template>
...@@ -20,7 +24,9 @@ export default { ...@@ -20,7 +24,9 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
currentClickRow: {} currentClickRow: {},
all_courses: [],
courseId: ''
} }
}, },
computed: { computed: {
...@@ -29,11 +35,27 @@ export default { ...@@ -29,11 +35,27 @@ export default {
return { return {
remote: { remote: {
httpRequest: getTestReivewList, httpRequest: getTestReivewList,
params: { course_id: '', chapter_id: '' } params: { course_id: this.courseId, chapter_id: '' },
beforeRequest: this.beforeRequest,
callback: this.callback
}, },
filters: [ 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: [ columns: [
{ label: '考卷名称', prop: 'paper_title', slots: 'table-name' }, { label: '考卷名称', prop: 'paper_title', slots: 'table-name' },
...@@ -41,6 +63,10 @@ export default { ...@@ -41,6 +63,10 @@ export default {
{ label: '未批阅学生数量', prop: 'commit_num', align: 'center' } { label: '未批阅学生数量', prop: 'commit_num', align: 'center' }
] ]
} }
},
chapters() {
const found = this.all_courses.find(item => item.id === this.courseId)
return found ? found.chapters : []
} }
}, },
methods: { methods: {
...@@ -57,6 +83,16 @@ export default { ...@@ -57,6 +83,16 @@ export default {
stu_id: data.id 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论