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

feat:课程接口增加

上级 4b318dfd
...@@ -21,5 +21,11 @@ export function getCourseList(params) { ...@@ -21,5 +21,11 @@ export function getCourseList(params) {
* 获取班级列表 * 获取班级列表
*/ */
export function getClassList(params) { export function getClassList(params) {
return httpRequest.get('/v3-teacher/course/classes/{course_id}', { params }) return httpRequest.get(`/api/zy/v3-teacher/course/classes/${params.course_id}`, { params })
}
/**
* 获取学员列表
*/
export function getStuList(params) {
return httpRequest.get(`/api/zy/v3-teacher/course/students/${params.course_id}`, { params })
} }
...@@ -4,9 +4,9 @@ const routes = [ ...@@ -4,9 +4,9 @@ const routes = [
component: () => import('@/components/layout/index.vue'), component: () => import('@/components/layout/index.vue'),
children: [ children: [
{ path: '/teacher/data/course', component: () => import('./views/List.vue') }, { path: '/teacher/data/course', component: () => import('./views/List.vue') },
{ path: '/teacher/data/classDatas', component: () => import('./views/ClassList.vue') }, { path: '/teacher/data/course/classDatas', component: () => import('./views/ClassList.vue') },
{ path: '/teacher/data/personal', component: () => import('./views/PersonalList.vue') }, { path: '/teacher/data/course/personal', component: () => import('./views/PersonalList.vue') },
{ path: '/teacher/data/detail', component: () => import('./views/CourseProcessList.vue') } { path: '/teacher/data/course/detail', component: () => import('./views/CourseProcessList.vue') }
] ]
} }
] ]
......
...@@ -12,26 +12,31 @@ ...@@ -12,26 +12,31 @@
import { getClassList } from '../api' import { getClassList } from '../api'
export default { export default {
computed: { computed: {
id() {
return this.$route.query.id
},
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
remote: { remote: {
httpRequest: getClassList, httpRequest: getClassList,
params: {} params: {
course_id: this.id,
class_name: '',
id: ''
}
}, },
filters: [{ type: 'input', prop: 'class_name', placeholder: '班级名称', label: '班级名称' }], filters: [{ type: 'input', prop: 'class_name', placeholder: '班级名称', label: '班级名称' }],
columns: [ columns: [
{ label: '班级名称', prop: 'paper_title', slots: 'table-name' }, { label: '班级名称', prop: 'class_name', slots: 'table-name' },
{ label: '班级人数', prop: 'class_name', align: 'center', sortable: true }, { label: '班级人数', prop: 'student_total', align: 'center', sortable: true },
{ label: '完成人数', prop: 'cankao_num', align: 'center', sortable: true }, { label: '完成人数', prop: 'finished_student_total', align: 'center', sortable: true },
{ label: '课程完成率', prop: 'wryrty', align: 'center', sortable: true }, { label: '课程完成率', prop: 'course_completion_rate', align: 'center', sortable: true },
{ label: '累计学习时长', prop: 'time', align: 'center', sortable: true }, { label: '累计学习时长', prop: 'study_length', align: 'center', sortable: true },
{ label: '人均学习时长', prop: 'average', align: 'center', sortable: true } { label: '人均学习时长', prop: 'avg_study_length', align: 'center', sortable: true }
], ]
data: [{ class_name: 'weq' }]
} }
} }
}, }
methods: {}
} }
</script> </script>
...@@ -68,18 +68,19 @@ export default { ...@@ -68,18 +68,19 @@ export default {
}) })
}, },
toClassData(row) { toClassData(row) {
console.log(row)
this.$router.push({ this.$router.push({
path: '/teacher/data/classDatas', path: '/teacher/data/course/classDatas',
query: { query: {
row: row id: row.id
} }
}) })
}, },
toPersonal(row) { toPersonal(row) {
this.$router.push({ this.$router.push({
path: '/teacher/data/personal', path: '/teacher/data/course/personal',
query: { query: {
row: row id: row.id
} }
}) })
} }
......
...@@ -13,34 +13,41 @@ ...@@ -13,34 +13,41 @@
</template> </template>
<script> <script>
import { getStuList } from '../api'
export default { export default {
data() {
return {}
},
computed: { computed: {
id() {
return this.$route.query.id
},
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
remote: {}, remote: {
filters: [{ type: 'input', prop: 'class_name', placeholder: '学生姓名', label: '学生姓名' }], httpRequest: getStuList,
params: {
course_id: this.id,
personal_name: '',
id: ''
}
},
filters: [{ type: 'input', prop: 'personal_name', placeholder: '学生姓名', label: '学生姓名' }],
columns: [ columns: [
{ label: '学生姓名', prop: 'paper_title', slots: 'table-name' }, { label: '学生姓名', prop: 'personal_name', slots: 'table-name' },
{ label: '总学习时长', prop: 'class_name', align: 'center', sortable: true }, { label: '总学习时长', prop: 'all_study_length', align: 'center', sortable: true },
{ label: '总完成率', prop: 'commit_num', align: 'center', sortable: true }, { label: '总完成率', prop: 'all_course_completion_rate', align: 'center', sortable: true },
{ label: '本课学习时长', prop: 'etert', align: 'center', sortable: true }, { label: '本课学习时长', prop: 'study_length', align: 'center', sortable: true },
{ label: '本课完成率', prop: 'grthr', align: 'center', sortable: true }, { label: '本课完成率', prop: 'course_completion_rate', align: 'center', sortable: true },
{ label: '操作', slots: 'table-operate', align: 'center' } { label: '操作', slots: 'table-operate', align: 'center' }
], ]
data: [{ class_name: 'dfwjehf' }]
} }
} }
}, },
methods: { methods: {
toPersonDetail(row) { toPersonDetail(row) {
this.$router.push({ this.$router.push({
path: '/teacher/data/detail', path: '/teacher/data/course/detail',
query: { query: {
row: row id: row.id
} }
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论