提交 a4806469 authored 作者: lihuihui's avatar lihuihui

Merge branch 'vite' of https://gitlab.ezijing.com/ezijing/x-learn into vite

...@@ -162,7 +162,7 @@ export default { ...@@ -162,7 +162,7 @@ export default {
.then(res => { .then(res => {
const { data = {} } = res || {} const { data = {} } = res || {}
this.page.total = parseInt(data.total || 0) this.page.total = parseInt(data.total || 0)
this.dataList = callback ? callback(data) : data this.dataList = callback ? callback(data) : data.list
}) })
.catch(() => { .catch(() => {
this.page.total = 0 this.page.total = 0
......
...@@ -5,3 +5,27 @@ import httpRequest from '@/utils/axios' ...@@ -5,3 +5,27 @@ import httpRequest from '@/utils/axios'
export function getExamReivewList(params) { export function getExamReivewList(params) {
return httpRequest.get('/api/zy/v3-teacher/examination/examination-list', { params }) return httpRequest.get('/api/zy/v3-teacher/examination/examination-list', { params })
} }
/**
* 获取课程列表
*/
export function getCourseNameList(params) {
return httpRequest.get('/api/zy/v3-teacher/course/names', { params })
}
/**
* 获取课程列表
*/
export function getCourseList(params) {
return httpRequest.get('/api/zy/v3-teacher/course/list', { params })
}
/**
* 获取班级列表
*/
export function getClassList(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') }
] ]
} }
] ]
......
...@@ -9,25 +9,34 @@ ...@@ -9,25 +9,34 @@
</template> </template>
<script> <script>
import { getClassList } from '../api'
export default { export default {
computed: { computed: {
id() {
return this.$route.query.id
},
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
remote: {}, remote: {
httpRequest: getClassList,
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>
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<app-container> <app-container>
<app-list v-bind="tableOptions" ref="list"> <app-list v-bind="tableOptions" ref="list">
<!-- 操作 --> <!-- 操作 -->
<template v-slot:table-img="{row}"> <template v-slot:table-img="{ row }">
<img :src="row.tableImg" alt="" /> <img :src="row.course_picture" alt="" style="width: 100px; height: 100px" />
</template> </template>
<template v-slot:table-operate="{ row }"> <template v-slot:table-operate="{ row }">
<el-button type="text" size="mini" @click="toClassData(row)">班级数据</el-button> <el-button type="text" size="mini" @click="toClassData(row)">班级数据</el-button>
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
</template> </template>
<script> <script>
import { getCourseNameList, getCourseList } from '../api'
export default { export default {
data() { data() {
return { return {
conditionList: { conditionList: {
courseList: [] list: []
} }
} }
}, },
...@@ -27,49 +28,59 @@ export default { ...@@ -27,49 +28,59 @@ export default {
tableOptions() { tableOptions() {
return { return {
remote: { remote: {
httpRequest: getCourseList,
params: {
course_name: '',
id: ''
}
}, },
filters: [ filters: [
{ {
type: 'select', type: 'select',
prop: 'class_name', prop: 'id',
placeholder: '课程名称', placeholder: '课程名称',
label: '课程名称', label: '课程名称',
options: this.conditionList.courseList, options: this.conditionList.list,
labelKey: 'course_name', labelKey: 'course_name',
valueKey: 'course_id', valueKey: 'id',
filterable: true, filterable: true
remote: true
} }
], ],
columns: [ columns: [
{ label: '图片', prop: 'tableImg', slots: 'table-img' }, { label: '图片', prop: 'course_picture', slots: 'table-img' },
{ label: '课程名称', prop: 'class_name', align: 'center' }, { label: '课程名称', prop: 'course_name', align: 'center' },
{ label: '人均学习时长', prop: 'cankao_num', align: 'center', sortable: true }, { label: '人均学习时长', prop: 'course_avg_study_len', align: 'center', sortable: true },
{ label: '课程完成率', prop: 'ewt4t43', align: 'center', sortable: true }, { label: '课程完成率', prop: 'course_finish_progress', align: 'center', sortable: true },
{ label: '操作', align: 'center', slots: 'table-operate' } { label: '操作', align: 'center', slots: 'table-operate' }
],
data: [
{
class_name: '1'
}
] ]
} }
} }
}, },
created() {
this.getCourseNameList()
},
methods: { methods: {
// 获取课程名称
getCourseNameList() {
getCourseNameList().then(res => {
this.conditionList = res.data
console.log(res, 'fdd')
})
},
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
} }
}) })
} }
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
type: 'shadow' type: 'shadow'
}, },
formatter: function (data) { formatter: function (data) {
const res = `<div>${data[0].axisValue}</div><div>${data[0].value}%</div>` const res = `<span>${data[0].axisValue}</span>&nbsp<span>${data[0].value}%</span>`
return res return res
} }
}, },
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: function (params) { formatter: function (params) {
const str = params.data.name + '<br/>' + params.data.value + '<br/>' + params.percent + '%' const str = params.data.name + '&nbsp' + params.data.value + '人' + '&nbsp' + params.percent + '%'
return str return str
} }
}, },
......
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
<el-card class="box-card" style="height: 450px"> <el-card class="box-card" style="height: 450px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<h1 style="color: #333; font-size: 16px; border-left: 3px solid #aa1941; padding-left: 7px">考分区间</h1> <h1 style="color: #333; font-size: 16px; border-left: 3px solid #aa1941; padding-left: 7px">考分区间</h1>
<el-button type="text" style="font-size: 16px; color: #aa1941; float: right; margin-top: -35px" @click="isSetScoreRange = true">设置</el-button> <el-button
type="text"
style="font-size: 16px; color: #aa1941; float: right; margin-top: -35px"
@click="isSetScoreRange = true"
>设置</el-button
>
</div> </div>
<div style="height: 400px; width: 90%; margin: 0 auto"> <div style="height: 400px; width: 90%; margin: 0 auto">
<div id="score" style="width: 100%; height: 90%"></div> <div id="score" style="width: 100%; height: 90%"></div>
...@@ -36,7 +41,7 @@ export default { ...@@ -36,7 +41,7 @@ export default {
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: function (params) { formatter: function (params) {
const str = params.data.name + '<br/>' + params.data.value + '人' const str = params.data.name + '&nbsp' + params.data.value + '人' + '&nbsp' + params.percent + '%'
return str return str
} }
}, },
...@@ -50,7 +55,7 @@ export default { ...@@ -50,7 +55,7 @@ export default {
}, },
series: [ series: [
{ {
name: 'Access From', // name: 'Access From',
type: 'pie', type: 'pie',
radius: ['50%', '70%'], radius: ['50%', '70%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论