|
@@ -27,6 +27,12 @@
|
|
<script>
|
|
<script>
|
|
import BaseTable from '@/components/student-analysis/total/BaseMyTable.vue'
|
|
import BaseTable from '@/components/student-analysis/total/BaseMyTable.vue'
|
|
export default {
|
|
export default {
|
|
|
|
+ props:{
|
|
|
|
+ subjectIndex:{
|
|
|
|
+ type:Number,
|
|
|
|
+ default:NaN
|
|
|
|
+ }
|
|
|
|
+ },
|
|
components: {
|
|
components: {
|
|
BaseTable
|
|
BaseTable
|
|
},
|
|
},
|
|
@@ -39,7 +45,11 @@
|
|
tipContent: '',
|
|
tipContent: '',
|
|
classList: [],
|
|
classList: [],
|
|
joinNum: 0,
|
|
joinNum: 0,
|
|
|
|
+ isAllSubject:true,
|
|
|
|
+ curSubjectIndex:0,
|
|
analysisJson:'',
|
|
analysisJson:'',
|
|
|
|
+ originNumberColumns:[],
|
|
|
|
+ originRateColumns:[],
|
|
entryNumberColumns: [
|
|
entryNumberColumns: [
|
|
{
|
|
{
|
|
title: this.$t('totalAnalysis.base_name'),
|
|
title: this.$t('totalAnalysis.base_name'),
|
|
@@ -108,7 +118,7 @@
|
|
{
|
|
{
|
|
title: this.$t('totalAnalysis.ach_text8'),
|
|
title: this.$t('totalAnalysis.ach_text8'),
|
|
key: 'entryNum',
|
|
key: 'entryNum',
|
|
- sortable: true
|
|
|
|
|
|
+ sortable: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: this.$t('totalAnalysis.ach_text9'),
|
|
title: this.$t('totalAnalysis.ach_text9'),
|
|
@@ -141,6 +151,9 @@
|
|
|
|
|
|
this.analysisJson = this.getAnalysisJson
|
|
this.analysisJson = this.getAnalysisJson
|
|
console.log(this.analysisJson)
|
|
console.log(this.analysisJson)
|
|
|
|
+
|
|
|
|
+ this.originNumberColumns = JSON.parse(JSON.stringify(this.entryNumberColumns))
|
|
|
|
+ this.originRateColumns = JSON.parse(JSON.stringify(this.entryRateColumns))
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
@@ -150,16 +163,28 @@
|
|
// 渲染进线表格
|
|
// 渲染进线表格
|
|
let subjectList = data.classes[0].subjects
|
|
let subjectList = data.classes[0].subjects
|
|
let subjectColumns = []
|
|
let subjectColumns = []
|
|
- subjectList.forEach(item => {
|
|
|
|
|
|
+ subjectList.forEach((item,index) => {
|
|
let subjectColumn = {
|
|
let subjectColumn = {
|
|
title: item.name,
|
|
title: item.name,
|
|
sortable: 'custom',
|
|
sortable: 'custom',
|
|
key: item.name
|
|
key: item.name
|
|
}
|
|
}
|
|
- subjectColumns.push(subjectColumn)
|
|
|
|
|
|
+ if(this.isAllSubject || (!this.isAllSubject && this.curSubjectIndex === index )){
|
|
|
|
+ subjectColumns.push(subjectColumn)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
// 清除之前的科目columns 添加当前评测的科目columns
|
|
// 清除之前的科目columns 添加当前评测的科目columns
|
|
this.entryNumberColumns.splice(4,this.entryNumberColumns.length - 4,...subjectColumns)
|
|
this.entryNumberColumns.splice(4,this.entryNumberColumns.length - 4,...subjectColumns)
|
|
|
|
+ console.log(this.isAllSubject)
|
|
|
|
+ // if(!this.isAllSubject){
|
|
|
|
+ // this.entryRateColumns = this.originRateColumns.filter(i => i.key !== 'entryNum')
|
|
|
|
+ // this.entryNumberColumns = this.originNumberColumns.filter(i => i.key !== 'score')
|
|
|
|
+ // }else{
|
|
|
|
+ // this.entryRateColumns = this.originRateColumns
|
|
|
|
+ // this.entryNumberColumns = this.originNumberColumns
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ console.log(this.entryRateColumns)
|
|
},
|
|
},
|
|
|
|
|
|
/* 获取进线情况统计表格数据 */
|
|
/* 获取进线情况统计表格数据 */
|
|
@@ -170,11 +195,13 @@
|
|
name:stu.name,
|
|
name:stu.name,
|
|
className:stu.className,
|
|
className:stu.className,
|
|
gradeRank:0,
|
|
gradeRank:0,
|
|
- score:stu.total,
|
|
|
|
|
|
+ score:this.isAllSubject ? stu.total : stu.subjects[this.curSubjectIndex].score,
|
|
})
|
|
})
|
|
// 动态添加学生每个科目的得分
|
|
// 动态添加学生每个科目的得分
|
|
- stu.subjects.forEach(subject => {
|
|
|
|
- result[stuIndex][subject.name] = subject.score
|
|
|
|
|
|
+ stu.subjects.forEach((subject,subjectIndex)=> {
|
|
|
|
+ if(this.isAllSubject || (!this.isAllSubject && this.curSubjectIndex === subjectIndex )){
|
|
|
|
+ result[stuIndex][subject.name] = subject.score
|
|
|
|
+ }
|
|
})
|
|
})
|
|
})
|
|
})
|
|
/* 根据表格每个学生的总分来进行排序 */
|
|
/* 根据表格每个学生的总分来进行排序 */
|
|
@@ -187,6 +214,7 @@
|
|
|
|
|
|
/* 获取进线率统计数据 */
|
|
/* 获取进线率统计数据 */
|
|
getEntryBarData(analysisJson){
|
|
getEntryBarData(analysisJson){
|
|
|
|
+ console.log(this.isAllSubject)
|
|
let result = []
|
|
let result = []
|
|
analysisJson.classes.forEach((classItem,classIndex) => {
|
|
analysisJson.classes.forEach((classItem,classIndex) => {
|
|
result.push({
|
|
result.push({
|
|
@@ -194,10 +222,10 @@
|
|
className:classItem.className,
|
|
className:classItem.className,
|
|
entryNum:classItem.lineCount,
|
|
entryNum:classItem.lineCount,
|
|
totalNum:classItem.stuCount,
|
|
totalNum:classItem.stuCount,
|
|
- csRate:classItem.csRate + '%',
|
|
|
|
|
|
+ csRate:this.isAllSubject ? classItem.csRate + '%' : classItem.subjects[this.curSubjectIndex].sRate + '%',
|
|
overAverageRate:classItem.stuCount > 0 ? ((classItem.lineCount / classItem.stuCount) * 100).toFixed(2) : 0.00,
|
|
overAverageRate:classItem.stuCount > 0 ? ((classItem.lineCount / classItem.stuCount) * 100).toFixed(2) : 0.00,
|
|
- average:classItem.totalAverage.toFixed(1),
|
|
|
|
- standardDeviation:classItem.standardDeviation.toFixed(1),
|
|
|
|
|
|
+ average:this.isAllSubject ? classItem.totalAverage.toFixed(1) : classItem.subjects[this.curSubjectIndex].average.toFixed(1),
|
|
|
|
+ standardDeviation:this.isAllSubject ? classItem.standardDeviation.toFixed(1) : classItem.subjects[this.curSubjectIndex].standard.toFixed(1),
|
|
})
|
|
})
|
|
})
|
|
})
|
|
/* 根据超均率 来对班级进行年级排名 */
|
|
/* 根据超均率 来对班级进行年级排名 */
|
|
@@ -227,6 +255,7 @@
|
|
this.entryRateColumns[1].filters = filterArr
|
|
this.entryRateColumns[1].filters = filterArr
|
|
this.entryNumberColumns[1].filters = filterArr
|
|
this.entryNumberColumns[1].filters = filterArr
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
getAnalysisJson() {
|
|
getAnalysisJson() {
|
|
@@ -239,7 +268,17 @@
|
|
this.renderColumns(val)
|
|
this.renderColumns(val)
|
|
this.entryTableData = this.getTableDatas(val)
|
|
this.entryTableData = this.getTableDatas(val)
|
|
this.entryBarData = this.getEntryBarData(val)
|
|
this.entryBarData = this.getEntryBarData(val)
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ subjectIndex:{
|
|
|
|
+ handler(n,o){
|
|
|
|
+ this.isAllSubject = isNaN(n)
|
|
|
|
+ this.curSubjectIndex = n
|
|
|
|
+ let val = this.$store.state.totalAnalysis.analysisJson
|
|
|
|
+ this.renderColumns(val)
|
|
|
|
+ this.entryTableData = this.getTableDatas(val)
|
|
|
|
+ this.entryBarData = this.getEntryBarData(val)
|
|
|
|
+ },
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|