fill.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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[0].value,
  50. arrange_type: arrangeTypeList[0].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[0].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. };
  59. }
  60. export function getFillData() {
  61. return {
  62. type: 'fill',
  63. title: '填空',
  64. property: getFillProperty(),
  65. content: '',
  66. audio_file_id: '',
  67. record_list: [],
  68. model_essay: [],
  69. vocabulary: '', // 用于选词的词汇
  70. word_list: [], // 选词列表
  71. answer: {
  72. answer_list: [],
  73. reference_answer: '',
  74. },
  75. mind_map: {
  76. node_list: [{ name: '横排中文填空组件' }],
  77. },
  78. multilingual: [], // 多语言
  79. };
  80. }