liuyu
4 小时以前 82a74ba0402ab546ba524d23ce62198c4d00d2f7
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
export const ENABLE_OPTIONS = [
  { id: '1', fullName: '启用' },
  { id: '0', fullName: '停用' },
];
 
/** tmsCourseCategory */
export const CATEGORY_OPTIONS = [
  { id: 'gmp', fullName: 'GMP' },
  { id: 'sop', fullName: 'SOP' },
  { id: 'safety', fullName: '安全' },
  { id: 'skill', fullName: '技能' },
  { id: 'other', fullName: '其他' },
];
 
/** 与培训方式配置编码对齐 */
export const TRAIN_MODE_OPTIONS = [
  { id: 'onsite', fullName: '集中授课' },
  { id: 'practice', fullName: '操作授课' },
  { id: 'online', fullName: '在线学习' },
];
 
/** 与考核方式配置编码对齐 */
export const EVAL_MODE_OPTIONS = [
  { id: 'quiz', fullName: '提问' },
  { id: 'practice', fullName: '现场操作' },
  { id: 'exam', fullName: '在线考试' },
  { id: 'none', fullName: '无需考核' },
];
 
export function labelOfEnabled(v?: string) {
  return ENABLE_OPTIONS.find((x) => x.id === v)?.fullName || v || '-';
}
 
export function labelOfCategory(v?: string) {
  return CATEGORY_OPTIONS.find((x) => x.id === v)?.fullName || v || '-';
}
 
export function labelOfTrainMode(v?: string) {
  return TRAIN_MODE_OPTIONS.find((x) => x.id === v)?.fullName || v || '-';
}
 
export function labelOfEvalMode(v?: string) {
  return EVAL_MODE_OPTIONS.find((x) => x.id === v)?.fullName || v || '-';
}
 
/** 在线考试时关联试卷建议必填 */
export function evalModeNeedPaper(evalMode?: string) {
  return evalMode === 'exam';
}