Files
Academic-Affairs-System/web/src/views/PhysicalFitnessView.vue
T
2026-11-13 19:09:49 +08:00

2442 lines
68 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { getDisplayLocale } from "../i18n";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
import { computed, onMounted, reactive, ref } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import {
CircleCheck,
DataAnalysis,
Download,
Plus,
Promotion,
Refresh,
Search,
TrendCharts,
Upload,
UserFilled,
Warning,
} from "@element-plus/icons-vue";
import http, { apiErrorMessage } from "../api/http";
import { downloadApiFile } from "../api/excel";
import { useAuthStore } from "../stores/auth";
type EnumValue = number | string | null | undefined;
type Item = {
itemCode: EnumValue;
value: number;
unit: string;
score?: number;
bonusScore: number;
weight: number;
weightedScore?: number;
};
type RecordRow = {
id: string;
studentNumber: string;
name: string;
gender: EnumValue;
collegeName: string;
className: string;
gradeLevel: number;
status: EnumValue;
specialReason?: string;
standardScore?: number;
bonusScore?: number;
totalScore?: number;
grade?: EnumValue;
notes?: string;
items: Item[];
};
type Distribution = { status?: EnumValue; grade?: EnumValue; count: number };
type BatchSummary = {
totalCount: number;
scoredCount: number;
averageScore?: number;
highestScore?: number;
passCount: number;
passRate?: number;
statusDistribution: Distribution[];
gradeDistribution: Distribution[];
};
const auth = useAuthStore();
const roles = computed(() => auth.user?.roles ?? []);
const isStudent = computed(() => roles.value.includes("Student"));
const canManage = computed(() =>
roles.value.some((role) =>
["SuperAdmin", "AcademicAdmin", "PhysicalEducationAdmin"].includes(role),
),
);
const loading = ref(false);
const batches = ref<any[]>([]);
const batchKeyword = ref("");
const batchStatus = ref<number>();
const batchPage = ref(1);
const batchCursors = ref<string[]>([]);
const nextBatchCursor = ref<string>();
const batchHasMore = ref(false);
const selected = ref<any>();
const summary = ref<BatchSummary>();
const records = ref<RecordRow[]>([]);
const recordKeyword = ref("");
const recordStatus = ref<number>();
const recordGrade = ref<number>();
const recordStudentGrade = ref<number>();
const recordCollegeId = ref("");
const recordMajorId = ref("");
const recordClassId = ref("");
const recordFilterOptions = ref<any>({
grades: [],
colleges: [],
majors: [],
classes: [],
});
const recordFilterBatchId = ref("");
const attentionOnly = ref(false);
const recordPage = ref(1);
const recordCursors = ref<string[]>([]);
const nextRecordCursor = ref<string>();
const recordHasMore = ref(false);
const mine = ref<any[]>([]);
const batchDialog = ref(false);
const recordDialog = ref(false);
const publishDialog = ref(false);
const saving = ref(false);
const studentInfo = ref<any>();
const batchForm = reactive({
name: "",
academicYear: currentAcademicYear(),
testDate: new Date().toISOString().slice(0, 10),
});
const recordForm = reactive(emptyRecord());
const statusLabels = computed<Record<number, string>>(() => ({
1: t("physicalFitnessScript.normal"),
2: t("physicalFitnessScript.missing"),
3: t("physicalFitnessScript.deferred"),
4: t("physicalFitnessScript.exempt"),
}));
const gradeLabels = computed<Record<number, string>>(() => ({
1: t("physicalFitnessScript.fail"),
2: t("physicalFitnessScript.pass"),
3: t("physicalFitnessScript.good"),
4: t("physicalFitnessScript.excellent"),
}));
const itemLabels = computed<Record<number, string>>(() => ({
3: "BMI",
4: t("physicalFitnessScript.vitalCapacity"),
5: t("physicalFitnessScript.message50MSprint"),
6: t("physicalFitnessScript.sitAndReach"),
7: t("physicalFitnessScript.standingLongJump"),
8: t("physicalFitnessScript.strengthTest"),
9: t("physicalFitnessScript.enduranceRun"),
}));
const enumMaps = {
batch: { Draft: 1, Published: 2 },
status: { Normal: 1, Missing: 2, Deferred: 3, Exempt: 4 },
grade: { Fail: 1, Pass: 2, Good: 3, Excellent: 4 },
item: {
Height: 1,
Weight: 2,
Bmi: 3,
VitalCapacity: 4,
Sprint50M: 5,
SitAndReach: 6,
StandingLongJump: 7,
Strength: 8,
EnduranceRun: 9,
},
gender: { Unknown: 0, Male: 1, Female: 2 },
} as const;
const latestRecord = computed(() => mine.value[0]);
const latestNormal = computed(() =>
mine.value.find((record) => statusCode(record.status) === 1),
);
const normalHistory = computed(() =>
mine.value.filter(
(record) => statusCode(record.status) === 1 && record.totalScore != null,
),
);
const scoreChange = computed(() =>
normalHistory.value.length < 2
? undefined
: Number(normalHistory.value[0].totalScore) -
Number(normalHistory.value[1].totalScore),
);
const weakestItems = computed(() =>
(latestNormal.value?.items ?? [])
.filter((item: Item) => itemCode(item.itemCode) >= 3 && item.score != null)
.sort((a: Item, b: Item) => Number(a.score) - Number(b.score))
.slice(0, 2),
);
const gradeDistribution = computed(() =>
[4, 3, 2, 1].map((grade) => ({
grade,
label: gradeLabels.value[grade],
count:
summary.value?.gradeDistribution.find(
(item) => gradeCode(item.grade) === grade,
)?.count ?? 0,
})),
);
const specialCount = computed(() =>
(summary.value?.statusDistribution ?? [])
.filter((item) => statusCode(item.status) !== 1)
.reduce((sum, item) => sum + item.count, 0),
);
const recordMajors = computed(() =>
recordFilterOptions.value.majors.filter(
(item: any) =>
!recordCollegeId.value || item.collegeId === recordCollegeId.value,
),
);
const recordClasses = computed(() =>
recordFilterOptions.value.classes.filter(
(item: any) =>
(!recordStudentGrade.value || item.grade === recordStudentGrade.value) &&
(!recordMajorId.value
? !recordCollegeId.value ||
recordMajors.value.some((major: any) => major.id === item.majorId)
: item.majorId === recordMajorId.value),
),
);
function enumCode(value: EnumValue, map: Record<string, number>) {
if (typeof value === "number") return Number.isFinite(value) ? value : 0;
if (typeof value !== "string") return 0;
const normalized = value.trim();
const mapped = map[normalized];
if (mapped != null) return mapped;
const numeric = Number(normalized);
return Number.isFinite(numeric) ? numeric : 0;
}
function batchCode(value: EnumValue) {
return enumCode(value, enumMaps.batch);
}
function statusCode(value: EnumValue) {
return enumCode(value, enumMaps.status);
}
function gradeCode(value: EnumValue) {
return enumCode(value, enumMaps.grade);
}
function itemCode(value: EnumValue) {
return enumCode(value, enumMaps.item);
}
function genderCode(value: EnumValue) {
return enumCode(value, enumMaps.gender);
}
function currentAcademicYear() {
const now = new Date();
const year = now.getMonth() >= 8 ? now.getFullYear() : now.getFullYear() - 1;
return `${year}-${year + 1}`;
}
function emptyRecord() {
return {
id: "",
studentNumber: "",
status: 1,
gradeLevel: undefined as number | undefined,
heightCm: undefined as number | undefined,
weightKg: undefined as number | undefined,
vitalCapacityMl: undefined as number | undefined,
sprint50MSeconds: undefined as number | undefined,
sitAndReachCm: undefined as number | undefined,
standingLongJumpCm: undefined as number | undefined,
strengthCount: undefined as number | undefined,
enduranceRunSeconds: undefined as number | undefined,
specialReason: "",
notes: "",
};
}
function itemValue(row: { items?: Item[] }, code: number) {
return row.items?.find((item) => itemCode(item.itemCode) === code)?.value;
}
function scoreText(value: number | undefined) {
return value == null ? "—" : Number(value).toFixed(1);
}
function percentText(value: number | undefined) {
return value == null ? "—" : `${Number(value).toFixed(1)}%`;
}
function statusType(status: EnumValue) {
const code = statusCode(status);
return code === 1 ? "success" : code === 4 ? "info" : "warning";
}
function gradeType(
grade?: EnumValue,
): "success" | "primary" | "warning" | "danger" {
const code = gradeCode(grade);
return code === 4
? "success"
: code === 3
? "primary"
: code === 2
? "warning"
: "danger";
}
function duration(value?: number) {
if (value == null) return "—";
const seconds = Math.round(Number(value));
return `${Math.floor(seconds / 60)}′${String(seconds % 60).padStart(2, "0")}″`;
}
function formatDate(value?: string) {
return value
? new Intl.DateTimeFormat(getDisplayLocale()).format(
new Date(`${value}T00:00:00`),
)
: "—";
}
function gradePercent(count: number) {
return summary.value?.scoredCount
? Math.round((count * 100) / summary.value.scoredCount)
: 0;
}
function itemScoreLevel(score?: number) {
return score == null
? t("physicalFitnessScript.notScored")
: score < 60
? t("physicalFitnessScript.needsImprovement")
: score < 80
? t("physicalFitnessScript.meetsStandard")
: score < 90
? t("physicalFitnessScript.good")
: t("physicalFitnessScript.excellent");
}
function itemScoreClass(score?: number) {
return score == null
? "muted"
: score < 60
? "danger"
: score < 80
? "warning"
: "success";
}
function genderLabel(value: EnumValue) {
return genderCode(value) === 1
? t("physicalFitnessScript.male")
: genderCode(value) === 2
? t("physicalFitnessScript.female")
: t("physicalFitnessScript.notSpecified");
}
async function load(reset = false) {
loading.value = true;
try {
if (isStudent.value) {
mine.value = (await http.get("/physical-fitness/mine")).data.records;
return;
}
if (reset) {
batchPage.value = 1;
batchCursors.value = [];
}
const { data } = await http.get("/physical-fitness/batches", {
params: {
keyword: batchKeyword.value.trim() || undefined,
status: batchStatus.value,
cursor: batchCursors.value.at(-1),
pageSize: 20,
},
});
batches.value = data.items;
nextBatchCursor.value = data.nextCursor;
batchHasMore.value = data.hasMore;
} catch (error) {
ElMessage.error(apiErrorMessage(error));
} finally {
loading.value = false;
}
}
async function openBatch(batch: any, reset = true) {
selected.value = batch;
if (reset) {
recordPage.value = 1;
recordCursors.value = [];
}
loading.value = true;
try {
if (recordFilterBatchId.value !== batch.id) {
recordFilterOptions.value = (
await http.get(
`/physical-fitness/batches/${batch.id}/record-filter-options`,
)
).data;
recordFilterBatchId.value = batch.id;
recordStudentGrade.value = undefined;
recordCollegeId.value = "";
recordMajorId.value = "";
recordClassId.value = "";
}
const { data } = await http.get(
`/physical-fitness/batches/${batch.id}/records`,
{ params: recordRequestParams(true) },
);
selected.value = { ...selected.value, ...data.batch };
summary.value = data.summary;
records.value = data.page.items;
nextRecordCursor.value = data.page.nextCursor;
recordHasMore.value = data.page.hasMore;
} catch (error) {
ElMessage.error(apiErrorMessage(error));
} finally {
loading.value = false;
}
}
function recordRequestParams(includePage: boolean) {
return {
keyword: recordKeyword.value.trim() || undefined,
status: recordStatus.value,
grade: recordGrade.value,
studentGrade: recordStudentGrade.value,
collegeId: recordCollegeId.value || undefined,
majorId: recordMajorId.value || undefined,
administrativeClassId: recordClassId.value || undefined,
attentionOnly: attentionOnly.value || undefined,
cursor: includePage ? recordCursors.value.at(-1) : undefined,
pageSize: includePage ? 30 : undefined,
};
}
function onRecordCollegeChange() {
recordMajorId.value = "";
recordClassId.value = "";
}
function onRecordMajorChange() {
recordClassId.value = "";
}
function resetRecordFilters() {
recordKeyword.value = "";
recordStatus.value = undefined;
recordGrade.value = undefined;
recordStudentGrade.value = undefined;
recordCollegeId.value = "";
recordMajorId.value = "";
recordClassId.value = "";
attentionOnly.value = false;
if (selected.value) void openBatch(selected.value);
}
async function exportRecords() {
if (!selected.value) return;
try {
await downloadApiFile(
`/physical-fitness/batches/${selected.value.id}/export.xlsx`,
t("physicalFitnessScript.recordFile", { name: selected.value.name }),
{ params: recordRequestParams(false) },
);
ElMessage.success(
t(
"physicalFitnessScript.allFitnessRecordsMatchingTheFiltersWereExported",
),
);
} catch (error) {
ElMessage.error(apiErrorMessage(error));
}
}
async function nextBatch() {
if (!nextBatchCursor.value) return;
batchCursors.value.push(nextBatchCursor.value);
batchPage.value++;
await load();
}
async function previousBatch() {
if (!batchCursors.value.length) return;
batchCursors.value.pop();
batchPage.value--;
await load();
}
async function nextRecords() {
if (!nextRecordCursor.value) return;
recordCursors.value.push(nextRecordCursor.value);
recordPage.value++;
await openBatch(selected.value, false);
}
async function previousRecords() {
if (!recordCursors.value.length) return;
recordCursors.value.pop();
recordPage.value--;
await openBatch(selected.value, false);
}
async function createBatch() {
if (
!batchForm.name.trim() ||
!/^\d{4}-\d{4}$/.test(batchForm.academicYear) ||
!batchForm.testDate
) {
ElMessage.warning(
t("physicalFitnessScript.enterTheBatchNameAcademicYearAndTestDate"),
);
return;
}
saving.value = true;
try {
await http.post("/physical-fitness/batches", batchForm);
batchDialog.value = false;
batchForm.name = "";
ElMessage.success(t("physicalFitnessScript.fitnessBatchCreated"));
await load(true);
} catch (error) {
ElMessage.error(apiErrorMessage(error));
} finally {
saving.value = false;
}
}
function editRecord(row?: any) {
Object.assign(recordForm, emptyRecord());
studentInfo.value = undefined;
if (row) {
Object.assign(recordForm, {
id: row.id,
studentNumber: row.studentNumber,
status: statusCode(row.status),
gradeLevel: row.gradeLevel,
heightCm: itemValue(row, 1),
weightKg: itemValue(row, 2),
vitalCapacityMl: itemValue(row, 4),
sprint50MSeconds: itemValue(row, 5),
sitAndReachCm: itemValue(row, 6),
standingLongJumpCm: itemValue(row, 7),
strengthCount: itemValue(row, 8),
enduranceRunSeconds: itemValue(row, 9),
specialReason: row.specialReason ?? "",
notes: row.notes ?? "",
});
studentInfo.value = row;
}
recordDialog.value = true;
}
async function lookupStudent() {
studentInfo.value = undefined;
if (!recordForm.studentNumber.trim()) return;
try {
studentInfo.value = (
await http.get("/physical-fitness/students/lookup", {
params: { studentNumber: recordForm.studentNumber.trim() },
})
).data;
} catch {
ElMessage.warning(
t("physicalFitnessScript.studentNotFoundOrOutsideYourDataScope"),
);
}
}
function validateRecord() {
if (!recordForm.studentNumber.trim())
return t("physicalFitnessScript.enterTheStudentNumber");
if (
recordForm.status === 1 &&
[
recordForm.heightCm,
recordForm.weightKg,
recordForm.vitalCapacityMl,
recordForm.sprint50MSeconds,
recordForm.sitAndReachCm,
recordForm.standingLongJumpCm,
recordForm.strengthCount,
recordForm.enduranceRunSeconds,
].some((value) => value == null)
)
return t(
"physicalFitnessScript.allEightTestResultsAreRequiredForANormalRecord",
);
if ([3, 4].includes(recordForm.status) && !recordForm.specialReason.trim())
return t("physicalFitnessScript.aReasonIsRequiredForDeferredOrExemptTests");
}
async function saveRecord() {
const validation = validateRecord();
if (validation) {
ElMessage.warning(validation);
return;
}
saving.value = true;
try {
await http.put(`/physical-fitness/batches/${selected.value.id}/records`, {
records: [{ ...recordForm, id: undefined }],
});
recordDialog.value = false;
ElMessage.success(
recordForm.status === 1
? t("physicalFitnessScript.recordSavedAndRescored")
: t("physicalFitnessScript.specialStatusSaved"),
);
await openBatch(selected.value);
await load();
} catch (error) {
ElMessage.error(apiErrorMessage(error));
} finally {
saving.value = false;
}
}
async function removeRecord(row: any) {
try {
await ElMessageBox.confirm(
t("physicalFitnessScript.deleteQuestion", { name: row.name }),
t("physicalFitnessScript.deleteRecord"),
{
type: "warning",
confirmButtonText: t("physicalFitnessScript.confirmDeletion"),
},
);
await http.delete(`/physical-fitness/records/${row.id}`);
ElMessage.success(t("physicalFitnessScript.recordDeleted"));
await openBatch(selected.value);
await load();
} catch (error: any) {
if (error !== "cancel" && error !== "close")
ElMessage.error(apiErrorMessage(error));
}
}
async function downloadTemplate() {
try {
await downloadApiFile(
`/physical-fitness/batches/${selected.value.id}/template`,
t("physicalFitnessScript.templateFile", {
year: selected.value.academicYear,
}),
);
} catch (error) {
ElMessage.error(apiErrorMessage(error));
}
}
async function importExcel(event: Event) {
const input = event.target as HTMLInputElement;
const file = input.files?.[0];
input.value = "";
if (!file) return;
const body = new FormData();
body.append("file", file);
saving.value = true;
try {
await http.post(
`/physical-fitness/batches/${selected.value.id}/import`,
body,
{ headers: { "Content-Type": "multipart/form-data" } },
);
ElMessage.success(t("physicalFitnessScript.fitnessDataImportedAndScored"));
await openBatch(selected.value);
await load();
} catch (error) {
ElMessage.error(apiErrorMessage(error));
} finally {
saving.value = false;
}
}
async function publish() {
saving.value = true;
try {
await http.post(`/physical-fitness/batches/${selected.value.id}/publish`);
publishDialog.value = false;
ElMessage.success(
t("physicalFitnessScript.fitnessResultsPublishedAndAvailableToStudents"),
);
await openBatch(selected.value);
await load();
} catch (error) {
ElMessage.error(apiErrorMessage(error));
} finally {
saving.value = false;
}
}
onMounted(() => load());
</script>
<template>
<main class="fitness-page">
<header class="fitness-hero">
<div>
<span class="eyebrow">PHYSICAL HEALTH</span>
<h1>
{{
isStudent
? t("fitnessTemplate.myFitnessTests")
: t("fitnessTemplate.fitnessTestResults")
}}
</h1>
<p>
{{
isStudent
? t("fitnessTemplate.understandEachResultAndTrackYourProgress")
: t(
"fitnessTemplate.manageEachFitnessTestBatchFromDataCollectionAndScoringThroughReviewAndPublication",
)
}}
</p>
</div>
<el-button
v-if="canManage"
type="primary"
size="large"
:icon="Plus"
@click="batchDialog = true"
>{{ t("fitnessTemplate.newFitnessTestBatch") }}</el-button
>
</header>
<template v-if="isStudent">
<section v-if="latestRecord" class="student-overview">
<div class="overview-copy">
<span class="eyebrow"
>LATEST RESULT · {{ latestRecord.academicYear }}</span
>
<h2>{{ latestRecord.batchName }}</h2>
<p>
{{
t("fitnessTemplate.dateUniversityYearGradeStandard", {
date: formatDate(latestRecord.testDate),
grade: latestRecord.gradeLevel,
standard: latestRecord.standardVersion,
})
}}
</p>
<div
v-if="statusCode(latestRecord.status) === 1"
class="overview-tags"
>
<el-tag :type="gradeType(latestRecord.grade)" effect="dark">{{
gradeLabels[gradeCode(latestRecord.grade)]
}}</el-tag
><span
v-if="scoreChange != null"
:class="scoreChange >= 0 ? 'up' : 'down'"
>{{
t("fitnessTemplate.changePointsSinceLastTest", {
change: `${scoreChange >= 0 ? "+" : ""}${scoreChange.toFixed(1)}`,
})
}}</span
><span v-else>{{
t("fitnessTemplate.firstComparableResult")
}}</span>
</div>
<div v-else class="overview-tags">
<el-tag :type="statusType(latestRecord.status)" effect="dark">{{
statusLabels[statusCode(latestRecord.status)]
}}</el-tag
><span>{{
latestRecord.specialReason ||
t("fitnessTemplate.noValidScoreForThisTest")
}}</span>
</div>
</div>
<div
v-if="statusCode(latestRecord.status) === 1"
class="score-orbit"
:style="{
'--score': `${Math.min(Number(latestRecord.totalScore), 100) * 3.6}deg`,
}"
>
<div>
<strong>{{ scoreText(latestRecord.totalScore) }}</strong
><span>{{ t("fitnessTemplate.overallScore") }}</span>
</div>
</div>
<div v-else class="special-state">
<Warning /><strong>{{
statusLabels[statusCode(latestRecord.status)]
}}</strong
><span>{{ t("fitnessTemplate.notScoredForThisTest") }}</span>
</div>
</section>
<section v-if="latestNormal" class="student-insights">
<article>
<TrendCharts />
<div>
<small>{{ t("fitnessTemplate.standardBonusScore") }}</small
><strong
>{{ scoreText(latestNormal.standardScore) }} <i>+</i>
{{ scoreText(latestNormal.bonusScore) }}</strong
>
</div>
</article>
<article>
<CircleCheck />
<div>
<small>{{ t("fitnessTemplate.evaluation") }}</small
><strong>{{ gradeLabels[gradeCode(latestNormal.grade)] }}</strong>
</div>
</article>
<article>
<DataAnalysis />
<div>
<small>{{ t("fitnessTemplate.prioritiesForImprovement") }}</small
><strong>{{
weakestItems
.map((item: Item) => itemLabels[itemCode(item.itemCode)])
.join(t("academicPlanning.separator")) ||
t("fitnessTemplate.maintainCurrentPerformance")
}}</strong>
</div>
</article>
</section>
<section
v-for="(record, index) in mine"
:key="record.id"
class="student-card"
>
<div class="student-summary">
<div>
<span class="record-index">{{
String(mine.length - index).padStart(2, "0")
}}</span>
<div>
<small
>{{ record.academicYear }} ·
{{ formatDate(record.testDate) }}</small
>
<h2>{{ record.batchName }}</h2>
<p>{{ record.standardVersion }}</p>
</div>
</div>
<div v-if="statusCode(record.status) === 1" class="compact-score">
<strong>{{ scoreText(record.totalScore) }}</strong
><el-tag :type="gradeType(record.grade)">{{
gradeLabels[gradeCode(record.grade)]
}}</el-tag>
</div>
<el-tag v-else :type="statusType(record.status)" size="large">{{
statusLabels[statusCode(record.status)]
}}</el-tag>
</div>
<p v-if="record.specialReason" class="special-note">
<Warning />{{ record.specialReason }}
</p>
<div v-if="statusCode(record.status) === 1" class="metric-grid">
<article
v-for="item in record.items.filter(
(x: Item) => itemCode(x.itemCode) >= 3,
)"
:key="itemCode(item.itemCode)"
:class="itemScoreClass(item.score)"
>
<div>
<span>{{ itemLabels[itemCode(item.itemCode)] }}</span
><em>{{ itemScoreLevel(item.score) }}</em>
</div>
<b>{{
itemCode(item.itemCode) === 9
? duration(item.value)
: `${item.value} ${item.unit}`
}}</b
><el-progress
:percentage="Math.min(Number(item.score ?? 0), 100)"
:show-text="false"
:stroke-width="5"
/><small>{{
t("fitnessTemplate.scoreScoreWeightWeightWeightedWeighted", {
score: scoreText(item.score),
weight: Math.round(Number(item.weight) * 100),
weighted: scoreText(item.weightedScore),
})
}}</small>
</article>
</div>
<footer v-if="statusCode(record.status) === 1">
<span>{{
t("fitnessTemplate.standardScore", {
score: scoreText(record.standardScore),
})
}}</span
><span>{{
t("fitnessTemplate.bonusScore", {
score: scoreText(record.bonusScore),
})
}}</span
><span>{{
t("fitnessTemplate.overallScore2", {
score: scoreText(record.totalScore),
})
}}</span>
</footer>
</section>
<el-empty
v-if="!loading && !mine.length"
:description="t('fitnessTemplate.noPublishedFitnessTestResults')"
/>
</template>
<template v-else>
<section class="workflow-strip">
<article>
<span>01</span>
<div>
<b>{{ t("fitnessTemplate.createBatch") }}</b
><small>{{
t("fitnessTemplate.setAcademicYearAndStandardVersion")
}}</small>
</div>
</article>
<i></i>
<article>
<span>02</span>
<div>
<b>{{ t("fitnessTemplate.enterAndReview") }}</b
><small>{{
t("fitnessTemplate.scoreAutomaticallyAndHandleExceptions")
}}</small>
</div>
</article>
<i></i>
<article>
<span>03</span>
<div>
<b>{{ t("businessLabels.publishResults") }}</b
><small>{{
t("fitnessTemplate.studentsSeePublishedDataOnly")
}}</small>
</div>
</article>
</section>
<section class="panel">
<div class="panel-title">
<div>
<span class="eyebrow">TEST BATCHES</span>
<h2>{{ t("fitnessTemplate.fitnessTestBatches") }}</h2>
<p>
{{
t(
"fitnessTemplate.selectABatchToViewDataQualityScoreDistributionAndStudentDetails",
)
}}
</p>
</div>
<el-button
circle
:icon="Refresh"
:aria-label="t('businessLabels.refresh')"
@click="load(true)"
/>
</div>
<div class="filters batch-filters">
<el-input
v-model="batchKeyword"
clearable
:placeholder="t('batchBusiness.searchBatchNameOrAcademicYear')"
@keyup.enter="load(true)"
><template #prefix
><el-icon><Search /></el-icon></template></el-input
><el-select
v-model="batchStatus"
clearable
:placeholder="t('batchBusiness.allPublicationStatuses')"
><el-option
:label="t('businessLabels.draft')"
:value="1" /><el-option
:label="t('businessLabels.published')"
:value="2" /></el-select
><el-button type="primary" plain @click="load(true)">{{
t("businessLabels.search")
}}</el-button>
</div>
<el-table
:data="batches"
v-loading="loading"
highlight-current-row
row-key="id"
@row-click="(row) => openBatch(row)"
><el-table-column :label="t('batchBusiness.batch')" min-width="250"
><template #default="{ row }"
><div class="batch-name">
<b>{{ row.name }}</b
><small
>{{ row.academicYear }} ·
{{ formatDate(row.testDate) }}</small
>
</div></template
></el-table-column
><el-table-column
:label="t('fitnessTemplate.recordBreakdown')"
min-width="180"
><template #default="{ row }"
><div class="record-composition">
<b>{{ row.recordCount }}</b
><span> {{ t("graduationAudits.people") }}</span
><small>{{
t("fitnessTemplate.normalNormalExemptExempt", {
normal: row.normalCount,
exempt: row.exemptCount,
})
}}</small>
</div></template
></el-table-column
><el-table-column :label="t('businessLabels.status')" width="170"
><template #default="{ row }"
><el-tag
:type="batchCode(row.status) === 2 ? 'success' : 'info'"
effect="plain"
>{{
batchCode(row.status) === 2
? t("fitnessTemplate.publishedVersionVersion", {
version: row.publicationCount,
})
: t("fitnessTemplate.incompleteDraft")
}}</el-tag
></template
></el-table-column
><el-table-column width="90" align="right"
><template #default="{ row }"
><el-button link type="primary" @click.stop="openBatch(row)">{{
t("fitnessTemplate.open")
}}</el-button></template
></el-table-column
></el-table
>
<div v-if="batchCursors.length || batchHasMore" class="pager">
<el-button :disabled="!batchCursors.length" @click="previousBatch">{{
t("businessLabels.previous")
}}</el-button
><span>{{ t("fitnessTemplate.pagePage", { page: batchPage }) }}</span
><el-button
type="primary"
plain
:disabled="!batchHasMore"
@click="nextBatch"
>{{ t("businessLabels.next") }}</el-button
>
</div>
</section>
<section v-if="selected" class="batch-workspace">
<header class="workspace-heading">
<div>
<span class="eyebrow"
>{{ selected.academicYear }} ·
{{ formatDate(selected.testDate) }}</span
>
<h2>{{ selected.name }}</h2>
<p>{{ selected.standardVersion }}</p>
</div>
<div v-if="canManage" class="actions">
<el-button :icon="Download" @click="downloadTemplate">{{
t("businessLabels.downloadTemplate")
}}</el-button
><label class="upload"
><Upload />{{ t("businessLabels.batchImport")
}}<input
type="file"
accept=".xlsx"
@change="importExcel" /></label
><el-button :icon="Plus" @click="editRecord()">{{
t("fitnessTemplate.addRecord")
}}</el-button
><el-button
type="success"
:icon="Promotion"
:disabled="!summary?.totalCount"
@click="publishDialog = true"
>{{
batchCode(selected.status) === 2
? t("fitnessTemplate.republish")
: t("businessLabels.publishResults")
}}</el-button
>
</div>
</header>
<el-alert
v-if="
batchCode(selected.status) === 1 && selected.publicationCount > 0
"
class="republish-alert"
type="warning"
:closable="false"
show-icon
:title="
t(
'fitnessTemplate.correctionsReturnedThisBatchToDraftAndMadeItInvisibleToStudentsRepublishAfterReview',
)
"
/>
<div class="summary-grid">
<article>
<div class="summary-icon teal"><UserFilled /></div>
<div>
<small>{{ t("fitnessTemplate.visibleRecords") }}</small
><strong>{{ summary?.totalCount ?? 0 }}</strong
><span>{{ t("fitnessTemplate.currentDataScope") }}</span>
</div>
</article>
<article>
<div class="summary-icon blue"><DataAnalysis /></div>
<div>
<small>{{ t("academicOverview.metric.average") }}</small
><strong>{{ scoreText(summary?.averageScore) }}</strong
><span>{{
t("fitnessTemplate.countValidScores", {
count: summary?.scoredCount ?? 0,
})
}}</span>
</div>
</article>
<article>
<div class="summary-icon green"><CircleCheck /></div>
<div>
<small>{{ t("workflowBatch.passRate") }}</small
><strong>{{ percentText(summary?.passRate) }}</strong
><span>{{
t("fitnessTemplate.countPassed", {
count: summary?.passCount ?? 0,
})
}}</span>
</div>
</article>
<article>
<div class="summary-icon amber"><Warning /></div>
<div>
<small>{{ t("dataQuality.severities.warning") }}</small
><strong>{{
specialCount +
(summary?.gradeDistribution.find(
(item) => gradeCode(item.grade) === 1,
)?.count ?? 0)
}}</strong
><span>{{ t("fitnessTemplate.failedOrSpecialStatus") }}</span>
</div>
</article>
</div>
<div class="analytics-row">
<section class="distribution-card">
<div class="section-heading">
<div>
<h3>{{ t("fitnessTemplate.gradeDistribution") }}</h3>
<p>
{{
t(
"fitnessTemplate.onlyNormalRecordsWithCompletedScoresAreCounted",
)
}}
</p>
</div>
<strong>{{
t("fitnessTemplate.highestScore", {
score: scoreText(summary?.highestScore),
})
}}</strong>
</div>
<div class="grade-bars">
<div v-for="item in gradeDistribution" :key="item.grade">
<span>{{ item.label }}</span>
<div>
<i
:class="`grade-${item.grade}`"
:style="{ width: `${gradePercent(item.count)}%` }"
></i>
</div>
<b>{{ item.count }} {{ t("graduationAudits.people") }}</b
><small>{{ gradePercent(item.count) }}%</small>
</div>
</div>
</section>
<section class="quality-card">
<h3>{{ t("fitnessTemplate.dataQuality") }}</h3>
<p>
{{
t("fitnessTemplate.reviewExceptionalRecordsBeforePublishing")
}}
</p>
<dl>
<div v-for="code in [1, 2, 3, 4]" :key="code">
<dt>
<i :class="`status-${code}`"></i>{{ statusLabels[code] }}
</dt>
<dd>
{{
summary?.statusDistribution.find(
(item) => statusCode(item.status) === code,
)?.count ?? 0
}}
</dd>
</div>
</dl>
</section>
</div>
<section class="records-panel">
<div class="panel-title compact">
<div>
<h2>{{ t("fitnessTemplate.studentResultDetails") }}</h2>
<p>
{{
t(
"fitnessTemplate.filtersRunOnTheServerSummaryCardsAlwaysShowTheEntireBatch",
)
}}
</p>
</div>
<span class="result-count">{{
t("fitnessTemplate.countRecordsOnThisPage", {
count: records.length,
})
}}</span>
</div>
<div class="filters">
<el-input
v-model="recordKeyword"
clearable
:placeholder="t('businessLabels.studentSearch')"
@keyup.enter="openBatch(selected)"
><template #prefix
><el-icon><Search /></el-icon></template></el-input
><el-select
v-model="recordStatus"
clearable
:placeholder="t('fitnessTemplate.allTestStatuses')"
><el-option
v-for="(label, value) in statusLabels"
:key="value"
:label="label"
:value="Number(value)" /></el-select
><el-select
v-model="recordGrade"
clearable
:placeholder="t('batchBusiness.allGradeLevels')"
><el-option
v-for="(label, value) in gradeLabels"
:key="value"
:label="label"
:value="Number(value)" /></el-select
><el-select
v-model="recordStudentGrade"
clearable
:placeholder="t('businessLabels.allGrades')"
@change="recordClassId = ''"
><el-option
v-for="value in recordFilterOptions.grades"
:key="value"
:label="t('fitnessTemplate.enrolledYear', { year: value })"
:value="value" /></el-select
><el-select
v-model="recordCollegeId"
clearable
filterable
:placeholder="t('businessLabels.allColleges')"
@change="onRecordCollegeChange"
><el-option
v-for="item in recordFilterOptions.colleges"
:key="item.id"
:label="item.name"
:value="item.id" /></el-select
><el-select
v-model="recordMajorId"
clearable
filterable
:placeholder="t('businessLabels.allMajors')"
@change="onRecordMajorChange"
><el-option
v-for="item in recordMajors"
:key="item.id"
:label="item.name"
:value="item.id" /></el-select
><el-select
v-model="recordClassId"
clearable
filterable
:placeholder="t('businessLabels.allClasses')"
><el-option
v-for="item in recordClasses"
:key="item.id"
:label="item.name"
:value="item.id" /></el-select
><el-checkbox v-model="attentionOnly">{{
t("fitnessTemplate.needsAttentionOnly")
}}</el-checkbox
><el-button
type="primary"
plain
:icon="Search"
@click="openBatch(selected)"
>{{ t("businessLabels.filter") }}</el-button
><el-button @click="resetRecordFilters">{{
t("businessLabels.reset")
}}</el-button
><el-button :icon="Download" @click="exportRecords">{{
t("businessLabels.exportFiltered")
}}</el-button>
</div>
<el-table
:data="records"
v-loading="loading"
row-key="id"
:empty-text="t('batchBusiness.noRecordsMatchTheFilters')"
><el-table-column type="expand"
><template #default="{ row }"
><div class="record-detail">
<div class="detail-meta">
<span
><small>{{ t("businessLabels.college") }}</small
>{{ row.collegeName }}</span
><span
><small>{{
t("businessLabels.administrativeClass")
}}</small
>{{ row.className }}</span
><span
><small>{{ t("batchBusiness.yearGender") }}</small
>{{
t("fitnessTemplate.universityYearGradeGender", {
grade: row.gradeLevel,
gender: genderLabel(row.gender),
})
}}</span
><span v-if="row.notes"
><small>{{ t("businessLabels.notes") }}</small
>{{ row.notes }}</span
>
</div>
<div v-if="statusCode(row.status) === 1" class="detail-items">
<article
v-for="item in row.items.filter(
(x: Item) => itemCode(x.itemCode) >= 3,
)"
:key="itemCode(item.itemCode)"
>
<span>{{ itemLabels[itemCode(item.itemCode)] }}</span
><b>{{
itemCode(item.itemCode) === 9
? duration(item.value)
: `${item.value} ${item.unit}`
}}</b
><small>{{
t("fitnessTemplate.scoreScoreWeightedWeighted", {
score: scoreText(item.score),
weighted: scoreText(item.weightedScore),
})
}}</small>
</article>
</div>
<el-alert
v-else
:closable="false"
:title="
row.specialReason ||
t('fitnessTemplate.noSpecialStatusExplanationProvided')
"
type="warning"
show-icon
/></div></template></el-table-column
><el-table-column
:label="t('batchBusiness.student')"
min-width="180"
fixed
><template #default="{ row }"
><div class="student-cell">
<b>{{ row.name }}</b
><small>{{ row.studentNumber }}</small>
</div></template
></el-table-column
><el-table-column
prop="className"
:label="t('businessLabels.administrativeClass')"
min-width="170"
show-overflow-tooltip
/><el-table-column :label="t('businessLabels.status')" width="100"
><template #default="{ row }"
><el-tag :type="statusType(row.status)" effect="plain">{{
statusLabels[statusCode(row.status)]
}}</el-tag></template
></el-table-column
><el-table-column
:label="t('batchBusiness.standardBonus')"
width="130"
><template #default="{ row }"
><span v-if="row.standardScore != null"
>{{ scoreText(row.standardScore) }}
<small class="plus-score"
>+ {{ scoreText(row.bonusScore) }}</small
></span
><span v-else>—</span></template
></el-table-column
><el-table-column
:label="t('batchBusiness.overallScore')"
width="155"
><template #default="{ row }"
><div v-if="row.totalScore != null" class="table-score">
<b>{{ scoreText(row.totalScore) }}</b
><el-tag size="small" :type="gradeType(row.grade)">{{
gradeLabels[gradeCode(row.grade)]
}}</el-tag>
</div>
<span v-else>—</span></template
></el-table-column
><el-table-column
v-if="canManage"
:label="t('businessLabels.actions')"
width="130"
fixed="right"
><template #default="{ row }"
><el-button link type="primary" @click="editRecord(row)">{{
t("businessLabels.edit")
}}</el-button
><el-button link type="danger" @click="removeRecord(row)">{{
t("businessLabels.delete")
}}</el-button></template
></el-table-column
></el-table
>
<div v-if="recordCursors.length || recordHasMore" class="pager">
<el-button
:disabled="!recordCursors.length"
@click="previousRecords"
>{{ t("archive.previous") }}</el-button
><span>{{
t("fitnessTemplate.pagePage", { page: recordPage })
}}</span
><el-button
type="primary"
plain
:disabled="!recordHasMore"
@click="nextRecords"
>{{ t("archive.next") }}</el-button
>
</div>
</section>
</section>
<el-empty
v-else-if="!loading && batches.length"
:description="
t('fitnessTemplate.selectAFitnessBatchToOpenItsGradingWorkspace')
"
/>
</template>
<el-dialog
v-model="batchDialog"
:title="t('fitnessTemplate.newFitnessTestBatch')"
width="min(520px, 94vw)"
><el-form label-position="top"
><el-form-item :label="t('businessLabels.batchName')" required
><el-input
v-model="batchForm.name"
:placeholder="
t('fitnessTemplate.forExampleFallFitnessTestForThe2026Cohort')
"
maxlength="150"
show-word-limit
/></el-form-item>
<div class="form-grid">
<el-form-item :label="t('baseData.academicYear')" required
><el-input
v-model="batchForm.academicYear"
placeholder="2026-2027" /></el-form-item
><el-form-item :label="t('batchBusiness.testDate')" required
><el-date-picker
v-model="batchForm.testDate"
type="date"
value-format="YYYY-MM-DD"
/></el-form-item>
</div>
<p class="form-tip">
{{
t(
"fitnessTemplate.newBatchesUseTheCurrentNationalStandardHistoricalResultsRetainTheirOriginalScoringSnapshotWhenStandardsChange",
)
}}
</p></el-form
><template #footer
><el-button @click="batchDialog = false">{{
t("businessLabels.cancel")
}}</el-button
><el-button type="primary" :loading="saving" @click="createBatch">{{
t("fitnessTemplate.createBatch")
}}</el-button></template
></el-dialog
>
<el-dialog
v-model="recordDialog"
:title="
recordForm.id
? t('fitnessTemplate.editFitnessRecord')
: t('fitnessTemplate.addFitnessRecord')
"
width="min(820px, 96vw)"
><el-form label-position="top"
><div class="form-grid three">
<el-form-item :label="t('businessLabels.studentNumber')" required
><el-input
v-model="recordForm.studentNumber"
:disabled="!!recordForm.id"
:placeholder="
t('batchBusiness.studentIsIdentifiedWhenTheFieldLosesFocus')
"
@blur="lookupStudent" /></el-form-item
><el-form-item :label="t('batchBusiness.fitnessTestStatus')" required
><el-select v-model="recordForm.status"
><el-option
v-for="(label, value) in statusLabels"
:key="value"
:label="label"
:value="Number(value)" /></el-select></el-form-item
><el-form-item :label="t('businessLabels.grade')"
><el-input-number
v-model="recordForm.gradeLevel"
:min="1"
:max="4"
:placeholder="
t('batchBusiness.leaveBlankToCalculateAutomatically')
"
/></el-form-item>
</div>
<div v-if="studentInfo" class="student-info">
<UserFilled />
<div>
<b>{{ studentInfo.name }}</b
><span
>{{ studentInfo.studentNumber }} · {{ studentInfo.collegeName }} ·
{{ studentInfo.className }} ·
{{ genderLabel(studentInfo.gender) }}</span
>
</div>
</div>
<template v-if="recordForm.status === 1"
><div class="form-section-title">
<span>{{ t("batchBusiness.bodyMeasurementsAndFunction") }}</span
><small>{{
t(
"fitnessTemplate.bmiAndAllComponentScoresAreCalculatedAutomatically",
)
}}</small>
</div>
<div class="form-grid three">
<el-form-item :label="t('fitnessTemplate.heightCm')" required
><el-input-number
v-model="recordForm.heightCm"
:min="80"
:max="250"
:precision="1" /></el-form-item
><el-form-item :label="t('fitnessTemplate.weightKg')" required
><el-input-number
v-model="recordForm.weightKg"
:min="20"
:max="300"
:precision="1" /></el-form-item
><el-form-item
:label="t('fitnessTemplate.vitalCapacityMl')"
required
><el-input-number
v-model="recordForm.vitalCapacityMl"
:min="100"
:max="10000"
/></el-form-item>
</div>
<div class="form-section-title">
<span>{{ t("batchBusiness.physicalPerformance") }}</span
><small>{{
t(
"fitnessTemplate.enterEnduranceTimeInTotalSecondsForExample342Is222",
)
}}</small>
</div>
<div class="form-grid">
<el-form-item
:label="t('fitnessTemplate.message50MSprintSeconds')"
required
><el-input-number
v-model="recordForm.sprint50MSeconds"
:min="4"
:max="30"
:precision="1" /></el-form-item
><el-form-item :label="t('fitnessTemplate.sitAndReachCm')" required
><el-input-number
v-model="recordForm.sitAndReachCm"
:min="-40"
:max="60"
:precision="1" /></el-form-item
><el-form-item
:label="t('fitnessTemplate.standingLongJumpCm')"
required
><el-input-number
v-model="recordForm.standingLongJumpCm"
:min="50"
:max="400" /></el-form-item
><el-form-item
:label="
genderCode(studentInfo?.gender) === 2
? t('fitnessTemplate.oneMinuteSitUpsRepetitions')
: t('fitnessTemplate.pullUpsRepetitions')
"
required
><el-input-number
v-model="recordForm.strengthCount"
:min="0"
:max="200" /></el-form-item
><el-form-item
:label="
genderCode(studentInfo?.gender) === 2
? t('fitnessTemplate.message800MRunTotalSeconds')
: t('fitnessTemplate.message1000MRunTotalSeconds')
"
required
><el-input-number
v-model="recordForm.enduranceRunSeconds"
:min="120"
:max="1200"
/></el-form-item></div></template
><el-form-item
v-else
:label="t('batchBusiness.reasonForSpecialStatus')"
:required="[3, 4].includes(recordForm.status)"
><el-input
v-model="recordForm.specialReason"
type="textarea"
:rows="3"
:placeholder="
t('batchBusiness.explainTheAbsenceDeferralOrExemption')
"
maxlength="500"
show-word-limit /></el-form-item
><el-form-item :label="t('batchBusiness.internalNotes')"
><el-input
v-model="recordForm.notes"
:placeholder="t('batchBusiness.optionallyEnterReviewDetails')"
maxlength="500"
show-word-limit /></el-form-item></el-form
><template #footer
><el-button @click="recordDialog = false">{{
t("businessLabels.cancel")
}}</el-button
><el-button type="primary" :loading="saving" @click="saveRecord">{{
recordForm.status === 1
? t("fitnessTemplate.saveAndScore")
: t("fitnessTemplate.saveSpecialStatus")
}}</el-button></template
></el-dialog
>
<el-dialog
v-model="publishDialog"
:title="t('batchBusiness.publishFitnessTestResults')"
width="min(500px, 94vw)"
><div class="publish-confirm">
<CircleCheck />
<div>
<h3>{{ t("fitnessTemplate.publishThisBatchToStudents") }}</h3>
<p>
{{
t(
"fitnessTemplate.thisPublicationIncludesTotalRecordsScoredScoredAndSpecialWithSpecialStatus",
{
total: summary?.totalCount ?? 0,
scored: summary?.scoredCount ?? 0,
special: specialCount,
},
)
}}
</p>
<small>{{
t(
"fitnessTemplate.correctionsReturnTheBatchToDraftReviewAndRepublishAfterward",
)
}}</small>
</div>
</div>
<template #footer
><el-button @click="publishDialog = false">{{
t("businessLabels.cancel")
}}</el-button
><el-button type="success" :loading="saving" @click="publish">{{
t("businessLabels.confirmPublish")
}}</el-button></template
></el-dialog
>
</main>
</template>
<style scoped>
.fitness-page {
--ink: #18322f;
--muted: #6b7e79;
--line: #dce8e5;
--teal: #087f78;
--soft: #eaf7f4;
padding-bottom: 48px;
color: var(--ink);
}
.fitness-hero {
position: relative;
display: flex;
justify-content: space-between;
align-items: end;
gap: 24px;
padding: 34px;
margin-bottom: 20px;
border-radius: 0 0 22px 22px;
background: linear-gradient(120deg, #f4fbf9, #fff 56%, #eef5f4);
overflow: hidden;
}
.fitness-hero::after {
content: "";
position: absolute;
right: 12%;
top: -85px;
width: 210px;
height: 210px;
border: 36px solid rgba(8, 127, 120, 0.06);
border-radius: 50%;
}
.fitness-hero > * {
position: relative;
z-index: 1;
}
.eyebrow {
display: block;
color: var(--teal);
font-size: 11px;
letter-spacing: 0.17em;
font-weight: 800;
}
.fitness-hero h1 {
margin: 8px 0 6px;
font-size: clamp(27px, 3vw, 38px);
letter-spacing: -0.04em;
}
.fitness-hero p,
.panel-title p,
.workspace-heading p,
.section-heading p {
margin: 0;
color: var(--muted);
line-height: 1.65;
}
.workflow-strip {
display: flex;
align-items: center;
padding: 14px 18px;
margin-bottom: 18px;
border: 1px solid var(--line);
border-radius: 14px;
background: #fff;
}
.workflow-strip article {
display: flex;
align-items: center;
gap: 10px;
min-width: 170px;
}
.workflow-strip article > span {
display: grid;
place-items: center;
width: 34px;
height: 34px;
border-radius: 50%;
background: var(--soft);
color: var(--teal);
font: 700 12px monospace;
}
.workflow-strip b,
.workflow-strip small {
display: block;
}
.workflow-strip small {
color: var(--muted);
font-size: 11px;
}
.workflow-strip > i {
height: 1px;
flex: 1;
margin: 0 14px;
background: linear-gradient(90deg, var(--line), var(--teal), var(--line));
}
.panel,
.batch-workspace,
.student-card,
.student-overview,
.student-insights {
background: #fff;
border: 1px solid var(--line);
border-radius: 16px;
box-shadow: 0 12px 32px rgba(25, 72, 64, 0.055);
}
.panel {
margin-bottom: 18px;
overflow: hidden;
}
.panel-title,
.workspace-heading,
.student-summary {
display: flex;
justify-content: space-between;
align-items: center;
gap: 20px;
padding: 22px 24px 16px;
}
.panel-title h2,
.workspace-heading h2,
.student-summary h2 {
margin: 6px 0;
font-size: 21px;
}
.actions,
.filters,
.pager {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.filters {
padding: 0 24px 18px;
}
.filters .el-input {
max-width: 300px;
}
.filters .el-select {
width: 165px;
}
.batch-filters .el-input {
max-width: 360px;
}
.upload {
display: inline-flex;
align-items: center;
gap: 6px;
height: 32px;
box-sizing: border-box;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 0 14px;
color: #606266;
cursor: pointer;
font-size: 14px;
}
.upload svg {
width: 1em;
}
.upload input {
display: none;
}
.pager {
justify-content: flex-end;
padding: 14px 22px;
color: var(--muted);
font-size: 13px;
border-top: 1px solid #edf2f1;
}
.batch-name b,
.batch-name small,
.student-cell b,
.student-cell small {
display: block;
}
.batch-name small,
.student-cell small {
margin-top: 4px;
color: var(--muted);
font-size: 12px;
}
.record-composition b {
font-size: 19px;
}
.record-composition span,
.record-composition small {
color: var(--muted);
font-size: 12px;
}
.record-composition small {
display: block;
}
.batch-workspace {
margin-top: 20px;
overflow: hidden;
}
.workspace-heading {
padding: 25px 26px;
background: linear-gradient(120deg, #f7fbfa, #fff);
}
.workspace-heading h2 {
font-size: 25px;
}
.actions {
justify-content: flex-end;
}
.republish-alert {
border-radius: 0;
}
.summary-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
padding: 20px 24px 14px;
background: #f8fbfa;
}
.summary-grid article {
display: flex;
align-items: center;
gap: 13px;
padding: 16px;
background: #fff;
border: 1px solid #e5eeec;
border-radius: 13px;
}
.summary-icon {
display: grid;
place-items: center;
width: 40px;
height: 40px;
border-radius: 11px;
}
.summary-icon svg {
width: 19px;
}
.summary-icon.teal {
background: #e6f5f2;
color: #087f78;
}
.summary-icon.blue {
background: #edf3fb;
color: #35658b;
}
.summary-icon.green {
background: #edf8ef;
color: #3e8050;
}
.summary-icon.amber {
background: #fff4e5;
color: #aa6814;
}
.summary-grid small,
.summary-grid strong,
.summary-grid span {
display: block;
}
.summary-grid small,
.summary-grid span {
color: var(--muted);
font-size: 11px;
}
.summary-grid strong {
margin: 3px 0;
font:
700 25px ui-monospace,
Consolas,
monospace;
}
.analytics-row {
display: grid;
grid-template-columns: 1.55fr 0.75fr;
gap: 14px;
padding: 0 24px 20px;
background: #f8fbfa;
}
.distribution-card,
.quality-card {
padding: 19px 20px;
border: 1px solid #e5eeec;
border-radius: 13px;
background: #fff;
}
.section-heading {
display: flex;
justify-content: space-between;
}
.section-heading h3,
.quality-card h3 {
margin: 0 0 4px;
font-size: 15px;
}
.section-heading p,
.quality-card p {
font-size: 12px;
}
.section-heading > strong {
font-size: 12px;
color: var(--teal);
background: var(--soft);
padding: 6px 9px;
border-radius: 8px;
}
.grade-bars {
display: grid;
gap: 9px;
margin-top: 17px;
}
.grade-bars > div {
display: grid;
grid-template-columns: 48px 1fr 48px 34px;
align-items: center;
gap: 8px;
font-size: 12px;
}
.grade-bars > div > div {
height: 7px;
border-radius: 6px;
background: #edf2f1;
overflow: hidden;
}
.grade-bars i {
display: block;
height: 100%;
min-width: 2px;
}
.grade-4 {
background: #26946c;
}
.grade-3 {
background: #3d7da5;
}
.grade-2 {
background: #d49b38;
}
.grade-1 {
background: #cf5c55;
}
.grade-bars small {
color: var(--muted);
text-align: right;
}
.quality-card dl {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 9px;
margin: 16px 0 0;
}
.quality-card dl div {
display: flex;
justify-content: space-between;
padding: 9px;
background: #f7faf9;
border-radius: 8px;
}
.quality-card dt {
display: flex;
align-items: center;
gap: 6px;
color: var(--muted);
font-size: 12px;
}
.quality-card dt i {
width: 7px;
height: 7px;
border-radius: 50%;
}
.status-1 {
background: #29956f;
}
.status-2,
.status-3 {
background: #dd8b31;
}
.status-4 {
background: #84948f;
}
.quality-card dd {
margin: 0;
font-weight: 700;
}
.records-panel {
border-top: 1px solid var(--line);
}
.result-count {
padding: 6px 10px;
border-radius: 8px;
background: #f1f6f5;
color: var(--muted);
font-size: 12px;
}
.record-detail {
padding: 6px 30px 18px;
}
.detail-meta {
display: flex;
gap: 28px;
flex-wrap: wrap;
margin-bottom: 15px;
}
.detail-meta span {
font-size: 13px;
}
.detail-meta small {
display: block;
color: var(--muted);
font-size: 10px;
}
.detail-items {
display: grid;
grid-template-columns: repeat(4, minmax(120px, 1fr));
gap: 8px;
}
.detail-items article {
padding: 10px 12px;
border: 1px solid #e4eeec;
border-radius: 9px;
background: #fbfdfc;
}
.detail-items span,
.detail-items small,
.detail-items b {
display: block;
}
.detail-items span,
.detail-items small {
color: var(--muted);
font-size: 11px;
}
.detail-items b {
margin: 4px 0;
font-size: 14px;
}
.plus-score {
color: var(--teal);
}
.table-score {
display: flex;
align-items: center;
gap: 8px;
}
.student-overview {
display: flex;
justify-content: space-between;
align-items: center;
min-height: 210px;
padding: 30px 38px;
margin-bottom: 16px;
background: linear-gradient(125deg, #103d39, #1b5750 58%, #28756b);
color: #fff;
}
.student-overview .eyebrow {
color: #8fe0d4;
}
.overview-copy h2 {
margin: 9px 0 4px;
font-size: 29px;
}
.overview-copy p {
margin: 0;
color: #c3dcd8;
}
.overview-tags {
display: flex;
align-items: center;
gap: 11px;
margin-top: 22px;
color: #d6e7e4;
font-size: 13px;
}
.overview-tags .up {
color: #94e6b3;
}
.overview-tags .down {
color: #ffbbb4;
}
.score-orbit {
display: grid;
place-items: center;
width: 150px;
height: 150px;
padding: 9px;
border-radius: 50%;
background: conic-gradient(#6ed7c6 var(--score), rgba(255, 255, 255, 0.14) 0);
}
.score-orbit > div {
display: grid;
place-items: center;
width: 100%;
height: 100%;
border-radius: 50%;
background: #174943;
}
.score-orbit strong {
font:
700 36px ui-monospace,
Consolas,
monospace;
}
.score-orbit span {
color: #bcd7d2;
font-size: 11px;
}
.special-state {
display: flex;
flex-direction: column;
align-items: center;
gap: 7px;
padding: 25px 40px;
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 18px;
}
.student-insights {
display: grid;
grid-template-columns: repeat(3, 1fr);
margin-bottom: 16px;
overflow: hidden;
}
.student-insights article {
display: flex;
align-items: center;
gap: 13px;
padding: 18px 22px;
border-right: 1px solid var(--line);
}
.student-insights svg {
width: 23px;
color: var(--teal);
}
.student-insights small,
.student-insights strong {
display: block;
}
.student-insights small {
color: var(--muted);
font-size: 11px;
}
.student-insights i {
color: var(--teal);
font-style: normal;
}
.student-card {
margin-bottom: 16px;
overflow: hidden;
}
.student-summary > div:first-child {
display: flex;
align-items: center;
gap: 14px;
}
.record-index {
display: grid;
place-items: center;
width: 40px;
height: 40px;
border-radius: 11px;
background: var(--soft);
color: var(--teal);
font: 700 13px monospace;
}
.student-summary h2 {
font-size: 18px;
}
.student-summary small,
.student-summary p {
color: var(--muted);
font-size: 12px;
}
.compact-score {
display: flex;
align-items: center;
gap: 10px;
}
.compact-score strong {
font:
700 25px ui-monospace,
Consolas,
monospace;
}
.metric-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 10px;
padding: 7px 22px 20px;
}
.metric-grid article {
padding: 14px;
border-radius: 12px;
background: #f7faf9;
border: 1px solid #e5efed;
}
.metric-grid article > div {
display: flex;
justify-content: space-between;
}
.metric-grid span,
.metric-grid small {
display: block;
color: var(--muted);
font-size: 11px;
}
.metric-grid em {
font-size: 10px;
font-style: normal;
}
.metric-grid .danger em {
color: #c94e48;
}
.metric-grid .warning em {
color: #a5711d;
}
.metric-grid .success em {
color: #278161;
}
.metric-grid b {
display: block;
margin: 7px 0 9px;
}
.metric-grid small {
margin-top: 8px;
}
.student-card footer {
display: flex;
gap: 26px;
padding: 12px 22px;
background: #f7faf9;
color: var(--muted);
border-top: 1px solid var(--line);
font-size: 12px;
}
.special-note {
display: flex;
gap: 7px;
padding: 12px 22px;
margin: 0;
background: #fff8e9;
color: #8a672b;
}
.special-note svg {
width: 16px;
}
.form-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0 16px;
}
.form-grid.three {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-grid :deep(.el-input-number),
.form-grid :deep(.el-select),
.form-grid :deep(.el-date-editor) {
width: 100%;
}
.form-tip {
padding: 11px 13px;
background: #eef8f6;
border-left: 3px solid var(--teal);
color: #42635e;
font-size: 13px;
}
.student-info {
display: flex;
gap: 11px;
margin-bottom: 19px;
padding: 12px 14px;
border-radius: 10px;
background: #eef8f6;
}
.student-info svg {
width: 22px;
}
.student-info b,
.student-info span {
display: block;
}
.student-info span {
font-size: 12px;
}
.form-section-title {
display: flex;
justify-content: space-between;
margin: 4px 0 12px;
padding-bottom: 7px;
border-bottom: 1px solid var(--line);
}
.form-section-title small {
color: var(--muted);
}
.publish-confirm {
display: flex;
gap: 15px;
}
.publish-confirm > svg {
width: 34px;
flex: 0 0 auto;
color: #329268;
}
.publish-confirm h3 {
margin: 2px 0 8px;
}
.publish-confirm p {
line-height: 1.6;
}
.publish-confirm small {
color: var(--muted);
}
@media (max-width: 1000px) {
.summary-grid {
grid-template-columns: 1fr 1fr;
}
.analytics-row {
grid-template-columns: 1fr;
}
.detail-items {
grid-template-columns: repeat(2, 1fr);
}
.workflow-strip article {
min-width: 0;
}
.workflow-strip small {
display: none;
}
}
@media (max-width: 760px) {
.fitness-hero,
.workspace-heading,
.student-overview,
.student-summary {
align-items: flex-start;
flex-direction: column;
}
.fitness-hero {
padding: 25px 20px;
}
.fitness-hero .el-button {
width: 100%;
}
.workflow-strip article {
display: block;
text-align: center;
}
.workflow-strip article > span {
margin: auto;
}
.filters .el-input,
.filters .el-select {
width: 100%;
max-width: none;
}
.actions {
justify-content: flex-start;
margin-top: 14px;
}
.summary-grid {
padding: 14px;
}
.analytics-row {
padding: 0 14px 14px;
}
.score-orbit {
width: 118px;
height: 118px;
align-self: center;
}
.student-insights {
grid-template-columns: 1fr;
}
.student-insights article {
border-right: 0;
border-bottom: 1px solid var(--line);
}
.metric-grid,
.detail-items {
grid-template-columns: 1fr 1fr;
}
.form-grid,
.form-grid.three {
grid-template-columns: 1fr;
}
.student-card footer {
flex-wrap: wrap;
}
}
@media (max-width: 480px) {
.summary-grid,
.metric-grid,
.detail-items {
grid-template-columns: 1fr;
}
.grade-bars > div {
grid-template-columns: 42px 1fr 42px;
}
.grade-bars small {
display: none;
}
.student-overview {
padding: 24px;
}
.record-detail {
padding: 6px 16px 16px;
}
}
</style>