提交 684c4f7f authored 作者: lihuihui's avatar lihuihui

优化功能

上级 1e52823c
...@@ -188,10 +188,14 @@ export default { ...@@ -188,10 +188,14 @@ export default {
&.stu1{ &.stu1{
border: 2px solid #0FC118; border: 2px solid #0FC118;
line-height: 22px; line-height: 22px;
background: #fff;
color: #999;
} }
&.stu2{ &.stu2{
border: 2px solid #C01540; border: 2px solid #C01540;
line-height: 22px; line-height: 22px;
background: #fff;
color: #999;
} }
&.stu3{ &.stu3{
color: #fff; color: #fff;
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
<script> <script>
export default { export default {
props: { props: {
accuracy: { type: Number } accuracy: { type: Number },
accuracScore: { type: Number }
}, },
data() { data() {
return { return {
...@@ -20,9 +21,11 @@ export default { ...@@ -20,9 +21,11 @@ export default {
} }
}, },
mounted() { mounted() {
const percent = this.accuracy / 100 // setTimeout(() => {
const percent = this.accuracy / this.accuracScore
const perimeter = Math.PI * 2 * 70 const perimeter = Math.PI * 2 * 70
this.data = perimeter * percent + ' ' + perimeter * (1 - percent) this.data = perimeter * percent + ' ' + perimeter * (1 - percent)
// }, 1000)
} }
} }
</script> </script>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<template v-slot:btnBox> <template v-slot:btnBox>
<div class="btn-box"> <div class="btn-box">
<div class="btn" @click="goPage('all')">全部解析</div> <div class="btn" @click="goPage('all')">全部解析</div>
<div class="btn" @click="goPage('err')">错误解析</div> <!-- <div class="btn" @click="goPage('err')">错误解析</div> -->
</div> </div>
</template> </template>
</card> </card>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="card-left"> <div class="card-left">
<div class="title">成绩报告</div> <div class="title">成绩报告</div>
<div class="chart-box"> <div class="chart-box">
<chart :accuracy="accuracy"> <chart :accuracy="accuracy" :accuracScore="accuracScore" v-if="data.sheet">
<template v-slot:tips> <template v-slot:tips>
<div class="num">{{ accuracy }}</div> <div class="num">{{ accuracy }}</div>
<div class="t"></div> <div class="t"></div>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<template v-slot:btnBox> <template v-slot:btnBox>
<div class="btn-box"> <div class="btn-box">
<div class="btn" @click="goPage('all')">全部解析</div> <div class="btn" @click="goPage('all')">全部解析</div>
<div class="btn" @click="goPage('err')">错误解析</div> <!-- <div class="btn" @click="goPage('err')">错误解析</div> -->
</div> </div>
</template> </template>
</card> </card>
...@@ -46,7 +46,8 @@ export default { ...@@ -46,7 +46,8 @@ export default {
data() { data() {
return { return {
data: {}, data: {},
accuracy: 0 accuracy: 0,
accuracScore: 0
} }
}, },
created() { created() {
...@@ -76,7 +77,7 @@ export default { ...@@ -76,7 +77,7 @@ export default {
const data = JSON.parse(response.data) const data = JSON.parse(response.data)
this.data = data this.data = data
this.accuracy = parseInt(data.sheet.score) this.accuracy = parseInt(data.sheet.score)
// console.log(this.accuracy) this.accuracScore = parseInt(data.sheet.questions.total_score)
}) })
.finally(() => { .finally(() => {
// this.loaded = true // this.loaded = true
......
...@@ -31,8 +31,10 @@ export default { ...@@ -31,8 +31,10 @@ export default {
props: { props: {
questionParams: { type: Object, default: () => {} } questionParams: { type: Object, default: () => {} }
}, },
created() {
console.log(this.questionParams, '====123')
},
mounted() { mounted() {
console.log(this.questionParams.card, '====123')
this.msgCenter.$on('monitoringChanges', this.monitoringChanges) this.msgCenter.$on('monitoringChanges', this.monitoringChanges)
}, },
computed: { computed: {
......
...@@ -318,10 +318,14 @@ export default { ...@@ -318,10 +318,14 @@ export default {
}, },
// 缓存 提交 // 缓存 提交
handlePapers(n) { handlePapers(n) {
const answerData = {}
for (const data in this.questionParams.answerRecord) {
answerData[data] = this.questionParams.answerRecord[data].answer
}
const param = { const param = {
type: this.$route.query.type, type: this.$route.query.type,
question_type: this.$route.query.qType, question_type: this.$route.query.qType,
answer: JSON.stringify(this.questionParams.answerRecord) answer: JSON.stringify(answerData)
} }
window.localStorage.answerRecord = JSON.stringify(this.questionParams.answerRecord) window.localStorage.answerRecord = JSON.stringify(this.questionParams.answerRecord)
this.chcheReq(param, () => {}) this.chcheReq(param, () => {})
......
...@@ -89,6 +89,10 @@ export default { ...@@ -89,6 +89,10 @@ export default {
} }
} }
}, },
beforeDestroy() {
this.handlePapers()
clearInterval(this.time.clearTime)
},
mounted() { mounted() {
// 赋值页面高度 // 赋值页面高度
this.contentHeight = parseInt(document.documentElement.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight)) this.contentHeight = parseInt(document.documentElement.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight))
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="card-left"> <div class="card-left">
<div class="title">成绩报告</div> <div class="title">成绩报告</div>
<div class="chart-box"> <div class="chart-box">
<chart :accuracy="accuracy"> <chart :accuracy="accuracy" :accuracScore="accuracScore" v-if="data.sheet">
<template v-slot:tips> <template v-slot:tips>
<div class="num">{{ accuracy }}%</div> <div class="num">{{ accuracy }}%</div>
<div class="t">正确率</div> <div class="t">正确率</div>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<template v-slot:btnBox> <template v-slot:btnBox>
<div class="btn-box"> <div class="btn-box">
<div class="btn" @click="goPage('all')">全部解析</div> <div class="btn" @click="goPage('all')">全部解析</div>
<div class="btn" @click="goPage('err')">错误解析</div> <!-- <div class="btn" @click="goPage('err')">错误解析</div> -->
</div> </div>
</template> </template>
</card> </card>
...@@ -46,7 +46,8 @@ export default { ...@@ -46,7 +46,8 @@ export default {
data() { data() {
return { return {
data: {}, data: {},
accuracy: 0 accuracy: 0,
accuracScore: 0
} }
}, },
created() { created() {
...@@ -78,11 +79,10 @@ export default { ...@@ -78,11 +79,10 @@ export default {
.then(response => { .then(response => {
const data = JSON.parse(response.data) const data = JSON.parse(response.data)
this.data = data this.data = data
this.accuracy = parseInt(data.sheet.score) / parseInt(data.sheet.questions.total_score) this.accuracy = parseInt(data.sheet.score)
// console.log(this.accuracy) this.accuracScore = parseInt(data.sheet.questions.total_score)
}) })
.finally(() => { .finally(() => {
// this.loaded = true
}) })
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论