提交 00587b8b authored 作者: matian's avatar matian

fix:正确率保留一位小数点

上级 8d034b63
...@@ -115,7 +115,20 @@ export default { ...@@ -115,7 +115,20 @@ export default {
} }
} }
}, },
{ label: '正确率', prop: 'rate', align: 'center', minWidth: 150, sortable: 'custom' }, {
label: '正确率',
prop: 'rate',
align: 'center',
minWidth: 150,
sortable: 'custom',
computed({ row }) {
if (row.rate > 0) {
return `${row.rate.toFixed(1)}%`
} else {
return row.rate
}
}
},
{ label: '总分', prop: 'total_score', align: 'center' }, { label: '总分', prop: 'total_score', align: 'center' },
{ label: '平均得分', prop: 'average', align: 'center', sortable: 'custom', minWidth: 150 } { label: '平均得分', prop: 'average', align: 'center', sortable: 'custom', minWidth: 150 }
], ],
......
...@@ -59,12 +59,34 @@ export default { ...@@ -59,12 +59,34 @@ export default {
{ label: '考试名称', prop: 'examination_name', align: 'center' }, { label: '考试名称', prop: 'examination_name', align: 'center' },
{ label: '所属课程', prop: 'course_name', align: 'center' }, { label: '所属课程', prop: 'course_name', align: 'center' },
{ label: '参考人数', prop: 'join_num', align: 'center' }, { label: '参考人数', prop: 'join_num', align: 'center' },
{ label: '参考率', prop: 'join_rate', align: 'center' }, {
label: '参考率',
prop: 'join_rate',
align: 'center',
computed({ row }) {
if (row.join_rate > 0) {
return `${row.join_rate.toFixed(1)}%`
} else {
return row.join_rate
}
}
},
{ label: '平均得分', prop: 'average', align: 'center' }, { label: '平均得分', prop: 'average', align: 'center' },
{ label: '最高分', prop: 'max', align: 'center' }, { label: '最高分', prop: 'max', align: 'center' },
{ label: '最低分', prop: 'min', align: 'center' }, { label: '最低分', prop: 'min', align: 'center' },
{ label: '题目总数', prop: 'question_num', align: 'center' }, { label: '题目总数', prop: 'question_num', align: 'center' },
{ label: '及格率', prop: 'pass_rate', align: 'center' }, {
label: '及格率',
prop: 'pass_rate',
align: 'center',
computed({ row }) {
if (row.pass_rate > 0) {
return `${row.pass_rate.toFixed(1)}%`
} else {
return row.pass_rate
}
}
},
{ label: '操作', slots: 'table-operate', align: 'center', minWidth: 150 } { label: '操作', slots: 'table-operate', align: 'center', minWidth: 150 }
] ]
} }
......
...@@ -57,12 +57,34 @@ export default { ...@@ -57,12 +57,34 @@ export default {
{ label: '所属章节', prop: 'parent_name', align: 'center' }, { label: '所属章节', prop: 'parent_name', align: 'center' },
{ label: '所属课程', prop: 'course_name', align: 'center' }, { label: '所属课程', prop: 'course_name', align: 'center' },
{ label: '练习总人数', prop: 'join_num', align: 'center' }, { label: '练习总人数', prop: 'join_num', align: 'center' },
{ label: '练习率', prop: 'join_rate', align: 'center' }, {
label: '练习率',
prop: 'join_rate',
align: 'center',
computed({ row }) {
if (row.join_rate > 0) {
return `${row.join_rate.toFixed(1)}%`
} else {
return row.join_rate
}
}
},
{ label: '平均得分', prop: 'average', align: 'center' }, { label: '平均得分', prop: 'average', align: 'center' },
{ label: '最高分', prop: 'max', align: 'center' }, { label: '最高分', prop: 'max', align: 'center' },
{ label: '最低分', prop: 'min', align: 'center' }, { label: '最低分', prop: 'min', align: 'center' },
{ label: '题目总数', prop: 'question_num', align: 'center' }, { label: '题目总数', prop: 'question_num', align: 'center' },
{ label: '及格率', prop: 'pass_rate', align: 'center' }, {
label: '及格率',
prop: 'pass_rate',
align: 'center',
computed({ row }) {
if (row.pass_rate > 0) {
return `${row.pass_rate.toFixed(1)}%`
} else {
return row.pass_rate
}
}
},
{ label: '操作', slots: 'table-operate', align: 'center', minWidth: 150 } { label: '操作', slots: 'table-operate', align: 'center', minWidth: 150 }
] ]
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论