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

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 funList = [
  {
    value: 'mark',
    label: '标声调',
  },
  {
    value: 'show',
    label: '拼音展示',
  },
  // {
  //   value: 'input',
  //   label: '输入',
  // },
];

// 标声调类型
export const markList = [
  {
    value: 'select',
    label: '选择声调',
  },
  {
    value: 'label',
    label: '标注声调',
  },
];

export function getPinyinBaseProperty() {
  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,
    is_enable_voice_answer: switchOption[0].value,

    fun_type: 'mark',
    answer_mode: 'select',
  };
}

export function getPinyinBaseData() {
  return {
    type: 'pinyin_base',
    title: '拼音',
    property: getPinyinBaseProperty(),
    character:'',
    content: '',
    content_view: [],
    content_hz: '',
    audio_file_id: '',
    mark: getRandomNumber(),
    record_list: [],
    answer: {
      answer_list: [],
    },
  };
}
