<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.frame_type">
          <el-radio v-for="{ value, label } in frameList" :key="value" :label="value" :value="value">
            {{ label }}
          </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="框颜色">
        <el-color-picker v-model="property.frame_color" />
      </el-form-item>

      <el-divider />
      <el-form-item v-if="property.model === 'miao'" label="描红格">
        <el-input-number v-model="property.miao_number" :min="0" :step="1" />
      </el-form-item>
      <el-form-item label="书写格" v-if="property.model === 'miao'">
        <el-input-number v-model="property.write_number" :min="0" :step="1" />
      </el-form-item>
      <el-divider v-if="property.model === 'miao'" />
      <el-form-item label="错误提示" v-if="property.model === 'miao'">
        <el-radio-group v-model="property.is_enable_error">
          <el-radio v-for="{ value, label } in showList" :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_play_back">
          <el-radio v-for="{ value, label } in showList" :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_stroke">
          <el-radio v-for="{ value, label } in showList" :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_pinyin">
          <el-radio v-for="{ value, label } in showList" :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_shiyi">
          <el-radio v-for="{ value, label } in showList" :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_voice">
          <el-radio v-for="{ value, label } in showList" :key="value" :label="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 {
  getCharacterProperty,
  switchOption,
  funList,
  showList,
  isEnable,
  frameList,
} from '@/views/book/courseware/data/character';

export default {
  name: 'CharacterSetting',
  mixins: [SettingMixin],
  data() {
    return {
      property: getCharacterProperty(),
      switchOption,
      isEnable,
      funList,
      showList,
      frameList,
    };
  },
  methods: {},
};
</script>

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

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