fill.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import {
  2. displayList,
  3. serialNumberTypeList,
  4. serialNumberPositionList,
  5. arrangeTypeList,
  6. switchOption,
  7. pinyinPositionList,
  8. } from '@/views/book/courseware/data/common';
  9. export { arrangeTypeList, switchOption };
  10. // 音频位置
  11. export const audioPositionList = [
  12. { value: 'front', label: '前' },
  13. { value: 'back', label: '后' },
  14. ];
  15. // 读音生成方式
  16. export const audioGenerationMethodList = [
  17. {
  18. value: 'upload',
  19. label: '上传',
  20. },
  21. {
  22. value: 'auto',
  23. label: '自动生成',
  24. },
  25. {
  26. value: 'record',
  27. label: '录音',
  28. },
  29. ];
  30. // 填空方式
  31. export const fillTypeList = [
  32. { value: 'input', label: '输入' },
  33. { value: 'select', label: '选词' },
  34. { value: 'handwriting', label: '手写' },
  35. { value: 'voice', label: '语音' },
  36. ];
  37. // 填空字体
  38. export const fillFontList = [
  39. { value: 'chinese', label: '中文', font: 'arial' },
  40. { value: 'english', label: '英文', font: 'arial' },
  41. { value: 'pinyin', label: '拼音', font: 'PINYIN-B' },
  42. ];
  43. export function getFillProperty() {
  44. return {
  45. serial_number: 1,
  46. sn_type: serialNumberTypeList[0].value,
  47. fill_type: fillTypeList[0].value,
  48. sn_position: serialNumberPositionList[3].value,
  49. sn_display_mode: displayList[1].value,
  50. arrange_type: arrangeTypeList[1].value,
  51. audio_position: audioPositionList[0].value,
  52. audio_generation_method: audioGenerationMethodList[0].value,
  53. fill_font: fillFontList[0].value,
  54. is_enable_voice_answer: switchOption[1].value,
  55. view_pinyin: 'false', // 显示拼音
  56. pinyin_position: pinyinPositionList[0].value,
  57. is_first_sentence_first_hz_pinyin_first_char_upper_case: displayList[0].value, // 句首大写
  58. voice_type: '', // 音色
  59. emotion: '', // 风格,情感
  60. };
  61. }
  62. export function getFillData() {
  63. return {
  64. type: 'fill',
  65. title: '填空',
  66. property: getFillProperty(),
  67. content: '',
  68. audio_file_id: '',
  69. record_list: [],
  70. model_essay: [],
  71. vocabulary: '', // 用于选词的词汇
  72. word_list: [], // 选词列表
  73. answer: {
  74. answer_list: [],
  75. reference_answer: '',
  76. },
  77. mind_map: {
  78. node_list: [{ name: '横排中文填空组件' }],
  79. },
  80. multilingual: [], // 多语言
  81. };
  82. }