liuyu
21 小时以前 93c133349a5ccd7a328371fa113dce69d5611f21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { ref } from 'vue';
 
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 labelOfDic(GRADE_STATUS_OPTIONS.value, v);
}
 
export function colorOfGradeStatus(v?: string) {
  return (v && GRADE_STATUS_COLOR[v]) || undefined;
}