commonDictConvert.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // 科目对应的颜色
  2. export const subjectToColor = (subject)=>{
  3. switch(subject){
  4. case '班主任':
  5. return { name: '班主任', color: '#6A8AEC' }
  6. case '语文':
  7. return { name: '语文', color: '#91CC75' }
  8. case '数学':
  9. return { name: '数学', color: '#FAC858' }
  10. case '英语':
  11. return { name: '英语', color: '#EE6666' }
  12. case '物理':
  13. return { name: '物理', color: '#817BE2' }
  14. case '化学':
  15. return { name: '化学', color: '#73C0DE' }
  16. case '生物':
  17. return { name: '生物', color: '#3BA272' }
  18. case '政治':
  19. return { name: '政治', color: '#63A1FF' }
  20. case '历史':
  21. return { name: '历史', color: '#FC8452' }
  22. case '地理':
  23. return { name: '地理', color: '#9A60B4' }
  24. case '道法':
  25. return { name: '道法', color: '#FF869D' }
  26. default:
  27. return { name: '其他', color: '#C495FA' }
  28. }
  29. }
  30. // 试题类型状态转换
  31. export const qustionTypeToName = (type)=>{
  32. switch(Number(type)){
  33. case 0:
  34. return '单选题'
  35. case 1:
  36. return '多选题'
  37. case 2:
  38. return '问答题'
  39. case 3:
  40. return '评分单选题'
  41. case 5: //4
  42. return '评价题'
  43. }
  44. }
  45. // evaluationStatus: number //评价状态 0-待评价 1-进行中 2-已评价
  46. type QuestionnaireStatus = 'done' | 'pending' | 'unfinish' | string
  47. // 科目教师问卷评价进度 状态转换
  48. export const fillOutStatusToColor = (status:number|string)=>{
  49. switch(Number(status)){
  50. case 2:
  51. return {color:'#2BC644',label:'已完成',statusName:'已评价'}
  52. case 1:
  53. return {color:'#2E64FA',label:'进行中',statusName:'进行中'}
  54. case 0:
  55. return {color:'#999999',label:'未完成',statusName:'待评价'}
  56. }
  57. }
  58. // 整卷填写 的 问卷是否处于未完成 状态
  59. export const IsSubjectQuestionnaireUnFinish = (status:number)=>{
  60. return Number(status) === 0
  61. }
  62. // 按题填写的 试题 是否处于已完成状态
  63. export const IsSplitQuestionnaireFinish = (status)=>{
  64. return Number(status) === 2
  65. }
  66. // 按题填写的试题是否处于 未完成状态
  67. export const IsSplitQuestionnaireUnFinish = (status)=>{
  68. return Number(status) === 0
  69. }