提交 4c93350c authored 作者: zyx's avatar zyx

添加默认值

上级 4d72dc3d
...@@ -21,7 +21,7 @@ watchEffect(() => { ...@@ -21,7 +21,7 @@ watchEffect(() => {
...item, ...item,
old_score: parseFloat(item.old_score), old_score: parseFloat(item.old_score),
ratio: parseFloat(item.ratio), ratio: parseFloat(item.ratio),
score: isNaN(parseFloat(item.score)) ? (item.type === 2 ? 0 : null) : parseFloat(item.score) score: isNaN(parseFloat(item.score)) ? null : parseFloat(item.score)
} }
}) })
}) })
...@@ -43,6 +43,7 @@ const score = $computed(() => { ...@@ -43,6 +43,7 @@ const score = $computed(() => {
// 提交 // 提交
function handleSubmit() { function handleSubmit() {
const scores = tableList.map((item: any) => { const scores = tableList.map((item: any) => {
if (item.type === 2) { item.score = 0 }
return { id: item.id, score: item.score } return { id: item.id, score: item.score }
}) })
const params = { id: detail.id, scores: JSON.stringify(scores) } const params = { id: detail.id, scores: JSON.stringify(scores) }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论