From 93c133349a5ccd7a328371fa113dce69d5611f21 Mon Sep 17 00:00:00 2001
From: liuyu <yu.liu@cqgbkj.com>
Date: 星期二, 22 九月 2026 09:25:39 +0800
Subject: [PATCH] feat(tms): 完成课程考试自测等页面与接口对接

---
 apps/jnpf-web-apps-main/src/views/x/tms/examGrade/constants.ts |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/apps/jnpf-web-apps-main/src/views/x/tms/examGrade/constants.ts b/apps/jnpf-web-apps-main/src/views/x/tms/examGrade/constants.ts
index 715308e..7fb8f54 100644
--- a/apps/jnpf-web-apps-main/src/views/x/tms/examGrade/constants.ts
+++ b/apps/jnpf-web-apps-main/src/views/x/tms/examGrade/constants.ts
@@ -1,15 +1,25 @@
-import type { GradeStatus } from './types';
+import { ref } from 'vue';
 
-export const GRADE_STATUS_OPTIONS: { id: GradeStatus; fullName: string; color?: string }[] = [
-  { id: 'auto', fullName: '鏃犻渶闃呭嵎', color: '#8c8c8c' },
-  { id: 'pending', fullName: '寰呮壒鏀�', color: '#fa8c16' },
-  { id: 'graded', fullName: '宸叉壒鏀�', color: '#52c41a' },
-];
+import { useBaseStore } from '#/store';
+import { TMS_DIC, labelOfDic, loadTmsDic, type TmsDicOpt } from '#/views/x/tms/shared/dic';
+
+const GRADE_STATUS_COLOR: Record<string, string> = {
+  auto: '#8c8c8c',
+  pending: '#fa8c16',
+  graded: '#52c41a',
+};
+
+export const GRADE_STATUS_OPTIONS = ref<TmsDicOpt[]>([]);
+
+export async function loadExamGradeDics() {
+  const baseStore = useBaseStore();
+  GRADE_STATUS_OPTIONS.value = await loadTmsDic(baseStore, TMS_DIC.gradeStatus);
+}
 
 export function labelOfGradeStatus(v?: string) {
-  return GRADE_STATUS_OPTIONS.find((x) => x.id === v)?.fullName ?? v ?? '-';
+  return labelOfDic(GRADE_STATUS_OPTIONS.value, v);
 }
 
 export function colorOfGradeStatus(v?: string) {
-  return GRADE_STATUS_OPTIONS.find((x) => x.id === v)?.color;
+  return (v && GRADE_STATUS_COLOR[v]) || undefined;
 }

--
Gitblit v1.8.0