<template>
  <div>
    <el-form :model="property" label-width="72px" label-position="left">
      <SerailNumber :property="property" />
      <el-form-item label="功能">
        <el-select v-model="property.fun_type" placeholder="请选择">
          <el-option v-for="{ value, label } in funList" :key="value" :label="label" :value="value" />
        </el-select>
      </el-form-item>
      <el-form-item label="选择类型" v-if="property.fun_type === 'mark'">
        <el-radio-group v-model="property.answer_mode">
          <el-radio v-for="{ value, label } in markList" :key="value" :label="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="排列">
        <el-radio-group v-model="property.arrange_type">
          <el-radio v-for="{ value, label } in arrangeTypeList" :key="value" :label="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-divider />
      <el-form-item label="读音">
        <el-select v-model="property.audio_generation_method" placeholder="请选择">
          <el-option v-for="{ value, label } in audioGenerationMethodList" :key="value" :label="label" :value="value" />
        </el-select>
      </el-form-item>

      <el-form-item label="读音位置">
        <el-radio-group v-model="property.audio_position">
          <el-radio v-for="{ value, label } in audioPositionList" :key="value" :label="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-divider v-if="property.fun_type !== 'mark'" />
      <el-form-item label="录音作答" v-if="property.fun_type !== 'mark'">
        <el-radio-group v-model="property.is_enable_voice_answer">
          <el-radio v-for="{ value, label } in switchOption" :key="value" :label="value" :value="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import SettingMixin from '@/views/book/courseware/create/components/common/SettingMixin';

import {
  getPinyinBaseProperty,
  arrangeTypeList,
  audioPositionList,
  audioGenerationMethodList,
  switchOption,
  funList,
  markList,
} from '@/views/book/courseware/data/pinyinBase';

export default {
  name: 'PinyinBaseSetting',
  mixins: [SettingMixin],
  data() {
    return {
      property: getPinyinBaseProperty(),
      arrangeTypeList,
      audioPositionList,
      audioGenerationMethodList,
      switchOption,
      funList,
      markList,
    };
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
@use '@/styles/mixin.scss' as *;

.el-form {
  @include setting-base;
}
</style>
