|
@@ -14,19 +14,19 @@
|
|
|
<span class="component-title" style="margin-top:40px">{{ this.$t('totalAnalysis.classBaseInfo') }}</span>
|
|
|
</Row>
|
|
|
<Row class-name="component-percents">
|
|
|
- <div class="percent-item warning-info-item">
|
|
|
+ <div class="percent-item warning-info-item" v-show="isAllSubject">
|
|
|
<div class="fl-col-center">
|
|
|
<span class="percent-name">{{ this.$t('totalAnalysis.ach_text11') }}</span>
|
|
|
<span class="percent-value">{{ currentClass.stuCount || 0 }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="percent-item warning-info-item">
|
|
|
+ <div class="percent-item warning-info-item" v-show="isAllSubject">
|
|
|
<div class="fl-col-center">
|
|
|
<span class="percent-name">{{ this.$t('totalAnalysis.ach_text8') }}</span>
|
|
|
<span class="percent-value">{{ currentClass.lineCount || 0 }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="percent-item">
|
|
|
+ <div class="percent-item" v-show="isAllSubject">
|
|
|
<div class="fl-col-center">
|
|
|
<span class="percent-name">{{ this.$t('totalAnalysis.ach_text9') }}</span>
|
|
|
<span class="percent-value">{{ ((currentClass.lineCount / currentClass.stuCount) * 100).toFixed(1) }}%</span>
|
|
@@ -88,6 +88,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isAllSubject:true,
|
|
|
scoreRateBarData:{
|
|
|
students:[]
|
|
|
},
|
|
@@ -113,24 +114,24 @@
|
|
|
title: this.$t('totalAnalysis.base_name'),
|
|
|
key: 'name',
|
|
|
fixed: 'left',
|
|
|
- minWidth: 100
|
|
|
+ minWidth:100
|
|
|
},
|
|
|
{
|
|
|
title: this.$t('totalAnalysis.base_id'),
|
|
|
key: 'setNo',
|
|
|
- minWidth: 120
|
|
|
+ minWidth:100
|
|
|
},
|
|
|
{
|
|
|
title: this.$t('totalAnalysis.ach_table_text2'),
|
|
|
sortable: 'custom',
|
|
|
key: 'score',
|
|
|
- minWidth: 100
|
|
|
+ minWidth:100
|
|
|
},
|
|
|
{
|
|
|
title: this.$t('totalAnalysis.ach_table_text8'),
|
|
|
key: 'classRank',
|
|
|
- minWidth: 120,
|
|
|
sortable: 'custom',
|
|
|
+ minWidth:200,
|
|
|
renderType: function(h, params) {
|
|
|
return h('span', `${ params.row.classRank } (${ params.row.classPR })`)
|
|
|
}
|
|
@@ -138,8 +139,8 @@
|
|
|
{
|
|
|
title: this.$t('totalAnalysis.ach_table_text9'),
|
|
|
key: 'gradeRank',
|
|
|
- minWidth: 120,
|
|
|
sortable: 'custom',
|
|
|
+ minWidth:200,
|
|
|
renderType: function(h, params) {
|
|
|
return h('span', `${ params.row.gradeRank } (${ params.row.gradePR })`)
|
|
|
}
|
|
@@ -191,13 +192,12 @@
|
|
|
this.$router.back(-1)
|
|
|
this.$parent.isShowQuestions = false
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 获取指定科目的表格数据
|
|
|
* @param subjectIndex
|
|
|
*/
|
|
|
onGetClassTable(subjectIndex) {
|
|
|
- console.log(this.getAnalysisJson)
|
|
|
let result = []
|
|
|
let analysisJson = JSON.parse(JSON.stringify(this.getAnalysisJson))
|
|
|
let curClassItem = analysisJson.classes.filter(i => i.className === this.className)[0]
|
|
@@ -208,11 +208,13 @@
|
|
|
this.currentClass.totalAverage = subjectIndex === 0 ? curClassItem.totalAverage : singleSubjectItem.average
|
|
|
this.currentClass.csRate = subjectIndex === 0 ? curClassItem.csRate : singleSubjectItem.sRate
|
|
|
this.classAverage = subjectIndex === 0 ? curClassItem.totalAverage.toFixed(1) : singleSubjectItem.average
|
|
|
+
|
|
|
// 判断当前选择科目是全科还是单科 赋予不同的值
|
|
|
studentIds.forEach((stuId, stuIndex) => {
|
|
|
let stuItem = analysisJson.students.filter(i => i.id === stuId)[0]
|
|
|
let stuSubjectItem = subjectIndex === 0 ? null : analysisJson.students.filter(i => i.id === stuId)[0].subjects[subjectIndex - 1]
|
|
|
- result.push({
|
|
|
+ let studentItemScores = subjectIndex === 0 ? {} : this.getStudentItemScore(stuIndex,analysisJson,subjectIndex - 1)
|
|
|
+ let baseObj = {
|
|
|
name: stuItem.name,
|
|
|
setNo: stuItem.no,
|
|
|
sRate: subjectIndex === 0 ? stuItem.sRate : stuSubjectItem.sRate,
|
|
@@ -223,9 +225,40 @@
|
|
|
gradeRank: subjectIndex === 0 ? stuItem.gsort : stuSubjectItem.gsort,
|
|
|
areaPR: 0,
|
|
|
areaRank: 0
|
|
|
- })
|
|
|
+ }
|
|
|
+ result.push(Object.assign(baseObj,studentItemScores))
|
|
|
})
|
|
|
+ console.log(result)
|
|
|
this.scoreRateBarData = result
|
|
|
+
|
|
|
+ if(subjectIndex !== 0){
|
|
|
+ // this.earlyPercentColumns.push
|
|
|
+ let itemsLength = analysisJson.paper[subjectIndex - 1].value
|
|
|
+ let itemsColumns = []
|
|
|
+ itemsLength.forEach((i,index) => {
|
|
|
+ itemsColumns.push({
|
|
|
+ title: '题目' + (index + 1),
|
|
|
+ key: 's' + (index + 1),
|
|
|
+ render:null,
|
|
|
+ sortable: "custom",
|
|
|
+ minWidth:100
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.earlyPercentColumns.splice(5,this.earlyPercentColumns.length - 5,...itemsColumns)
|
|
|
+ }
|
|
|
+ console.log(this.earlyPercentColumns)
|
|
|
+
|
|
|
+
|
|
|
+ return result
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 获取每个学生每道题目的得分详细表 */
|
|
|
+ getStudentItemScore(stuIndex,analysisJson,subjectIndex){
|
|
|
+ let itemsLength = analysisJson.paper[subjectIndex].value
|
|
|
+ let result = {}
|
|
|
+ itemsLength.forEach((i,index) => {
|
|
|
+ result['s'+ (index + 1)] = analysisJson.students[stuIndex].subjects[subjectIndex].scores[index]
|
|
|
+ })
|
|
|
return result
|
|
|
},
|
|
|
|
|
@@ -234,7 +267,6 @@
|
|
|
* @param echartData
|
|
|
*/
|
|
|
drawLine(echartData) {
|
|
|
- console.log('预警柱状图', echartData)
|
|
|
let that = this
|
|
|
let myBar = this.$echarts.init(document.getElementById('stuAverageBar'))
|
|
|
var option = {
|
|
@@ -468,6 +500,7 @@
|
|
|
|
|
|
this.$EventBus.$off('onEarlySubjectChange')
|
|
|
this.$EventBus.$on('onEarlySubjectChange', index => {
|
|
|
+ this.isAllSubject = index === 0
|
|
|
this.onSelectChange(index)
|
|
|
})
|
|
|
},
|