This commit is contained in:
2026-07-20 10:45:35 +08:00 Unverified
parent 7094e9b916
commit 352f471ed0
17 changed files with 342 additions and 60 deletions
+11
View File
@@ -25,6 +25,17 @@ export function h(value) {
return String(value ?? '').replace(/[&<>'"]/g, char => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', "'": '&#39;', '"': '&quot;' }[char]));
}
export function passPolicyText(exam) {
const value = Number(exam?.passValue ?? 60);
return {
fixed_score: `总分达到 ${value}`,
score_ratio: `得分率达到 ${value}%`,
rank_percent: `总成绩排名前 ${value}%`,
subject_scores: '所有报考科目均达单科线',
none: '仅发布成绩,不判定合格'
}[exam?.passPolicy || 'score_ratio'];
}
export function formatDate(value, withTime = false) {
if (!value) return '待定';
const date = new Date(value);