newWord.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. };
  51. }
  52. export function getNewWordProperty() {
  53. return {
  54. serial_number: 1,
  55. sn_type: serialNumberTypeList[0].value,
  56. sn_position: serialNumberPositionList[0].value,
  57. sn_display_mode: displayList[0].value,
  58. audio_generation_method: audioGenerationMethodList[0].value,
  59. pinyin_position: pinyinPositionList[0].value,
  60. is_word_show: wordShowList[1].value,
  61. is_has_infor: inforList[0].value,
  62. };
  63. }
  64. export function getNewWordData() {
  65. return {
  66. type: 'new_word',
  67. title: '生词组件',
  68. property: getNewWordProperty(),
  69. title_con: '',
  70. option: [getOption()],
  71. lrc_arr: [], // lrc 文件解析后的数据
  72. // lrc 文件数据
  73. lrc_data: {
  74. name: '',
  75. url: '',
  76. id: '',
  77. file_id: '',
  78. },
  79. // 音频文件数据
  80. audio_data: {
  81. name: '',
  82. media_duration: 0,
  83. temporary_url: '',
  84. url: '',
  85. file_id: '',
  86. },
  87. answer: {
  88. answer_list: [],
  89. },
  90. };
  91. }