提交 71f6820d authored 作者: lihuihui's avatar lihuihui

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

...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
// 是否含有翻页 // 是否含有翻页
hasPagination: { type: Boolean, default: true }, hasPagination: { type: Boolean, default: true },
// 每页多少条数据 // 每页多少条数据
limit: { type: Number, default: 10 }, limit: { type: Number, default: 20 },
pagationLayout: { type: String, default: 'total, prev, pager, next, sizes, jumper' } pagationLayout: { type: String, default: 'total, prev, pager, next, sizes, jumper' }
}, },
data() { data() {
......
...@@ -31,8 +31,24 @@ export default { ...@@ -31,8 +31,24 @@ export default {
{ label: '班级人数', prop: 'student_total', align: 'center', sortable: 'custom' }, { label: '班级人数', prop: 'student_total', align: 'center', sortable: 'custom' },
{ label: '完成人数', prop: 'finished_student_total', align: 'center', sortable: 'custom' }, { label: '完成人数', prop: 'finished_student_total', align: 'center', sortable: 'custom' },
{ label: '课程完成率', prop: 'course_completion_rate', align: 'center', sortable: 'custom' }, { label: '课程完成率', prop: 'course_completion_rate', align: 'center', sortable: 'custom' },
{ label: '累计学习时长', prop: 'study_length', align: 'center', sortable: 'custom' }, {
{ label: '人均学习时长', prop: 'avg_study_length', align: 'center', sortable: 'custom' } label: '累计学习时长',
prop: 'study_length',
align: 'center',
sortable: 'custom',
computed({ row }) {
return row.study_length_format
}
},
{
label: '人均学习时长',
prop: 'avg_study_length',
align: 'center',
sortable: 'custom',
computed({ row }) {
return row.avg_study_length_format
}
}
] ]
} }
} }
...@@ -56,11 +72,13 @@ export default { ...@@ -56,11 +72,13 @@ export default {
}) })
}, },
sortChange(columns) { sortChange(columns) {
console.log(columns, 'hfjsdfhs')
if (columns.order === 'ascending') { if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop this.tableOptions.remote.params.sort = 'asc'
this.tableOptions.remote.params.sort_column = columns.prop
} else { } else {
columns.prop = '-' + columns.prop this.tableOptions.remote.params.sort = 'desc'
this.tableOptions.remote.params.sort = columns.prop this.tableOptions.remote.params.sort_column = columns.prop
} }
this.$refs.list.refetch() this.$refs.list.refetch()
} }
......
...@@ -47,7 +47,15 @@ export default { ...@@ -47,7 +47,15 @@ export default {
columns: [ columns: [
{ label: '图片', prop: 'course_picture', slots: 'table-img' }, { label: '图片', prop: 'course_picture', slots: 'table-img' },
{ label: '课程名称', prop: 'course_name', align: 'center' }, { label: '课程名称', prop: 'course_name', align: 'center' },
{ label: '人均学习时长', prop: 'course_avg_study_len', align: 'center', sortable: 'custom' }, {
label: '人均学习时长',
prop: 'course_avg_study_len',
align: 'center',
sortable: 'custom',
computed({ row }) {
return row.course_avg_study_len_format
}
},
{ label: '课程完成率', prop: 'course_finish_progress', align: 'center', sortable: 'custom' }, { label: '课程完成率', prop: 'course_finish_progress', align: 'center', sortable: 'custom' },
{ label: '操作', align: 'center', slots: 'table-operate' } { label: '操作', align: 'center', slots: 'table-operate' }
] ]
...@@ -59,11 +67,13 @@ export default { ...@@ -59,11 +67,13 @@ export default {
}, },
methods: { methods: {
sortChange(columns) { sortChange(columns) {
console.log(columns, 'hfjsdfhs')
if (columns.order === 'ascending') { if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop this.tableOptions.remote.params.sort = 'asc'
this.tableOptions.remote.params.sort_column = columns.prop
} else { } else {
columns.prop = '-' + columns.prop this.tableOptions.remote.params.sort = 'desc'
this.tableOptions.remote.params.sort = columns.prop this.tableOptions.remote.params.sort_column = columns.prop
} }
this.$refs.list.refetch() this.$refs.list.refetch()
}, },
......
...@@ -49,11 +49,13 @@ export default { ...@@ -49,11 +49,13 @@ export default {
}) })
}, },
sortChange(columns) { sortChange(columns) {
console.log(columns, 'hfjsdfhs')
if (columns.order === 'ascending') { if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop this.tableOptions.remote.params.sort = 'asc'
this.tableOptions.remote.params.sort_column = columns.prop
} else { } else {
columns.prop = '-' + columns.prop this.tableOptions.remote.params.sort = 'desc'
this.tableOptions.remote.params.sort = columns.prop this.tableOptions.remote.params.sort_column = columns.prop
} }
this.$refs.list.refetch() this.$refs.list.refetch()
} }
......
...@@ -32,6 +32,7 @@ export default { ...@@ -32,6 +32,7 @@ export default {
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
hasPagination: false,
data: this.list, data: this.list,
columns: [ columns: [
{ label: '课程ID', align: 'center', prop: 'id' }, { label: '课程ID', align: 'center', prop: 'id' },
......
...@@ -14,6 +14,8 @@ export default { ...@@ -14,6 +14,8 @@ export default {
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
hasPagination: false,
data: this.$route.query.row, data: this.$route.query.row,
columns: [ columns: [
{ label: '章节名称', align: 'center', prop: 'name' }, { label: '章节名称', align: 'center', prop: 'name' },
......
...@@ -82,6 +82,15 @@ export function getClassDetail(params) { ...@@ -82,6 +82,15 @@ export function getClassDetail(params) {
params params
}) })
} }
/**
* 获取班级详情
*/
export function exportClassDetail(params) {
return httpRequest.get('/api/zy/v3-teacher/statistics/class-details', {
params,
responseType: 'blob'
})
}
/** /**
* 考试数据-看板(题目数据) * 考试数据-看板(题目数据)
*/ */
......
...@@ -52,7 +52,8 @@ export default { ...@@ -52,7 +52,8 @@ export default {
{ label: '总分', prop: 'score', align: 'center', sortable: 'custom' }, { label: '总分', prop: 'score', align: 'center', sortable: 'custom' },
{ label: '操作', slots: 'table_operate', align: 'center' } { label: '操作', slots: 'table_operate', align: 'center' }
], ],
pagationLayout: 'prev, pager, next' pagationLayout: 'prev, pager, next',
limit: 10
} }
} }
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<template #header-aside> <template #header-aside>
<el-button type="text" size="mini" @click="toExamData(row)">导出</el-button> <el-button type="text" size="mini" @click="exportClassDetail">导出</el-button>
</template> </template>
<!-- 操作 --> <!-- 操作 -->
<template v-slot:table-operate="{ row }"> <template v-slot:table-operate="{ row }">
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</template> </template>
<script> <script>
import { getClassDetail } from '../api' import { getClassDetail, exportClassDetail } from '../api'
export default { export default {
data() { data() {
return { return {
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
queryInfo: { queryInfo: {
query: '', query: '',
pagenum: 1, pagenum: 1,
pagesize: 10 pagesize: 20
} }
} }
}, },
...@@ -113,8 +113,7 @@ export default { ...@@ -113,8 +113,7 @@ export default {
callback(val) { callback(val) {
this.total = val.total this.total = val.total
this.callList = val.list this.callList = val.list
console.log(val, '999') this.callList.length = this.queryInfo.pagesize
// console.log(val.list, 'val')
return this.callList return this.callList
}, },
// 搜索 // 搜索
...@@ -153,6 +152,32 @@ export default { ...@@ -153,6 +152,32 @@ export default {
this.tableOptions.remote.params.sort = columns.prop this.tableOptions.remote.params.sort = columns.prop
} }
this.$refs.list.refetch() this.$refs.list.refetch()
},
// 导出
exportClassDetail() {
const params = {
type: this.$route.query.type,
course_id: this.$route.query.course_id,
examination_id: this.$route.query.examination_id,
chapter_id: this.$route.query.chapter_id,
class_id: this.$route.query.class_id,
status: this.$route.query.status,
download: 'true'
}
exportClassDetail(params).then(r => {
const content = r
const blob = new Blob([content], { type: 'application/vnd.ms-excel' })
if ('download' in document.createElement('a')) {
const elink = document.createElement('a')
elink.download = '班级数据.xlsx'
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}
})
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论