补考、缓考成绩自动替换

This commit is contained in:
biss committed 2026-08-15 10:17:57 +08:00
1 parent d7d2560587
commit 51b83e9d78
7 files changed
+122 -20

No files matched your search

+6 -5
View File
@@ -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>
+3 -3
View File
@@ -432,7 +432,7 @@ async function submitScores() {
scoreSaving.value = true
try {
await http.put(`/makeup-exams/sessions/${scoreSession.value.id}/scores`, entries)
ElMessage.success(`已保存 ${entries.length} 条补考成绩(合格按60分记)`)
ElMessage.success(`已保存 ${entries.length} 条补考成绩(缓考按正常权重计入平时分)`)
scoreDialogVisible.value = false
await load()
} catch (error) { ElMessage.error(apiErrorMessage(error)) }
@@ -642,7 +642,7 @@ onBeforeUnmount(() => {
<div>
<span>MAKE-UP EXAM GRADING</span>
<h3>任课补考成绩录入</h3>
<p>以下为您任课班级的补考场次,补考合格按60分记入最终成绩。</p>
<p>缓考按正常权重计入平时分;普通补考合格按60分记入最终成绩。</p>
</div>
</header>
<div class="exam-timeline">
@@ -874,7 +874,7 @@ onBeforeUnmount(() => {
<el-dialog v-model="scoreDialogVisible" title="录入补考成绩" width="680px">
<template v-if="scoreSession">
<p style="margin-bottom: 12px"><b>{{ scoreSession.courseName }}</b> · {{ dateOnlyText(scoreSession.examDate) }} · {{ scoreSession.enrolledCount }} 名考生</p>
<el-alert type="warning" title="补考合格按60分记入最终成绩" :closable="false" style="margin-bottom: 12px" />
<el-alert type="warning" title="缓考按正常权重计入平时分;普通补考合格按60分记" :closable="false" style="margin-bottom: 12px" />
<el-table :data="scoreSession.enrollments" size="small">
<el-table-column prop="studentNumber" label="学号" width="120" />
<el-table-column prop="name" label="姓名" width="80" />