routerword.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. y: '云就业相关',
  57. };
  58. let word = routeWord[keys[0]];
  59. if (method === 'DELETE') {
  60. return `${word}删除`;
  61. } else if (!word.includes('相关')) {
  62. if (rou.includes('update')) {
  63. word = `${word}修改`;
  64. } else if (rou.includes('export')) {
  65. word = `${word}导出`;
  66. } else if (keys.length === 1) {
  67. word = `新建${word}`;
  68. }
  69. }
  70. // const student = {
  71. // '/api/train/student/upjob': '修改职位',
  72. // '/api/train/student/deleteclass': '删除学生班级',
  73. // };
  74. return word;
  75. };