<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="14" @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 arrangeTypeList"
          :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 } from '@/views/book/courseware/data/common';
import { arrangeTypeList } from '@/views/book/courseware/data/select';

export default {
  name: 'SelectSetting',
  mixins: [SettingMixin],
  data() {
    return {
      property: {
        serial_number: 1,
        sn_type: 'number',
        sn_position: 'top-start',
        sn_generation_method: snGenerationMethodList[0].value,
        arrange_method: arrangeTypeList[0].value,
      },
    };
  },
  methods: {},
};
</script>

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

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