baigl #381

Merged
baigl merged 2 commits from baigl into main 2024-10-31 13:51:24 +08:00
1 changed files with 19 additions and 16 deletions

View File

@ -82,25 +82,25 @@
<span style="color: #2196f3">{{scope.row.getScore || 0}}</span> <span style="color: #2196f3">{{scope.row.getScore || 0}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批阅状态" prop="teacherRating" align="center" width="120" sortable> <el-table-column label="批阅状态" prop="rating" align="center" width="120" sortable>
<template #default="scope"> <template #default="scope">
<template v-if="scope.row.teacherRating == 0"> <template v-if="scope.row.rating == 0">
<span v-if="tableRadio.value==1" style="color: #2196f3">待批阅</span> <span v-if="tableRadio.value==1" style="color: #2196f3">待批阅</span>
</template> </template>
<!-- 1- 2-优减 3- 4-良减 5- --> <!-- 1- 2-优减 3- 4-良减 5- -->
<template v-if="scope.row.teacherRating == 1" <template v-if="scope.row.rating == 1"
><el-tag type="danger">完美</el-tag></template ><el-tag type="danger">完美</el-tag></template
> >
<template v-if="scope.row.teacherRating == 2" <template v-if="scope.row.rating == 2"
><el-tag type="danger">优秀</el-tag></template ><el-tag type="danger">优秀</el-tag></template
> >
<template v-if="scope.row.teacherRating == 3" <template v-if="scope.row.rating == 3"
><el-tag type="warning">良好</el-tag></template ><el-tag type="warning">良好</el-tag></template
> >
<template v-if="scope.row.teacherRating == 4" <template v-if="scope.row.rating == 4"
><el-tag type="info">及格</el-tag></template ><el-tag type="info">及格</el-tag></template
> >
<template v-if="scope.row.teacherRating == 5" <template v-if="scope.row.rating == 5"
><el-tag type="info">不及格</el-tag></template ><el-tag type="info">不及格</el-tag></template
> >
</template> </template>
@ -345,7 +345,7 @@ const getClassWorkStudentList = (rowId) => {
} }
// 0 // 0
response.rows[i].teacherRating = 0 response.rows[i].rating = 0
// //
if ( if (
@ -371,21 +371,23 @@ const getClassWorkStudentList = (rowId) => {
score += evalarray[e].score; score += evalarray[e].score;
evalarray[e].teacherRating = evalarray[e].score evalarray[e].teacherRating = evalarray[e].score
} }
} }
} }
const allScore = evalarray.reduce((acc, cur) => acc + cur.score, 0)
const allTeacherRating = evalarray.reduce((acc, cur) => acc + cur.teacherRating, 0) //
//console.log(evalarray, 'evalarray------------------------------------') //console.log(evalarray, 'evalarray------------------------------------')
if (feedcount > 0) { if (feedcount > 0) {
// : /*100 // : /*100
response.rows[i].scoingRate = ((score / allScore) * 100).toFixed(0) + '%' response.rows[i].scoingRate = ((score / allTeacherRating) * 100).toFixed(0) + '%'
response.rows[i].getScore = score response.rows[i].getScore = allTeacherRating
} else { } else {
response.rows[i].scoingRate = '0%' response.rows[i].scoingRate = '0%'
response.rows[i].getScore = 0 response.rows[i].getScore = 0
} }
// : // :
if (evalarray[0].rating != '') { if (evalarray[0].rating != '') {
response.rows[i].teacherRating = evalarray[0].rating response.rows[i].rating = evalarray[0].rating
} }
} else { } else {
response.rows[i].scoingRate = '0%' response.rows[i].scoingRate = '0%'
@ -420,7 +422,7 @@ const teacherCriticism = ()=>{
tableRadio.list = tableRadio.list.map((item) => { tableRadio.list = tableRadio.list.map((item) => {
return { return {
...item, ...item,
teacherRating : item.teacherRating || checkWorkType(item) rating : item.rating || checkWorkType(item)
} }
}) })
} }
@ -675,10 +677,11 @@ const handleClassOverviewOpen = (type) =>{
} }
} }
}) })
const allScore = allTopic.reduce((acc, cur) => { const allTeacherRating = allTopic.reduce((acc, cur) => {
return acc + cur.score; return acc + cur.teacherRating;
},0) },0)
rightAnswer > 0?item.scoingRate = (score/allScore * 100).toFixed(0):item.scoingRate = ''
rightAnswer > 0?item.scoingRate = (score/allTeacherRating * 100).toFixed(0):item.scoingRate = ''
item.getScore = score item.getScore = score
}else{ }else{
item.scoingRate = '' item.scoingRate = ''