提交 39e3e1d8 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 修改赛项最终得分

上级 711b92b3
...@@ -17,14 +17,21 @@ watchEffect(() => { ...@@ -17,14 +17,21 @@ watchEffect(() => {
...item, ...item,
old_score: parseFloat(item.old_score), old_score: parseFloat(item.old_score),
ratio: parseFloat(item.ratio), ratio: parseFloat(item.ratio),
score: parseFloat(item.score) score: isNaN(parseFloat(item.score)) ? null : parseFloat(item.score)
} }
}) })
}) })
// 最终得分
// 评分 / 分值 * 占比
const score = $computed<number>(() => { const score = $computed<number>(() => {
// 未打分的列表
const unScoreList = tableList.filter((item: any) => item.score === null || item.score === '')
if (unScoreList.length) {
return '--'
}
return tableList.reduce((result: number, item: any) => { return tableList.reduce((result: number, item: any) => {
return (result += item.score || 0) return (result += (item.score / item.old_score) * item.ratio || 0)
}, 0) }, 0)
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论