|
@@ -78,6 +78,14 @@
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-show="calculating">
|
|
|
|
+ <p style="text-align: center;color: white;margin: 20px 0px;">
|
|
|
|
+ 成绩数据结算中,
|
|
|
|
+ <span style="text-decoration: underline;color: #1cc0f3;cursor: pointer;" @click="reload()">
|
|
|
|
+ 点此刷新
|
|
|
|
+ </span>
|
|
|
|
+ </p>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -88,6 +96,7 @@ export default {
|
|
AvgCompare,
|
|
AvgCompare,
|
|
ScoreMatrix
|
|
ScoreMatrix
|
|
},
|
|
},
|
|
|
|
+ inject: ['reload'],
|
|
props: {
|
|
props: {
|
|
examInfo: {
|
|
examInfo: {
|
|
default: () => {
|
|
default: () => {
|
|
@@ -114,7 +123,8 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
simpleData: {},
|
|
simpleData: {},
|
|
- allData: {}
|
|
|
|
|
|
+ allData: {},
|
|
|
|
+ calculating: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -127,20 +137,26 @@ export default {
|
|
this.$api.learnActivity.simpleAna(requestData).then(
|
|
this.$api.learnActivity.simpleAna(requestData).then(
|
|
res => {
|
|
res => {
|
|
if (!res.error) {
|
|
if (!res.error) {
|
|
- for (let i in res.averageMap) {
|
|
|
|
- for (let j in res.averageMap[i].ClassAverage) {
|
|
|
|
- res.averageMap[i].ClassAverage[j] = parseFloat(res.averageMap[i].ClassAverage[j].toFixed(2))
|
|
|
|
- }
|
|
|
|
- let subject = this.examInfo.papers.find(item=>{
|
|
|
|
- return item.subjectId == res.averageMap[i].subjectId
|
|
|
|
- })
|
|
|
|
- if(subject){
|
|
|
|
- res.averageMap[i].subjectId = subject.subjectName
|
|
|
|
|
|
+ if (res.averageMap.length && res.averageMap.length) {
|
|
|
|
+ this.calculating = false
|
|
|
|
+ for (let i in res.averageMap) {
|
|
|
|
+ for (let j in res.averageMap[i].ClassAverage) {
|
|
|
|
+ res.averageMap[i].ClassAverage[j] = parseFloat(res.averageMap[i].ClassAverage[j].toFixed(2))
|
|
|
|
+ }
|
|
|
|
+ let subject = this.examInfo.papers.find(item => {
|
|
|
|
+ return item.subjectId == res.averageMap[i].subjectId
|
|
|
|
+ })
|
|
|
|
+ if (subject) {
|
|
|
|
+ res.averageMap[i].subjectId = subject.subjectName
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ this.allData[this.examInfo.id] = res
|
|
|
|
+ this.simpleData = res
|
|
|
|
+ } else {
|
|
|
|
+ this.calculating = true
|
|
|
|
+ this.$Message.error('数据结算中,请稍后查看')
|
|
}
|
|
}
|
|
|
|
|
|
- this.allData[this.examInfo.id] = res
|
|
|
|
- this.simpleData = res
|
|
|
|
} else {
|
|
} else {
|
|
this.$Message.error('API ERROR!')
|
|
this.$Message.error('API ERROR!')
|
|
}
|
|
}
|
|
@@ -156,7 +172,7 @@ export default {
|
|
watch: {
|
|
watch: {
|
|
examInfo: {
|
|
examInfo: {
|
|
handler() {
|
|
handler() {
|
|
- console.log('评测信息:',this.examInfo)
|
|
|
|
|
|
+ console.log('评测信息:', this.examInfo)
|
|
if (this.examInfo.progress == 'finish') {
|
|
if (this.examInfo.progress == 'finish') {
|
|
if (this.allData[this.examInfo.id]) {
|
|
if (this.allData[this.examInfo.id]) {
|
|
this.simpleData = this.allData[this.examInfo.id]
|
|
this.simpleData = this.allData[this.examInfo.id]
|
|
@@ -206,23 +222,23 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
scoreSegment() {
|
|
scoreSegment() {
|
|
- if (this.examScore > 0 && this.stuTotalScores.length) {
|
|
|
|
|
|
+ if (this.stuTotalScores.length) {
|
|
let segment = []
|
|
let segment = []
|
|
- let max = Math.max(...this.stuTotalScores)
|
|
|
|
let unit = this.examScore / 10
|
|
let unit = this.examScore / 10
|
|
- for(let i = 0; i < 10; i++){
|
|
|
|
|
|
+ console.log('unit', unit)
|
|
|
|
+ for (let i = 0; i < 10; i++) {
|
|
let startScore = unit * i
|
|
let startScore = unit * i
|
|
let endScore = unit * (i + 1)
|
|
let endScore = unit * (i + 1)
|
|
- let s = this.stuTotalScores.filter(item=>{
|
|
|
|
|
|
+ let s = this.stuTotalScores.filter(item => {
|
|
return item >= startScore && item < endScore
|
|
return item >= startScore && item < endScore
|
|
})
|
|
})
|
|
segment.push({
|
|
segment.push({
|
|
- name:`${startScore}-${endScore}`,
|
|
|
|
- value:s.length
|
|
|
|
|
|
+ name: `${startScore}-${endScore}`,
|
|
|
|
+ value: s.length
|
|
})
|
|
})
|
|
}
|
|
}
|
|
return segment
|
|
return segment
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
return []
|
|
return []
|
|
}
|
|
}
|
|
|
|
|