提交 02a3f2f2 authored 作者: matian's avatar matian

Auto stash before merge of "vite" and "origin/vite"

上级 ebd09796
<template> <template>
<app-container> <app-container>
<app-list v-bind="tableOptions" ref="list"> <app-list v-bind="tableOptions" ref="list" @sort-change="sortChange">
<template #header-aside> <template #header-aside>
<el-button type="text" @click="exportClass">导出</el-button> <el-button type="text" @click="exportClass">导出</el-button>
</template> </template>
...@@ -28,11 +28,11 @@ export default { ...@@ -28,11 +28,11 @@ export default {
filters: [{ type: 'input', prop: 'class_name', placeholder: '班级名称', label: '班级名称' }], filters: [{ type: 'input', prop: 'class_name', placeholder: '班级名称', label: '班级名称' }],
columns: [ columns: [
{ label: '班级名称', prop: 'class_name', align: 'center' }, { label: '班级名称', prop: 'class_name', align: 'center' },
{ label: '班级人数', prop: 'student_total', align: 'center', sortable: true }, { label: '班级人数', prop: 'student_total', align: 'center', sortable: 'custom' },
{ label: '完成人数', prop: 'finished_student_total', align: 'center', sortable: true }, { label: '完成人数', prop: 'finished_student_total', align: 'center', sortable: 'custom' },
{ label: '课程完成率', prop: 'course_completion_rate', align: 'center', sortable: true }, { label: '课程完成率', prop: 'course_completion_rate', align: 'center', sortable: 'custom' },
{ label: '累计学习时长', prop: 'study_length', align: 'center', sortable: true }, { label: '累计学习时长', prop: 'study_length', align: 'center', sortable: 'custom' },
{ label: '人均学习时长', prop: 'avg_study_length', align: 'center', sortable: true } { label: '人均学习时长', prop: 'avg_study_length', align: 'center', sortable: 'custom' }
] ]
} }
} }
...@@ -54,6 +54,16 @@ export default { ...@@ -54,6 +54,16 @@ export default {
document.body.removeChild(elink) document.body.removeChild(elink)
} }
}) })
},
sortChange(columns) {
console.log(columns, '123')
if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop
} else {
columns.prop = '-' + columns.prop
this.tableOptions.remote.params.sort = columns.prop
}
this.$refs.list.refetch()
} }
} }
} }
......
...@@ -49,8 +49,8 @@ export default { ...@@ -49,8 +49,8 @@ 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: true }, { label: '人均学习时长', prop: 'course_avg_study_len', align: 'center', sortable: 'custom' },
{ label: '课程完成率', prop: 'course_finish_progress', align: 'center', sortable: true }, { label: '课程完成率', prop: 'course_finish_progress', align: 'center', sortable: 'custom' },
{ label: '操作', align: 'center', slots: 'table-operate' } { label: '操作', align: 'center', slots: 'table-operate' }
] ]
} }
......
<template> <template>
<app-container> <app-container>
<app-list v-bind="tableOptions" ref="list"> <app-list v-bind="tableOptions" ref="list" @sort-change="sortChange">
<template v-slot:table-name="{ row }"> <template v-slot:table-name="{ row }">
<el-link type="primary">{{ row.paper_title }}</el-link> <el-link type="primary">{{ row.paper_title }}</el-link>
</template> </template>
...@@ -33,10 +33,10 @@ export default { ...@@ -33,10 +33,10 @@ export default {
filters: [{ type: 'input', prop: 'personal_name', placeholder: '学生姓名', label: '学生姓名' }], filters: [{ type: 'input', prop: 'personal_name', placeholder: '学生姓名', label: '学生姓名' }],
columns: [ columns: [
{ label: '学生姓名', prop: 'personal_name', slots: 'table-name' }, { label: '学生姓名', prop: 'personal_name', slots: 'table-name' },
{ label: '总学习时长', prop: 'all_study_length', align: 'center', sortable: true }, { label: '总学习时长', prop: 'all_study_length', align: 'center', sortable: 'custom' },
{ label: '总完成率', prop: 'all_course_completion_rate', align: 'center', sortable: true }, { label: '总完成率', prop: 'all_course_completion_rate', align: 'center', sortable: 'custom' },
{ label: '本课学习时长', prop: 'study_length', align: 'center', sortable: true }, { label: '本课学习时长', prop: 'study_length', align: 'center', sortable: 'custom' },
{ label: '本课完成率', prop: 'course_completion_rate', align: 'center', sortable: true }, { label: '本课完成率', prop: 'course_completion_rate', align: 'center', sortable: 'custom' },
{ label: '操作', slots: 'table-operate', align: 'center' } { label: '操作', slots: 'table-operate', align: 'center' }
] ]
} }
...@@ -50,6 +50,16 @@ export default { ...@@ -50,6 +50,16 @@ export default {
id: row.id id: row.id
} }
}) })
},
sortChange(columns) {
console.log(columns, '123')
if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop
} else {
columns.prop = '-' + columns.prop
this.tableOptions.remote.params.sort = columns.prop
}
this.$refs.list.refetch()
} }
} }
} }
......
...@@ -57,3 +57,28 @@ export function exportTitleList(params) { ...@@ -57,3 +57,28 @@ export function exportTitleList(params) {
responseType: 'blob' responseType: 'blob'
}) })
} }
/**
* 考试数据-看板(题目数据导出)
*/
export function getClassList(params) {
return httpRequest.get('/api/zy/v3-teacher/statistics/class-list', {
params
})
}
/**
* 导出班级统计数据
*/
export function exportClassList(params) {
return httpRequest.get('/api/zy/v3-teacher/statistics/class-list', {
params,
responseType: 'blob'
})
}
/**
* 获取班级详情
*/
export function getClassDetail(params) {
return httpRequest.get('/api/zy/v3-teacher/statistics/class-details', {
params
})
}
<template> <template>
<app-container> <app-container>
<app-list v-bind="tableOptions" ref="list" @sort-change="sortChange"> <app-list v-bind="tableOptions" ref="list" @sort-change="sortChange">
<template v-slot:paper_title="{ row }">
<div :class="`paper-title active${row.ranking}`">{{ row.ranking }}</div>
</template>
<template v-slot:table-name="{ row }"> <template v-slot:table-name="{ row }">
<el-button type="text" @click="toPersonal(row)">{{ row.class_name }}</el-button> <el-button type="text" @click="toPersonal(row)">{{ row.class_name }}</el-button>
</template> </template>
...@@ -17,56 +20,115 @@ export default { ...@@ -17,56 +20,115 @@ export default {
tabActive: { tabActive: {
type: String, type: String,
default: '' default: ''
},
classList: {
type: Object,
default: () => {}
},
course_id: {
type: String,
default: ''
},
examination_id: {
type: String,
default: ''
},
chapter_id: {
type: String,
default: ''
},
type: {
type: String,
default: ''
} }
}, },
computed: { computed: {
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
remote: {}, data: this.classList.list,
columns: [ columns: [
{ {
label: '排名', label: '排名',
prop: 'paper_title', prop: 'ranking',
align: 'center' align: 'center',
slots: 'paper_title'
}, },
{ label: '班级', slots: 'table-name', prop: 'class_name', align: 'center' }, { label: '班级', slots: 'table-name', prop: 'class_name', align: 'center' },
{ label: '平均分', prop: 'cankao_num', align: 'center', sortable: 'custom' }, { label: '平均分', prop: 'total_average', align: 'center', sortable: 'custom' },
{ label: '客观题平均分', prop: 'efw', align: 'center', sortable: 'custom' }, { label: '客观题平均分', prop: 'objective_average', align: 'center', sortable: 'custom' },
{ label: '客观题最高分', prop: 'average_num', align: 'center', sortable: 'custom' }, { label: '客观题最高分', prop: 'objective_max', align: 'center', sortable: 'custom' },
{ label: '客观题最低分', prop: 'top', align: 'center', sortable: 'custom' }, { label: '客观题最低分', prop: 'objective_min', align: 'center', sortable: 'custom' },
{ label: '主观题平均分', prop: 'low', align: 'center', sortable: 'custom' }, { label: '主观题平均分', prop: 'subjective_average', align: 'center', sortable: 'custom' },
{ label: '主观题最高分', prop: 'title_num', align: 'center', sortable: 'custom' }, { label: '主观题最高分', prop: 'subjective_max', align: 'center', sortable: 'custom' },
{ label: '主观题最低分', prop: 'title_percent', align: 'center', sortable: 'custom' } { label: '主观题最低分', prop: 'subjective_min', align: 'center', sortable: 'custom' }
],
data: [
{
class_name: '1w1e'
}
] ]
} }
} }
}, },
mounted() {}, mounted() {
console.log(this.type, '123dfs')
},
methods: { methods: {
toPersonal(row) { toPersonal(row) {
this.$router.push({ this.$router.push({
path: '/teacher/data/exam/PersonalList', path: '/teacher/data/exam/PersonalList',
query: { query: {
row: row class_id: row.class_id,
params: {
course_id: this.course_id,
examination_id: this.examination_id,
chapter_id: this.chapter_id,
type: this.type
}
} }
}) })
}, },
sortChange(columns) { sortChange(columns) {
console.log(columns, '123') console.log(columns, '123')
if (columns.order === 'ascending') { if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop this.$parent.$parent.$parent.$parent.getClassList()
return columns.prop
} else { } else {
columns.prop = '-' + columns.prop columns.prop = '-' + columns.prop
this.tableOptions.remote.params.sort = columns.prop this.$parent.$parent.$parent.$parent.getClassList()
} }
this.$refs.list.refetch()
} }
} }
} }
</script> </script>
<style lang="scss" scoped>
.paper-title {
text-align: center;
line-height: 27px;
width: 27px;
height: 27px;
// background: #E3EAFF;
color: #606266;
border-radius: 50%;
margin: 0 auto;
&.active1 {
color: #6c83ce;
background: #e3eaff;
}
&.active2 {
color: #8fb87a;
background: #ebfce2;
}
&.active3 {
color: #d96685;
background: #ffeaef;
}
}
::v-deep {
.el-table {
th {
padding: 0;
}
td {
padding: 0;
height: 41px;
}
}
}
</style>
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
mounted() { mounted() {
this.initEchart() this.initEchart()
this.initCorrectRate() this.initCorrectRate()
console.log(this.dataInfo.questions_info_2, '12') // console.log(this.dataInfo.questions_info_2, '12')
}, },
methods: { methods: {
initEchart() { initEchart() {
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
}, },
initCorrectRate() { initCorrectRate() {
this.correctRate = this.dataInfo.questions_info_2.reduce((a, b) => ({ ...a, [b.type]: b }), {}) this.correctRate = this.dataInfo.questions_info_2.reduce((a, b) => ({ ...a, [b.type]: b }), {})
console.log(this.correctRate, '=123') // console.log(this.correctRate, '=123')
} }
} }
} }
......
<template> <template>
<app-list v-bind="tableOptions" ref="list"> <app-list v-bind="tableOptions" ref="list" @sort-change="sortChange">
<template v-slot:paper_title="{ row }"> <template v-slot:paper_title="{ row }">
<div :class="`paper-title active${row.paper_title}`">{{ row.paper_title }}</div> <div :class="`paper-title active${row.paper_title}`">{{ row.paper_title }}</div>
</template> </template>
...@@ -35,8 +35,8 @@ export default { ...@@ -35,8 +35,8 @@ export default {
{ label: '排名', slots: 'paper_title', prop: 'paper_title', align: 'center' }, { label: '排名', slots: 'paper_title', prop: 'paper_title', align: 'center' },
{ label: '姓名', prop: 'personal_name', align: 'center' }, { label: '姓名', prop: 'personal_name', align: 'center' },
{ label: '客观题', prop: 'subjective', align: 'center', sortable: 'custom', minWidth: 100 }, { label: '客观题', prop: 'subjective', align: 'center', sortable: 'custom', minWidth: 100 },
{ label: '主观题', prop: 'objective', align: 'center', sortable: true, minWidth: 100 }, { label: '主观题', prop: 'objective', align: 'center', sortable: 'custom', minWidth: 100 },
{ label: '总分', prop: 'score', align: 'center', sortable: true }, { label: '总分', prop: 'score', align: 'center', sortable: 'custom' },
{ label: '操作', slots: 'table_operate', align: 'center' } { label: '操作', slots: 'table_operate', align: 'center' }
] ]
} }
...@@ -64,12 +64,12 @@ export default { ...@@ -64,12 +64,12 @@ export default {
// 根据首次缴费时间排序 // 根据首次缴费时间排序
sortChange(columns) { sortChange(columns) {
if (columns.order === 'ascending') { if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop this.$parent.$parent.$parent.$parent.getScoreRanking()
return columns.prop
} else { } else {
columns.prop = '-' + columns.prop columns.prop = '-' + columns.prop
this.tableOptions.remote.params.sort = columns.prop this.$parent.$parent.$parent.$parent.getScoreRanking()
} }
this.$refs.list.refetch()
} }
} }
} }
......
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
> >
</div> </div>
<el-tabs v-model="tabActive" @tab-click="handleClick"> <el-tabs v-model="tabActive" @tab-click="handleClick">
<el-tab-pane label="已完成" name="finished"> <el-tab-pane :label="`已完成${scoreRanking.checked_count}`" name="finished">
<RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" /> <RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="待评价" name="toEvaluate" lazy> <el-tab-pane :label="`已完成${scoreRanking.commit_count}`" name="toEvaluate" lazy>
<RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" /> <RankingAll :tabActive="tabActive" :scoreRanking="scoreRanking" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="未作答" name="noAnswer" lazy> <el-tab-pane :label="`未作答${scoreRanking.no_sheet_count}`" name="noAnswer" lazy>
<RankingAll :scoreRanking="scoreRanking" /> <RankingAll :scoreRanking="scoreRanking" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="待提交" name="toSubmit" lazy> <el-tab-pane :label="`未提交${scoreRanking.cache_count}`" name="toSubmit" lazy>
<RankingAll :scoreRanking="scoreRanking" /> <RankingAll :scoreRanking="scoreRanking" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -50,7 +50,11 @@ export default { ...@@ -50,7 +50,11 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
dataInfo: {} dataInfo: {},
classValue: {
type: String,
default: ''
}
}, },
data() { data() {
return { return {
...@@ -81,7 +85,8 @@ export default { ...@@ -81,7 +85,8 @@ export default {
examination_id: this.examination_id, examination_id: this.examination_id,
chapter_id: this.chapter_id, chapter_id: this.chapter_id,
type: this.type, type: this.type,
status: this.status status: this.status,
class_id: this.classValue
} }
getScoreRanking(params).then(res => { getScoreRanking(params).then(res => {
this.scoreRanking = res.data this.scoreRanking = res.data
......
<template> <template>
<el-card style="margin-right: -20px; height: 650px"> <el-card style="margin-right: -20px; height: 650px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix" style="position: relative">
<h1 style="color: #333; font-size: 16px; border-left: 3px solid #aa1941; padding-left: 7px"> <h1 style="color: #333; font-size: 16px; border-left: 3px solid #aa1941; padding-left: 7px">
<span style="color: #c01540" v-show="dataInfo == 0">*</span>题目数据 <span style="color: #c01540" v-show="dataInfo == 0">*</span>题目数据
</h1> </h1>
<el-select
v-model="value"
placeholder="全部题型"
@change="changeSeclect"
style="position: absolute; right: 60px; top: -5px"
>
<el-option label="单选题" :value="1"></el-option>
<el-option label="多选题" :value="2"></el-option>
<el-option label="实操题" :value="7"></el-option>
<el-option label="案例题" :value="5"></el-option>
<el-option label="情景题" :value="8"></el-option>
<el-option label="判断题" :value="6"></el-option>
<el-option label="问答题" :value="3"></el-option>
</el-select>
<el-button <el-button
type="text" type="text"
style="font-size: 16px; color: #aa1941; float: right; margin-top: -30px" style="font-size: 16px; color: #aa1941; float: right; margin-top: -30px"
...@@ -11,7 +25,7 @@ ...@@ -11,7 +25,7 @@
>导出</el-button >导出</el-button
> >
</div> </div>
<app-list v-bind="tableOptions" ref="list"></app-list> <app-list v-bind="tableOptions" ref="list" @sort-change="sortChange"></app-list>
</el-card> </el-card>
</template> </template>
...@@ -20,6 +34,7 @@ import { getTitleList, exportTitleList } from '../api' ...@@ -20,6 +34,7 @@ import { getTitleList, exportTitleList } from '../api'
export default { export default {
data() { data() {
return { return {
value: 1,
conditionList: { conditionList: {
examList: [], examList: [],
courseList: [] courseList: []
...@@ -43,42 +58,76 @@ export default { ...@@ -43,42 +58,76 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
dataInfo: {} dataInfo: {},
classValue: {
type: String,
default: ''
}
}, },
computed: { computed: {
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
remote: { remote: {
beforeRequest: this.beforeRequest,
httpRequest: getTitleList, httpRequest: getTitleList,
params: { params: {
type: this.type, type: this.type,
course_id: this.course_id, course_id: this.course_id,
examination_id: this.examination_id, examination_id: this.examination_id,
chapter_id: this.chapter_id chapter_id: this.chapter_id,
question_type: this.value,
class_id: this.classValue
} }
}, },
columns: [ columns: [
{ label: '排序', prop: 'ranking', align: 'center' }, { label: '排序', prop: 'ranking', align: 'center' },
{ label: '题干简述', prop: 'title', align: 'center' }, { label: '题干简述', prop: 'title', align: 'center' },
{ label: '题型', prop: 'type', align: 'center' }, {
{ label: '正确率', prop: 'rate', align: 'center' }, label: '题型',
prop: 'type',
align: 'center',
computed({ row }) {
if (row.type === 1) {
return '单选题'
} else if (row.type === 2) {
return '多选题'
} else if (row.type === 3) {
return '问答题'
} else if (row.type === 5) {
return '案例题'
} else if (row.type === 6) {
return '判断题'
} else if (row.type === 7) {
return '实操题'
} else if (row.type === 8) {
return '情景题'
}
}
},
{ label: '正确率', prop: 'rate', align: 'center', sortable: 'custom' },
{ label: '总分', prop: 'total_score', align: 'center' }, { label: '总分', prop: 'total_score', align: 'center' },
{ label: '平均得分', prop: 'average', align: 'center' } { label: '平均得分', prop: 'average', align: 'center', sortable: 'custom' }
] ]
} }
} }
}, },
mounted() {
console.log(this.type, 'type')
},
methods: { methods: {
beforeRequest(params, isReset) {
params.question_type = this.value
params.class_id = this.classValue
return params
},
changeSeclect() {
this.$refs.list.refetch()
},
exportTitleData() { exportTitleData() {
const params = { const params = {
type: this.type, type: this.type,
course_id: this.course_id, course_id: this.course_id,
examination_id: this.examination_id, examination_id: this.examination_id,
download: 'true' download: 'true',
question_type: this.value
} }
exportTitleList(params).then(r => { exportTitleList(params).then(r => {
const content = r const content = r
...@@ -94,6 +143,16 @@ export default { ...@@ -94,6 +143,16 @@ export default {
document.body.removeChild(elink) document.body.removeChild(elink)
} }
}) })
},
sortChange(columns) {
console.log(columns, '123')
if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop
} else {
columns.prop = '-' + columns.prop
this.tableOptions.remote.params.sort = columns.prop
}
this.$refs.list.refetch()
} }
} }
} }
......
...@@ -3,16 +3,43 @@ ...@@ -3,16 +3,43 @@
<div style="font-size: 32px; margin-bottom: 15px">测试班级一</div> <div style="font-size: 32px; margin-bottom: 15px">测试班级一</div>
<app-card> <app-card>
<h1 class="title" style="font-size: 28px">班级排名</h1> <h1 class="title" style="font-size: 28px">班级排名</h1>
<el-button type="text" style="float: right; margin-top: -40px">导出</el-button> <el-button type="text" style="float: right; margin-top: -40px" @click="exportClassList">导出</el-button>
<el-tabs v-model="tabActive" style="margin-top: 30px" @tab-click="handleClick"> <el-tabs v-model="tabActive" style="margin-top: 30px" @tab-click="handleClick">
<el-tab-pane label="已结束" name="finished"> <el-tab-pane :label="`已结束${classList.checked_count}`" name="finished">
<Finished /> <Finished
:classList="classList"
:course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="待评价" name="toEvaluate" lazy> <el-tab-pane :label="`待评价${classList.commit_count}`" name="toEvaluate" lazy>
<Finished /> <Finished
:classList="classList"
:course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="未作答" name="noAnswer" lazy> <el-tab-pane :label="`未作答${classList.no_sheet_count}`" name="noAnswer" lazy>
<Finished /> <Finished
:classList="classList"
:course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
/>
</el-tab-pane>
<el-tab-pane :label="`未提交${classList.cache_count}`" name="toSubmit" lazy>
<Finished
:classList="classList"
:course_id="$route.query.course_id"
:examination_id="$route.query.examination_id"
:chapter_id="$route.query.chapter_id"
:type="$route.query.type"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</app-card> </app-card>
...@@ -21,26 +48,83 @@ ...@@ -21,26 +48,83 @@
<script> <script>
import Finished from '../components/Finished.vue' import Finished from '../components/Finished.vue'
import { getClassList, exportClassList } from '../api'
export default { export default {
components: { Finished }, components: { Finished },
data() { data() {
return { return {
tabActive: 'finished' tabActive: 'finished',
classList: {}
}
},
computed: {
status() {
if (this.tabActive === 'finished') {
return '2'
} else if (this.tabActive === 'toEvaluate') {
return '1'
} else if (this.tabActive === 'noAnswer') {
return '100'
} else {
return '0'
}
} }
}, },
created() { created() {
// 已结束网络请求 this.getClassList()
console.log(this.$route.query.type, 'type123')
}, },
methods: { methods: {
getClassList() {
const params = {
course_id: this.$route.query.course_id,
examination_id: this.$route.query.examination_id,
chapter_id: this.$route.query.chapter_id,
type: this.$route.query.type,
status: this.status
}
console.log(this.$route.query.type, 'type')
getClassList(params).then(res => {
this.classList = res.data
})
},
handleClick(tab, event) { handleClick(tab, event) {
// console.log(tab, event) console.log(tab, event)
if (tab.index === 1) { if (tab.index === 1) {
// 待评价 // 待评价
alert('111') this.getClassList()
} else { } else if (tab.index === 2) {
// 未作答 // 未作答
alert('222') this.getClassList()
} else {
this.getClassList()
}
},
// 导出
exportClassList() {
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,
download: 'true',
status: this.status
} }
exportClassList(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)
}
})
} }
} }
} }
......
...@@ -76,29 +76,7 @@ export default { ...@@ -76,29 +76,7 @@ export default {
components: { VueHtml2pdf, ExamInfo, Submission, Score, ScoreRanking, TitleData, Result, ScoreRange, QuestionType }, components: { VueHtml2pdf, ExamInfo, Submission, Score, ScoreRanking, TitleData, Result, ScoreRange, QuestionType },
data() { data() {
return { return {
options: [ value: '001',
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
dataInfo: { dataInfo: {
need_check_num: '' need_check_num: ''
} }
...@@ -109,12 +87,18 @@ export default { ...@@ -109,12 +87,18 @@ export default {
this.getExamDataInfo() this.getExamDataInfo()
}, },
methods: { methods: {
refreshPage() {
this.getExamDataInfo()
this.$refs.scoreRankingRef.getScoreRanking()
this.$refs.titleDataRef.getTitleList()
},
getExamDataInfo() { getExamDataInfo() {
const params = { const params = {
course_id: this.$route.query.course_id, course_id: this.$route.query.course_id,
examination_id: this.$route.query.examination_id, examination_id: this.$route.query.examination_id,
chapter_id: this.$route.query.chapter_id, chapter_id: this.$route.query.chapter_id,
type: this.$route.query.type type: this.$route.query.type,
class_id: this.value
} }
getExamDataInfo(params).then(res => { getExamDataInfo(params).then(res => {
this.dataInfo = res.data this.dataInfo = res.data
......
...@@ -95,7 +95,9 @@ export default { ...@@ -95,7 +95,9 @@ export default {
this.$router.push({ this.$router.push({
path: '/teacher/data/exam/class', path: '/teacher/data/exam/class',
query: { query: {
row: row course_id: row.course_id,
examination_id: row.examination_id,
type: 'examination'
} }
}) })
} }
......
<template> <template>
<app-container> <app-container>
<app-list v-bind="tableOptions" ref="list"> <app-list v-bind="tableOptions" ref="list" @sort-change="sortChange">
<template #header-aside> <template #header-aside>
<el-button type="text" size="mini" @click="toExamData(row)">导出</el-button> <el-button type="text" size="mini" @click="toExamData(row)">导出</el-button>
</template> </template>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
</template> </template>
<script> <script>
import { getClassDetail } from '../api'
export default { export default {
data() { data() {
return {} return {}
...@@ -21,25 +22,33 @@ export default { ...@@ -21,25 +22,33 @@ export default {
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
remote: {}, remote: {
filters: [{ type: 'input', prop: 'paper_title', placeholder: '学生姓名', label: '学生姓名' }], httpRequest: getClassDetail,
params: {
type: this.$route.query.params.type,
course_id: this.$route.query.params.course_id,
examination_id: this.$route.query.params.examination_id,
chapter_id: this.$route.query.params.chapter_id,
class_id: this.$route.query.class_id,
status: this.$route.query.params.status
}
},
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: 'score', align: 'center', sortable: 'custom' },
{ label: '主观题得分', prop: 'cankao_num', align: 'center', sortable: true }, { label: '主观题得分', prop: 'subjective', align: 'center', sortable: 'custom' },
{ label: '客观题得分', prop: 'ewfr', align: 'center', sortable: true }, { label: '客观题得分', prop: 'objective', align: 'center', sortable: 'custom' },
{ label: '完成时间', prop: 'average_num', align: 'center', sortable: true }, { label: '完成时间', prop: 'duration', align: 'center', sortable: 'custom' },
{ label: '状态', prop: 'top', align: 'center' }, { label: '状态', prop: 'status', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center' } { label: '操作', slots: 'table-operate', align: 'center' }
],
data: [
{
class_name: '1w1e'
}
] ]
} }
} }
}, },
mounted() {
console.log(this.$route.query.type, 'fughdkugh')
},
methods: { methods: {
toExamData(row) { toExamData(row) {
// this.$router.push({ // this.$router.push({
...@@ -48,6 +57,16 @@ export default { ...@@ -48,6 +57,16 @@ export default {
// row: row // row: row
// } // }
// }) // })
},
sortChange(columns) {
console.log(columns, '123')
if (columns.order === 'ascending') {
this.tableOptions.remote.params.sort = columns.prop
} else {
columns.prop = '-' + columns.prop
this.tableOptions.remote.params.sort = columns.prop
}
this.$refs.list.refetch()
} }
} }
} }
......
...@@ -4,8 +4,8 @@ const routes = [ ...@@ -4,8 +4,8 @@ const routes = [
component: () => import('@/components/layout/index.vue'), component: () => import('@/components/layout/index.vue'),
children: [ children: [
{ path: '/teacher/data/test', component: () => import('./views/List.vue') }, { path: '/teacher/data/test', component: () => import('./views/List.vue') },
{ path: '/teacher/data/classList', component: () => import('./views/ClassList.vue') }, { path: '/teacher/data/classList', component: () => import('../exam/views/ClassList.vue') },
{ path: '/teacher/data/person', component: () => import('./views/PersonalList.vue') }, { path: '/teacher/data/person', component: () => import('../exam/views/PersonalList.vue') },
{ path: '/teacher/data/testData', component: () => import('../exam/views/ExamData.vue') } { path: '/teacher/data/testData', component: () => import('../exam/views/ExamData.vue') }
] ]
} }
......
<template>
<div>
<div style="font-size: 32px; margin-bottom: 15px">测试班级一</div>
<app-card>
<h1 class="title" style="font-size: 28px">班级排名</h1>
<el-button type="text" style="float: right; margin-top: -40px">导出</el-button>
<el-tabs v-model="tabActive" style="margin-top: 30px">
<el-tab-pane label="已结束" name="baseInfo">
<Finished />
</el-tab-pane>
<el-tab-pane label="待评价" name="contacts" lazy>
<Finished />
</el-tab-pane>
<el-tab-pane label="未作答" name="project" lazy>
<Finished />
</el-tab-pane>
</el-tabs>
</app-card>
</div>
</template>
<script>
import Finished from '../components/Finished.vue'
export default {
components: { Finished },
data() {
return {
tabActive: 'baseInfo'
}
}
}
</script>
...@@ -81,7 +81,10 @@ export default { ...@@ -81,7 +81,10 @@ export default {
this.$router.push({ this.$router.push({
path: '/teacher/data/classList', path: '/teacher/data/classList',
query: { query: {
row: row course_id: row.course_id,
chapter_id: row.chapter_id,
type: 'chapter'
// examination_name: row.examination_name
} }
}) })
}, },
......
<template>
<app-container>
<app-list v-bind="tableOptions" ref="list">
<template #header-aside>
<el-button type="text" style="margin-top: 5px; font-size: 24px">导出</el-button>
</template>
<!-- 操作 -->
<template v-slot:table-operate="{ row }">
<el-button type="text" size="mini" @click="toDetail(row)">查看</el-button>
</template>
</app-list>
</app-container>
</template>
<script>
export default {
data() {
return {}
},
computed: {
// 列表配置
tableOptions() {
return {
remote: {},
filters: [{ type: 'input', prop: 'class_name', placeholder: '学生姓名', label: '学生姓名' }],
columns: [
{ label: '学生姓名', prop: 'paper_title', align: 'center' },
{ label: '总得分', prop: 'class_name', align: 'center' },
{ label: '主观题得分', prop: 'commit_num', align: 'center' },
{ label: '客观题得分', prop: 'qwrw4t', align: 'center' },
{ label: '完成时间', prop: 'etwtw', align: 'center' },
{ label: '状态', prop: 'sdgerte', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center' }
],
data: [{ paper_title: '99' }]
}
}
},
methods: {
toDetail(row) {
// this.$router.push({
// path:'',
// query:{
// row:row
// }
// })
}
}
}
</script>
...@@ -14,20 +14,20 @@ const httpRequest = axios.create({ ...@@ -14,20 +14,20 @@ const httpRequest = axios.create({
// 请求拦截 // 请求拦截
httpRequest.interceptors.request.use( httpRequest.interceptors.request.use(
function(config) { function (config) {
if (config.headers['Content-Type'] === 'application/x-www-form-urlencoded') { if (config.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
config.data = qs.stringify(config.data) config.data = qs.stringify(config.data)
} }
return config return config
}, },
function(error) { function (error) {
return Promise.reject(error) return Promise.reject(error)
} }
) )
// 响应拦截 // 响应拦截
httpRequest.interceptors.response.use( httpRequest.interceptors.response.use(
function(response) { function (response) {
const { data } = response const { data } = response
if (data.code) { if (data.code) {
Message.error(data.msg || data.message) Message.error(data.msg || data.message)
...@@ -35,7 +35,7 @@ httpRequest.interceptors.response.use( ...@@ -35,7 +35,7 @@ httpRequest.interceptors.response.use(
} }
return data return data
}, },
function(error) { function (error) {
if (error.response) { if (error.response) {
const { status, message, code } = error.response.data const { status, message, code } = error.response.data
// 未登录 // 未登录
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论