import {
  displayList,
  serialNumberTypeList,
  serialNumberPositionList,
  arrangeTypeList,
  switchOption,
} from '@/views/book/courseware/data/common';

export { arrangeTypeList, switchOption };

// 音频位置
export const audioPositionList = [
  { value: 'front', label: '前' },
  { value: 'back', label: '后' },
];

// 读音生成方式
export const audioGenerationMethodList = [
  {
    value: 'upload',
    label: '上传',
  },
  {
    value: 'auto',
    label: '自动生成',
  },
  {
    value: 'record',
    label: '录音',
  },
];

// 填空字体
export const fillFontList = [
  { value: 'chinese', label: '中文', font: 'arial' },
  { value: 'english', label: '英文', font: 'arial' },
  { value: 'pinyin', label: '拼音', font: 'PINYIN-B' },
];

export function getFillProperty() {
  return {
    serial_number: 1,
    sn_type: serialNumberTypeList[0].value,
    sn_position: serialNumberPositionList[0].value,
    sn_display_mode: displayList[0].value,
    arrange_type: arrangeTypeList[0].value,
    audio_position: audioPositionList[0].value,
    audio_generation_method: audioGenerationMethodList[0].value,
    fill_font: fillFontList[0].value,
    is_enable_voice_answer: switchOption[0].value,
  };
}

export function getFillData() {
  return {
    type: 'fill',
    title: '填空',
    property: getFillProperty(),
    content: '',
    audio_file_id: '',
    model_essay: [],
    answer: {
      answer_list: [],
    },
  };
}
