补考、缓考成绩自动替换
This commit is contained in:
1 parent
d7d2560587
commit
51b83e9d78
7 files changed
+122
-20
No files matched your search
@@ -75,6 +75,7 @@ const examStatusLabels: Record<string, string> = {
|
||||
Absent: '缺考',
|
||||
Deferred: '缓考',
|
||||
Exempt: '免修',
|
||||
Makeup: '补考',
|
||||
}
|
||||
const itemsWeight = computed(() =>
|
||||
createForm.items.reduce((sum, item) => sum + item.weight, 0))
|
||||
@@ -415,7 +416,7 @@ function itemScore(record: any, gradeItemId: string) {
|
||||
/** Client-side preview calculation — mirrors backend GradeCalculator.CalculateTotal */
|
||||
function calcPreviewTotal(record: any): number | null {
|
||||
if (!detail.value) return null
|
||||
if (record.examStatus !== 'Normal') return null
|
||||
if (!['Normal', 'Deferred'].includes(record.examStatus)) return null
|
||||
|
||||
const { regularWeight, finalWeight, items } = detail.value
|
||||
const itemWeightById: Record<string, number> = {}
|
||||
@@ -642,7 +643,7 @@ onMounted(async () => {
|
||||
<template #default="{ row }">
|
||||
<div class="score-cell" :class="{ 'is-failed': isFailingScore(row.regularScore) }">
|
||||
<el-input-number
|
||||
v-if="detail.canEdit && row.examStatus === 'Normal'"
|
||||
v-if="detail.canEdit && ['Normal', 'Deferred'].includes(row.examStatus)"
|
||||
v-model="row.regularScore"
|
||||
:min="0" :max="100" :controls="false" size="small"
|
||||
/>
|
||||
@@ -659,7 +660,7 @@ onMounted(async () => {
|
||||
<template #default="{ row }">
|
||||
<div class="score-cell" :class="{ 'is-failed': isFailingScore(itemScore(row, item.id)?.score) }">
|
||||
<el-input-number
|
||||
v-if="detail.canEdit && row.examStatus === 'Normal' && item.sourceType !== 'ExperimentSummary'"
|
||||
v-if="detail.canEdit && ['Normal', 'Deferred'].includes(row.examStatus) && item.sourceType !== 'ExperimentSummary'"
|
||||
:model-value="itemScore(row, item.id)?.score"
|
||||
@update:model-value="(val: number | undefined) => { const found = itemScore(row, item.id); if (found) found.score = val }"
|
||||
:min="0" :max="100" :controls="false" size="small"
|
||||
@@ -687,9 +688,9 @@ onMounted(async () => {
|
||||
<template #default="{ row }">
|
||||
<div
|
||||
class="score-cell"
|
||||
:class="{ 'is-failed': isFailingScore(detail.canEdit && row.examStatus === 'Normal' ? calcPreviewTotal(row) : row.totalScore) }"
|
||||
:class="{ 'is-failed': isFailingScore(detail.canEdit && ['Normal', 'Deferred'].includes(row.examStatus) ? calcPreviewTotal(row) : row.totalScore) }"
|
||||
>
|
||||
<template v-if="detail.canEdit && row.examStatus === 'Normal'">
|
||||
<template v-if="detail.canEdit && ['Normal', 'Deferred'].includes(row.examStatus)">
|
||||
<b class="total-score preview" :class="scoreClass(calcPreviewTotal(row))">
|
||||
{{ calcPreviewTotal(row) ?? '—' }}
|
||||
</b>
|
||||
|
||||
Reference in new issue
Block a user