newWord.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. import {
  2. displayList,
  3. serialNumberTypeList,
  4. serialNumberPositionList,
  5. arrangeTypeList,
  6. switchOption,
  7. isEnable,
  8. commonComponentProperty,
  9. } from '@/views/book/courseware/data/common';
  10. export { arrangeTypeList, switchOption, isEnable };
  11. export const wordShowList = [
  12. { value: 'true', label: '是' },
  13. { value: 'false', label: '否' },
  14. ];
  15. export const inforList = [
  16. { value: 'true', label: '有' },
  17. { value: 'false', label: '没有' },
  18. ];
  19. // 拼音位置
  20. export const pinyinPositionList = [
  21. { value: 'front', label: '前面' },
  22. { value: 'back', label: '后面' },
  23. { value: 'top', label: '上面' },
  24. { value: 'bottom', label: '下面' },
  25. ];
  26. // 读音生成方式
  27. export const audioGenerationMethodList = [
  28. {
  29. value: 'upload',
  30. label: '上传',
  31. },
  32. {
  33. value: 'auto',
  34. label: '自动生成',
  35. },
  36. {
  37. value: 'record',
  38. label: '录音',
  39. },
  40. ];
  41. export function getOption() {
  42. return {
  43. number: '',
  44. new_word: '',
  45. cixing: '', // 词性
  46. definition_list: '', // 释义
  47. pinyin: '',
  48. mp3_list: '',
  49. collocation: '', // 搭配
  50. liju_list: '', // 例句
  51. file_list: [''], // 图片
  52. header_con: '', // 页眉
  53. label: '', // 标签
  54. hz_info: [],
  55. bg: 0,
  56. ed: 0,
  57. };
  58. }
  59. export function getNewWordProperty() {
  60. return {
  61. serial_number: 1,
  62. sn_type: serialNumberTypeList[0].value,
  63. sn_position: serialNumberPositionList[3].value,
  64. sn_display_mode: displayList[1].value,
  65. audio_generation_method: audioGenerationMethodList[0].value,
  66. pinyin_position: pinyinPositionList[0].value,
  67. auto_wrap: switchOption[0].value, // 自动换行
  68. is_has_infor: inforList[0].value,
  69. voice_type: '', // 音色
  70. emotion: '', // 风格,情感
  71. speed_ratio: '', // 语速
  72. ...commonComponentProperty,
  73. };
  74. }
  75. export function getNewWordData() {
  76. return {
  77. type: 'new_word',
  78. title: '生词组件',
  79. source_courseware_id_list: [],
  80. source_courseware_id: '', // 生词关联课件id,即跨页高亮生词
  81. property: getNewWordProperty(),
  82. title_con: '',
  83. new_word_list: [getOption()],
  84. lrc_arr: [], // lrc 文件解析后的数据
  85. // lrc 文件数据
  86. lrc_data: {
  87. name: '',
  88. url: '',
  89. id: '',
  90. file_id: '',
  91. },
  92. // 音频文件数据
  93. audio_data: {
  94. name: '',
  95. media_duration: 0,
  96. temporary_url: '',
  97. url: '',
  98. file_id: '',
  99. },
  100. wordTime: [], // 字幕时间节点
  101. taskId: '',
  102. file_id_list: [], // 文件 id
  103. col_width: [
  104. {
  105. value: 100, // 生词
  106. },
  107. {
  108. value: 110, // 拼音
  109. },
  110. {
  111. value: 50, // 词性
  112. },
  113. {
  114. value: 180, // 释义
  115. },
  116. {
  117. value: 180, // 搭配
  118. },
  119. {
  120. value: 200, // 例句
  121. },
  122. ], // 列宽
  123. mind_map: {
  124. node_list: [{ name: '生词组件' }], // 思维导图数据
  125. },
  126. answer: {
  127. answer_list: [],
  128. },
  129. multilingual: [], // 多语言
  130. };
  131. }