routerword.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. 'use strict';
  2. module.exports = (route, method) => {
  3. const rou = route.replace('/api/train/', '');
  4. const keys = rou.split('/');
  5. if (keys <= 0) return;
  6. const routeWord = {
  7. common: '工具函数相关',
  8. util: '工具函数相关',
  9. setting: '设置相关',
  10. subject: '科目',
  11. teacher: '教师',
  12. task: '作业',
  13. question: '问卷题库',
  14. questionnaire: '问卷',
  15. student: '学生',
  16. headteacher: '班主任',
  17. bedroom: '寝室',
  18. class: '班级',
  19. department: '部门',
  20. location: '位置',
  21. trainplan: '培训计划',
  22. trainplanyear: '批次计划',
  23. festival: '节假日',
  24. lesson: '课表',
  25. schtime: '学校时间上报',
  26. teaplan: '班主任安排',
  27. apply: '教师安排',
  28. leave: '请假/退出',
  29. group: '小组',
  30. experience: '培训心得',
  31. duty: '职责',
  32. uploadtask: '上交作业',
  33. uploadquestion: '填写问卷',
  34. attendance: '考勤',
  35. school: '学校',
  36. nation: '字典表-民族',
  37. region: '字典表-行政区划',
  38. user: '用户',
  39. auth: '微信登录',
  40. login: '用户密码登录',
  41. qrcode: '扫码登陆',
  42. score: '教师分数',
  43. material: '教师资料',
  44. materialscore: '教师资料评分',
  45. notice: '通知',
  46. lessonmode: '课程模板',
  47. trainmodel: '计划模板',
  48. countstudent: '统计',
  49. classtype: '班级类型',
  50. job: '学校上传名单',
  51. message: '消息',
  52. personalscore: '学生个人分',
  53. groupscore: '学生小组分',
  54. cerconfirm: '校验学生证书资格',
  55. talented: '新人才报',
  56. };
  57. let word = routeWord[keys[0]];
  58. if (method === 'DELETE') {
  59. return `${word}删除`;
  60. } else if (!word.includes('相关')) {
  61. if (rou.includes('update')) {
  62. word = `${word}修改`;
  63. } else if (rou.includes('export')) {
  64. word = `${word}导出`;
  65. } else if (keys.length === 1) {
  66. word = `新建${word}`;
  67. }
  68. }
  69. // const student = {
  70. // '/api/train/student/upjob': '修改职位',
  71. // '/api/train/student/deleteclass': '删除学生班级',
  72. // };
  73. return word;
  74. };