<template>
  <div>
    <el-form :model="property" :label-position="labelPosition" label-width="72px">
      <el-form-item label="序号" class="serial-number">
        <el-input v-model="property.serial_number" />
        <SvgIcon icon-class="switch" size="16" @click="switchSerialNumber(property)" />
      </el-form-item>
      <el-form-item>
        <el-radio
          v-for="{ value, label } in snGenerationMethodList"
          :key="value"
          v-model="property.sn_generation_method"
          :label="value"
        >
          {{ label }}
        </el-radio>
      </el-form-item>
      <el-form-item label="序号位置">
        <SerialNumberPosition :position="property.sn_position" @changeNumberPosition="changeNumberPosition" />
      </el-form-item>
      <el-divider />
      <el-form-item label="查看方式">
        <el-radio
          v-for="{ value, label } in audioViewMethodList"
          :key="value"
          v-model="property.view_method"
          :label="value"
        >
          {{ label }}
        </el-radio>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import SettingMixin from '@/views/book/courseware/create/components/common/SettingMixin';
import { snGenerationMethodList, checkString } from '@/views/book/courseware/data/common';
import { audioViewMethodList, getAudioProperty } from '@/views/book/courseware/data/audio';

export default {
  name: 'AudioSetting',
  mixins: [SettingMixin],
  data() {
    return {
      checkString,
      audioViewMethodList,
      snGenerationMethodList,
      labelPosition: 'left',
      property: getAudioProperty(),
    };
  },
  methods: {},
};
</script>

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

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