newWord.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import {
  2. displayList,
  3. serialNumberTypeList,
  4. serialNumberPositionList,
  5. arrangeTypeList,
  6. switchOption,
  7. isEnable,
  8. } from '@/views/book/courseware/data/common';
  9. export { arrangeTypeList, switchOption, isEnable };
  10. export const wordShowList = [
  11. { value: 'true', label: '是' },
  12. { value: 'false', label: '否' },
  13. ];
  14. export const inforList = [
  15. { value: 'true', label: '有' },
  16. { value: 'false', label: '没有' },
  17. ];
  18. // 拼音位置
  19. export const pinyinPositionList = [
  20. { value: 'front', label: '前面' },
  21. { value: 'back', label: '后面' },
  22. { value: 'top', label: '上面' },
  23. { value: 'bottom', label: '下面' },
  24. ];
  25. // 读音生成方式
  26. export const audioGenerationMethodList = [
  27. {
  28. value: 'upload',
  29. label: '上传',
  30. },
  31. {
  32. value: 'auto',
  33. label: '自动生成',
  34. },
  35. {
  36. value: 'record',
  37. label: '录音',
  38. },
  39. ];
  40. export function getOption() {
  41. return {
  42. number: '',
  43. new_word: '',
  44. cixing: '', // 词性
  45. definition_list: '', // 释义
  46. pinyin: '',
  47. mp3_list: '',
  48. collocation: '', // 搭配
  49. liju_list: '', // 例句
  50. file_list: [''], // 图片
  51. header_con: '', // 页眉
  52. label: '', // 标签
  53. hz_info: [],
  54. };
  55. }
  56. export function getNewWordProperty() {
  57. return {
  58. serial_number: 1,
  59. sn_type: serialNumberTypeList[0].value,
  60. sn_position: serialNumberPositionList[3].value,
  61. sn_display_mode: displayList[0].value,
  62. audio_generation_method: audioGenerationMethodList[0].value,
  63. pinyin_position: pinyinPositionList[0].value,
  64. is_word_show: wordShowList[1].value,
  65. is_has_infor: inforList[0].value,
  66. };
  67. }
  68. export function getNewWordData() {
  69. return {
  70. type: 'new_word',
  71. title: '生词组件',
  72. property: getNewWordProperty(),
  73. title_con: '',
  74. new_word_list: [getOption()],
  75. lrc_arr: [], // lrc 文件解析后的数据
  76. // lrc 文件数据
  77. lrc_data: {
  78. name: '',
  79. url: '',
  80. id: '',
  81. file_id: '',
  82. },
  83. // 音频文件数据
  84. audio_data: {
  85. name: '',
  86. media_duration: 0,
  87. temporary_url: '',
  88. url: '',
  89. file_id: '',
  90. },
  91. mind_map: {
  92. node_list: [
  93. { name: '生词组件' }
  94. ], // 思维导图数据
  95. },
  96. answer: {
  97. answer_list: [],
  98. },
  99. };
  100. }