otherWord.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. // 拼音位置
  11. export const pinyinPositionList = [
  12. { value: 'front', label: '前面' },
  13. { value: 'back', label: '后面' },
  14. { value: 'top', label: '上面' },
  15. { value: 'bottom', label: '下面' },
  16. ];
  17. // 读音生成方式
  18. export const audioGenerationMethodList = [
  19. {
  20. value: 'upload',
  21. label: '上传',
  22. },
  23. {
  24. value: 'auto',
  25. label: '自动生成',
  26. },
  27. {
  28. value: 'record',
  29. label: '录音',
  30. },
  31. ];
  32. export function getOption() {
  33. return {
  34. number: '',
  35. new_word: '',
  36. cixing: '', // 词性
  37. definition_list: '', // 需要增加词性
  38. pinyin: '',
  39. mp3_list: '',
  40. collocation: '', // 搭配
  41. liju_list: '', // 例句
  42. };
  43. }
  44. export function getOtherWordProperty() {
  45. return {
  46. serial_number: 1,
  47. sn_type: serialNumberTypeList[0].value,
  48. sn_position: serialNumberPositionList[3].value,
  49. sn_display_mode: displayList[0].value,
  50. audio_generation_method: audioGenerationMethodList[0].value,
  51. pinyin_position: pinyinPositionList[0].value,
  52. };
  53. }
  54. export function getOtherWordData() {
  55. return {
  56. type: 'other_word',
  57. title: '其他词汇',
  58. property: getOtherWordProperty(),
  59. option: [getOption()],
  60. lrc_arr: [], // lrc 文件解析后的数据
  61. // lrc 文件数据
  62. lrc_data: {
  63. name: '',
  64. url: '',
  65. id: '',
  66. file_id: '',
  67. },
  68. // 音频文件数据
  69. audio_data: {
  70. name: '',
  71. media_duration: 0,
  72. temporary_url: '',
  73. url: '',
  74. file_id: '',
  75. },
  76. file_id_list: [], // 文件 id
  77. mind_map: {
  78. node_list: [
  79. { name: '其他词汇' }
  80. ], // 思维导图数据
  81. },
  82. multilingual: [], // 多语言
  83. };
  84. }