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

export { arrangeTypeList, switchOption, isEnable };

// 音频位置
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: 'show',
    label: '汉字展示',
  },
  {
    value: 'write',
    label: '汉字书写',
  },
];

// 显示
export const showList = [
  {
    value: 'true',
    label: '显示',
  },
  {
    value: 'false',
    label: '不显示',
  },
];

// 汉字框
export const frameList = [
  {
    value: 'tian',
    label: '田字格',
  },
  {
    value: 'fang',
    label: '方框',
  },
  {
    value: 'none',
    label: '无',
  },
];

export function getCharacterBaseProperty() {
  return {
    serial_number: 1,
    sn_type: serialNumberTypeList[0].value,
    sn_position: serialNumberPositionList[0].value,
    sn_display_mode: displayList[0].value,
    audio_generation_method: audioGenerationMethodList[0].value,
    is_enable_voice_answer: switchOption[0].value,

    is_enable_pinyin: showList[0].value,
    fun_type: 'show',
    is_enable_voice: showList[0].value,
    frame_type: 'tian',
    frame_color: '#F13232',
    is_enable_error: showList[0].value,
    is_enable_play_back: showList[0].value,
    is_enable_miao: showList[0].value,
  };
}

export function getCharacterBaseData() {
  return {
    type: 'character_base',
    title: '基础汉字',
    property: getCharacterBaseProperty(),
    content: '',
    pinyin: '',
    definition: '',
    audio_file_id: '',
    hz_strokes_list: [],
    mark: getRandomNumber(),
    record_list: [],
    answer: {
      answer_list: [],
    },
  };
}
