<template>
  <div>
    <el-form :model="property" label-width="72px" label-position="left">
      <SerailNumber :property="property" />
      <el-form-item label="音频位置">
        <el-radio-group v-model="property.mp3_position">
          <el-radio v-for="{ value, label } in positionList" :key="value" :label="value" :value="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>

      <el-divider />
      <el-form-item label="生词短语">
        <el-radio-group v-model="property.is_enable_new_word">
          <el-radio v-for="{ value, label } in switchOption" :key="value" :label="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="朗读模式">
        <el-radio-group v-model="property.is_enable_read">
          <el-radio v-for="{ value, label } in switchOption" :key="value" :label="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="取词模式">
        <el-radio-group v-model="property.is_enable_word">
          <el-radio v-for="{ value, label } in switchOption" :key="value" :label="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-divider />
      <el-form-item label="拼音">
        <el-switch v-model="property.is_enable_pinyin" active-text="" inactive-text=""> </el-switch>
      </el-form-item>
      <el-form-item label="拼音位置" v-if="property.is_enable_pinyin">
        <el-radio-group v-model="property.pinyin_position">
          <el-radio v-for="{ value, label } in positionList" :key="value" :label="value" :value="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="" v-if="property.is_enable_pinyin">
        <el-checkbox v-model="property.is_enable_sentence_case">句首大写</el-checkbox>
      </el-form-item>
    </el-form>
  </div>
</template>

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

import { getArticleProperty, switchOption, positionList, isEnable } from '@/views/book/courseware/data/article';

export default {
  name: 'ArticleSetting',
  mixins: [SettingMixin],
  data() {
    return {
      property: getArticleProperty(),
      switchOption,
      isEnable,
      positionList,
    };
  },
  methods: {},
};
</script>

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

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