|
@@ -1,25 +1,25 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <div class="achievement-report">
|
|
|
<div class="report-head student-check">
|
|
|
<div class="filter-type">
|
|
|
<div>
|
|
|
<span class="type-name">{{ $t('studentWeb.baseInfo.examMode') }}:</span>
|
|
|
- <RadioGroup v-model="sourceType" type="button" button-style="solid">
|
|
|
+ <RadioGroup v-model="filterType.sourceType" type="button" button-style="solid">
|
|
|
<Radio v-for="(item, index) in sourceTypeList" :key="index" :label="item.type">{{ item.name }}</Radio>
|
|
|
</RadioGroup>
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <!-- <div>
|
|
|
<span class="type-name">{{ $t('studentWeb.baseInfo.examStatus') }}:</span>
|
|
|
<RadioGroup v-model="examType" type="button" button-style="solid">
|
|
|
<Radio v-for="(item, index) in examTypeList" :key="index + 1" :label="item.type">{{ item.name }}</Radio>
|
|
|
</RadioGroup>
|
|
|
- </div>
|
|
|
- <!-- <div>
|
|
|
- <span class="type-name">{{ $t('studentWeb.wrongTopic.subject') }}:</span>
|
|
|
- <RadioGroup v-model="ownerType" type="button" button-style="solid">
|
|
|
+ </div> -->
|
|
|
+ <div>
|
|
|
+ <span class="type-name">{{ $t('studentWeb.baseInfo.examStatus') }}:</span>
|
|
|
+ <RadioGroup v-model="filterType.ownerType" type="button" button-style="solid">
|
|
|
<Radio v-for="(item, index) in ownerTypeList" :key="index" :label="item.type">{{ item.name }}</Radio>
|
|
|
</RadioGroup>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<p class="base-info">
|
|
|
<span v-if="classInfo.teaName">
|
|
@@ -36,18 +36,19 @@
|
|
|
</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
- <Table :columns="schoolRepCol" :data="showSchoolRep" row-key="id">
|
|
|
+ <!-- <Table :columns="schoolRepCol" :data="showSchoolRep" :span-method="handleSpan"> -->
|
|
|
+ <Table :columns="schoolRepCol" :data="showSchoolRep" height="550">
|
|
|
<template slot-scope="{ row }" slot="tag">
|
|
|
<!-- <p>{{ row.name }}</p> -->
|
|
|
- <span class="tag-style">{{ row.tag.owner }}</span>
|
|
|
- <span class="tag-style">{{ row.tag.source }}</span>
|
|
|
- <span class="tag-style">{{ row.tag.type }}</span>
|
|
|
+ <span class="tag-style">{{ row.tag.owner === 'school' ? $t('studentWeb.public.school') : $t('studentWeb.public.private')}}</span>
|
|
|
+ <span class="tag-style" v-if="row.tag.source">{{ row.tag.source }}</span>
|
|
|
+ <span class="tag-style" v-if="row.tag.type">{{ row.tag.type }}</span>
|
|
|
<!-- <span class="tag-style">{{ row.tag.class }}</span> -->
|
|
|
- <span class="tag-style">{{ row.tag.list }}</span>
|
|
|
+ <!-- <span class="tag-style">{{ row.tag.list }}</span> -->
|
|
|
</template>
|
|
|
- <template slot-scope="{ row }" slot="score">
|
|
|
+ <!-- <template slot-scope="{ row }" slot="score">
|
|
|
<span v-for="(item, index) in row.score" :key="index" style="margin-right: 10px;">{{ item }}</span>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</Table>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -55,6 +56,8 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
name: "",
|
|
|
+ components: {
|
|
|
+ },
|
|
|
props: {
|
|
|
classInfo: {
|
|
|
type: Object,
|
|
@@ -66,188 +69,88 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
schoolRepCol: [
|
|
|
+ /* {
|
|
|
+ width: 50,
|
|
|
+ type: 'expand',
|
|
|
+ }, */
|
|
|
{
|
|
|
title: '评测名称',
|
|
|
// slot: "name",
|
|
|
- key: 'name',
|
|
|
- tree: true,
|
|
|
+ key: 'examName',
|
|
|
+ align: "center"
|
|
|
+ // tree: true,
|
|
|
// width: 500,
|
|
|
},
|
|
|
/* {
|
|
|
- title: '课程',
|
|
|
- key: 'class'
|
|
|
+ title: '创建人',
|
|
|
+ key: 'creator',
|
|
|
+ align: "center"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '学科',
|
|
|
+ key: 'class',
|
|
|
+ align: "center"
|
|
|
}, */
|
|
|
{
|
|
|
- title: '创建人',
|
|
|
- key: 'creator'
|
|
|
+ title: '分数',
|
|
|
+ // slot: "score",
|
|
|
+ key: "score",
|
|
|
+ align: "center"
|
|
|
},
|
|
|
{
|
|
|
- title: '标签',
|
|
|
+ title: '类型',
|
|
|
slot: "tag",
|
|
|
width: 500,
|
|
|
+ align: "center"
|
|
|
},
|
|
|
/* {
|
|
|
title: '名单',
|
|
|
key: 'list'
|
|
|
}, */
|
|
|
- {
|
|
|
- title: '分数',
|
|
|
- slot: "score",
|
|
|
- },
|
|
|
{
|
|
|
title: '时间',
|
|
|
- key: 'time'
|
|
|
+ key: 'time',
|
|
|
+ align: "center"
|
|
|
}
|
|
|
],
|
|
|
- schoolRep: [
|
|
|
- {
|
|
|
- id: "1111111111111111",
|
|
|
- name: '评测名称11111111',
|
|
|
- class: '课程111',
|
|
|
- tag: {
|
|
|
- owner: "校级",
|
|
|
- source: "课中评测",
|
|
|
- type: "正规考",
|
|
|
- class: '课程111',
|
|
|
- list: '名单1111111111',
|
|
|
- },
|
|
|
- creator: '罗老师',
|
|
|
- list: '名单1111111111',
|
|
|
- score: [67, 85],
|
|
|
- time: '2021-06-27',
|
|
|
- children: [
|
|
|
- {
|
|
|
- id: "1111111111111112",
|
|
|
- name: '英语',
|
|
|
- class: '课程111',
|
|
|
- tag: {
|
|
|
- owner: "校级",
|
|
|
- source: "课中评测",
|
|
|
- type: "正规考",
|
|
|
- class: '课程111',
|
|
|
- list: '名单1111111111',
|
|
|
- },
|
|
|
- creator: '罗老师',
|
|
|
- list: '名单1111111111',
|
|
|
- score: [67],
|
|
|
- time: '2021-06-27',
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1111111111111113",
|
|
|
- name: '数学',
|
|
|
- class: '课程111',
|
|
|
- tag: {
|
|
|
- owner: "校级",
|
|
|
- source: "课中评测",
|
|
|
- type: "正规考",
|
|
|
- class: '课程111',
|
|
|
- list: '名单1111111111',
|
|
|
- },
|
|
|
- creator: '罗老师',
|
|
|
- list: '名单1111111111',
|
|
|
- score: [85],
|
|
|
- time: '2021-06-27',
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- id: "2222222222222222",
|
|
|
- name: '评测名称222222222',
|
|
|
- class: '课程3222222222',
|
|
|
- tag: {
|
|
|
- owner: "个人",
|
|
|
- source: "线上评测",
|
|
|
- type: "模拟考",
|
|
|
- class: '课程3222222222',
|
|
|
- list: '名单22222',
|
|
|
- },
|
|
|
- creator: '罗老师',
|
|
|
- list: '名单22222',
|
|
|
- score: [97],
|
|
|
- time: '2022-01-14',
|
|
|
- },
|
|
|
- {
|
|
|
- id: "33333333333",
|
|
|
- name: '评测名称3333333',
|
|
|
- class: '课程3333333',
|
|
|
- tag: {
|
|
|
- owner: "个人",
|
|
|
- source: "线上评测",
|
|
|
- type: "模拟考",
|
|
|
- class: '课程3333333',
|
|
|
- list: '名单43333333333',
|
|
|
- },
|
|
|
- creator: '罗老师',
|
|
|
- list: '名单43333333333',
|
|
|
- score: [10],
|
|
|
- time: '2022-01-14',
|
|
|
- },
|
|
|
- {
|
|
|
- id: "4444444444",
|
|
|
- name: '评测名称4444',
|
|
|
- class: '课程444',
|
|
|
- tag: {
|
|
|
- owner: "个人",
|
|
|
- source: "线上评测",
|
|
|
- type: "模拟考",
|
|
|
- class: '课程444',
|
|
|
- list: '名单4444',
|
|
|
- },
|
|
|
- creator: '罗老师',
|
|
|
- list: '名单4444',
|
|
|
- score: [61],
|
|
|
- time: '2022-01-14',
|
|
|
- },
|
|
|
- {
|
|
|
- id: "555555555555",
|
|
|
- name: '评测名称55',
|
|
|
- class: '课程5555555555555555555',
|
|
|
- tag: {
|
|
|
- owner: "个人",
|
|
|
- source: "线上评测",
|
|
|
- type: "模拟考",
|
|
|
- class: '课程5555555555555555555',
|
|
|
- list: '名单5555555',
|
|
|
- },
|
|
|
- creator: '罗老师',
|
|
|
- list: '名单5555555',
|
|
|
- score: [27],
|
|
|
- time: '2022-01-14',
|
|
|
- },
|
|
|
- ],
|
|
|
- nowRow: undefined,
|
|
|
+ schoolRep: [],
|
|
|
+ showSchoolRep: [],
|
|
|
+ filterType: {
|
|
|
+ ownerType: "all",
|
|
|
+ sourceType: "all",
|
|
|
+ },
|
|
|
ownerType: "all",
|
|
|
- sourceType: -1,
|
|
|
+ sourceType: "all",
|
|
|
examType: "all",
|
|
|
ownerTypeList: [
|
|
|
{
|
|
|
type: "all",
|
|
|
name: this.$t('studentWeb.type.all')
|
|
|
},
|
|
|
- {
|
|
|
- type: "private",
|
|
|
- name: this.$t('studentWeb.public.private')
|
|
|
- },
|
|
|
{
|
|
|
type: "school",
|
|
|
name: this.$t('studentWeb.public.school')
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "teacher",
|
|
|
+ name: this.$t('studentWeb.public.private')
|
|
|
+ },
|
|
|
],
|
|
|
sourceTypeList: [
|
|
|
{
|
|
|
- type: -1,
|
|
|
+ type: "all",
|
|
|
name: this.$t('studentWeb.type.all')
|
|
|
},
|
|
|
{
|
|
|
- type: 0,
|
|
|
+ type: "0",
|
|
|
name: this.$t("studentWeb.exam.source.evMode1")
|
|
|
},
|
|
|
{
|
|
|
- type: 1,
|
|
|
+ type: "1",
|
|
|
name: this.$t("studentWeb.exam.source.evMode2")
|
|
|
},
|
|
|
{
|
|
|
- type: 2,
|
|
|
+ type: "2",
|
|
|
name: this.$t("studentWeb.exam.source.evMode3")
|
|
|
},
|
|
|
],
|
|
@@ -269,74 +172,127 @@ export default {
|
|
|
name: this.$t('totalAnalysis.ti_text6')
|
|
|
},
|
|
|
],
|
|
|
- showSchoolRep: [],
|
|
|
+ num: [],
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
- this.showSchoolRep = this.schoolRep
|
|
|
+ /* this.showSchoolRep.forEach((item, index) => {
|
|
|
+ for (let i = index + 1; i < this.showSchoolRep.length; i++) {
|
|
|
+ if(item.id === this.showSchoolRep[i].id && !this.num.includes(index)) {
|
|
|
+ this.num.push(i)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }); */
|
|
|
+ this.getReportList(this.classInfo)
|
|
|
},
|
|
|
methods: {
|
|
|
+ getReportList(classInfo) {
|
|
|
+ this.showSchoolRep = []
|
|
|
+ console.log(classInfo);
|
|
|
+ let cId = classInfo.classId.concat(classInfo.stuList)
|
|
|
+ let param = {
|
|
|
+ courseId: classInfo.id,
|
|
|
+ // code: classInfo.scope === "school" ? classInfo.school : classInfo.creatorId,
|
|
|
+ cId,
|
|
|
+ stuId: this.$store.state.userInfo.sub,
|
|
|
+ }
|
|
|
+ if(classInfo.subject.id) {
|
|
|
+ param.subjectId = classInfo.subject.id
|
|
|
+ }
|
|
|
+ this.$api.studentWeb.getClassScore(param).then(res => {
|
|
|
+ // 404表示没有评测记录
|
|
|
+ if(res.code === 404) {
|
|
|
+ // this.showSchoolRep = []
|
|
|
+ } else if(res.info) {
|
|
|
+ res.info.forEach(item => {
|
|
|
+ item.tag = {
|
|
|
+ source: item.source === '0' ? this.$t("studentWeb.exam.source.evMode1")
|
|
|
+ : (item.source === '1' ? this.$t("studentWeb.exam.source.evMode2")
|
|
|
+ : (item.source === '2' ? this.$t("studentWeb.exam.source.evMode3") : null)),
|
|
|
+ type: (item.eType && item.eType.id) ? item.eType.name : null,
|
|
|
+ owner: item.owner
|
|
|
+ }
|
|
|
+ item.total = 0
|
|
|
+ // 学校评测才会存在多科,要匹配对应的科目
|
|
|
+ if(item.owner === 'school') {
|
|
|
+ let subIndex = item.subject.findIndex(sub => {
|
|
|
+ return sub.id === classInfo.subject.id
|
|
|
+ })
|
|
|
+ if(subIndex != -1) {
|
|
|
+ item.point[subIndex].forEach(point => {
|
|
|
+ item.total += point
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 个人评测只存在一张试卷
|
|
|
+ item.point[0].forEach(point => {
|
|
|
+ item.total += point
|
|
|
+ })
|
|
|
+ }
|
|
|
+ item.time = this.dateFormat(item.createTime)
|
|
|
+ item.score = `${item.sum} / ${item.total}`
|
|
|
+ this.schoolRep.push(item)
|
|
|
+ })
|
|
|
+ this.schoolRep.reverse()
|
|
|
+ this.showSchoolRep = [...this.schoolRep]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //时间格式化处理
|
|
|
+ dateFormat(timestamp) {
|
|
|
+ var date = new Date(timestamp)
|
|
|
+ var Y = date.getFullYear() + '-'
|
|
|
+ var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
|
|
|
+ var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
|
|
|
+ var H = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ":"
|
|
|
+ var Min = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes())
|
|
|
+ var S = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()) + " "
|
|
|
+ return Y + M + D + H + Min;
|
|
|
+ },
|
|
|
handleSpan ({ row, column, rowIndex, columnIndex }) {
|
|
|
- console.log(this.schoolRep[rowIndex + 1]);
|
|
|
- if(this.schoolRep[rowIndex + 1]) {
|
|
|
- if(row.id === this.schoolRep[rowIndex + 1].id) {
|
|
|
- // if (columnIndex === 0) {
|
|
|
- return [row + 1, 1];
|
|
|
- // }
|
|
|
- // return [2, 3]
|
|
|
+ // 要把后面相同的使用[0, 0]隐藏掉
|
|
|
+ if(this.num.includes(rowIndex)) {
|
|
|
+ if(columnIndex != 2 && columnIndex != 3) {
|
|
|
+ return [0, 0]
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(columnIndex != 2 && columnIndex != 3) {
|
|
|
+ let x = row.mergeCol ? row.mergeCol : 1
|
|
|
+ let y = 1
|
|
|
+ return [x, y]
|
|
|
}
|
|
|
}
|
|
|
- // console.log(row, column, rowIndex, columnIndex);
|
|
|
- /* if (rowIndex === 0 && columnIndex === 0) {
|
|
|
- return [2, 3]; //2行3列
|
|
|
- } else if (rowIndex === 0 && columnIndex === 1) {
|
|
|
- return [0, 0];
|
|
|
- } */
|
|
|
- /* if (rowIndex === 1 && columnIndex === 0) {
|
|
|
- return {
|
|
|
- rowspan: 3, //向下合并3格
|
|
|
- colspan: 4, //向右合并4格
|
|
|
- };
|
|
|
- } else if (rowIndex === 3 && columnIndex === 0) {
|
|
|
- return {
|
|
|
- rowspan: 0,
|
|
|
- colspan: 0
|
|
|
- };
|
|
|
- } */
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- ownerType: {
|
|
|
+ filterType: {
|
|
|
+ deep: true,
|
|
|
handler(n, o) {
|
|
|
- if(n === "private") {
|
|
|
+ this.showSchoolRep = []
|
|
|
+ if(n.sourceType === '0') {
|
|
|
+ this.showSchoolRep = this.schoolRep.filter(item => {
|
|
|
+ return item.source === '0'
|
|
|
+ })
|
|
|
+ } else if(n.sourceType === '1') {
|
|
|
this.showSchoolRep = this.schoolRep.filter(item => {
|
|
|
- return item.tag.owner === "个人"
|
|
|
+ return item.source === '1'
|
|
|
})
|
|
|
- } else if(n === "school") {
|
|
|
+ } else if(n.sourceType === '2') {
|
|
|
this.showSchoolRep = this.schoolRep.filter(item => {
|
|
|
- return item.tag.owner === "校级"
|
|
|
+ return item.source === '2'
|
|
|
})
|
|
|
} else {
|
|
|
this.showSchoolRep = this.schoolRep
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- sourceType: {
|
|
|
- handler(n, o) {
|
|
|
- if(n === 0) {
|
|
|
- this.showSchoolRep = this.schoolRep.filter(item => {
|
|
|
- return item.tag.owner === "线上评测"
|
|
|
- })
|
|
|
- } else if(n === 1) {
|
|
|
- this.showSchoolRep = this.schoolRep.filter(item => {
|
|
|
- return item.tag.owner === "课中评测"
|
|
|
+
|
|
|
+ if(n.ownerType === "teacher") {
|
|
|
+ this.showSchoolRep = this.showSchoolRep.filter(item => {
|
|
|
+ return item.owner === "teacher"
|
|
|
})
|
|
|
- } else if(n === 2) {
|
|
|
- this.showSchoolRep = this.schoolRep.filter(item => {
|
|
|
- return item.tag.owner === "阅卷评测"
|
|
|
+ } else if(n.ownerType === "school") {
|
|
|
+ this.showSchoolRep = this.showSchoolRep.filter(item => {
|
|
|
+ return item.owner === "school"
|
|
|
})
|
|
|
- } else {
|
|
|
- this.showSchoolRep = this.schoolRep
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -350,4 +306,10 @@ export default {
|
|
|
|
|
|
<style lang="less">
|
|
|
@import "../../WrongQusetion/iViewStyle.less";
|
|
|
+
|
|
|
+.achievement-report {
|
|
|
+ .ivu-tabs-tabpane td:nth-child(2) {
|
|
|
+ text-align: center !important;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|