testMultiClassReport.vue
3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<template>
<div style="margin-right: 20px;width: 100%">
<el-row class="row-type">
<label>报表类型</label>
<el-select class="opration-select" v-model="currentType" style="margin-left: 10px;">
<el-option v-for="(item, index) in types" :lable="item" :key="index" :value="item" />
</el-select>
</el-row>
<el-row class="row-type" style="margin-top: 10px;">
<el-table v-if="$props.params" class="default-table" :data="listReport">
<el-table-column prop="subjectName" label="科目" width="100" />
<el-table-column prop="paperName" label="试卷名称" />
<el-table-column prop="classCorrectRate" label="已考班级">
<template slot-scope="scoped">
<el-checkbox-group v-model="scoped.row.checkedClassList">
<el-checkbox :key="index" v-for="(item, index) in scoped.row.classInfos"
:label="item.classId">
{{ item.className }}
</el-checkbox>
</el-checkbox-group>
</template>
</el-table-column>
<el-table-column prop="score" label="卷面分" width="100" />
<el-table-column label="操作" width="100">
<template slot-scope="scoped">
<el-button type="text" @click="_linkToDetail(scoped.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</div>
</template>
<script>
export default {
name: "testMultiClassReport",
props: {
params: null
},
async created() {
this.role =
this.$store.getters.info.showRole ||
this.$store.getters.info.permissions[0].role;
await this._loadDatas();
},
watch: {
async 'currentType'(value) {
await this._loadDatas();
}
},
methods: {
_linkToDetail(dataRow) {
this.$router.push({
path: "/testReportDetail",
query: {
dataType: 3,
classIds: dataRow.checkedClassList.join(","),
id: dataRow.paperId,
title: dataRow.paperName,
subjectName: dataRow.subjectName,
diffType: this.currentType,
},
});
},
async _loadDatas() {
var dataRequestParams = {
classIds: this.$props.params.class ? [this.$props.params.class] :
this.$props.params.classIds ? [...this.$props.params.classIds] : null,
diffType: this.currentType == "任课班级对比" ? "1" : "0",
end: this.$props.params.dataRange ? this.$props.params.dataRange[1] : null,
start: this.$props.params.dataRange ? this.$props.params.dataRange[0] : null,
subjects: this.$props.params.subject ? [this.$props.params.subject] :
this.$props.params.subjects ? [...this.$props.params.subjects] : null
};
var dataRequest = this.$request.tListExamReport;
var dataResponse = await dataRequest({ ...dataRequestParams });
if (dataResponse.status != 0) {
this.$message.error(response.info);
return;
}
this.listReport = dataResponse.data.map(item => {
item.checkedClassList = item.classInfos.map(item => item.classId);
return item;
})
},
},
data() {
return {
listReport: [],
role: "",
types: ["任课班级对比", "年级对比"],
currentType: "任课班级对比",
};
},
};
</script>
<style scoped></style>