fill.js 1.8 KB

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