<template>
  <div>
    <div v-if="generation.activeOpt.decisionMaking">
      <span>您在{{ appliedModel.option.title }}阶段</span>
      <span v-if="!appliedModel.selectedList.length">未填报志愿</span>
      <span v-else-if="appliedModel.selectedList.some(isGroupRejected)">拒绝了系统推荐组合</span>
      <span v-else-if="appliedModel.selectedList.length">填报了 {{ allSelectedGroupNames }}</span>
      <elective-preference-drag :selected-list="appliedModel.selectedList" disabled></elective-preference-drag>
    </div>
  </div>
</template>

<script>
import ElectiveToolsMixin from './elective-tools-mixins'
import ElectivePreferenceDrag from '@/views/system/user/profile/components/elective-preference-drag'

export default {
  components: { ElectivePreferenceDrag },
  mixins: [ElectiveToolsMixin],
  name: 'elective-preference-info',
  props: ['generation'],
  computed: {
    appliedModel() {
      return this.generation.activeModel.prevModel
    },
    allSelectedGroupNames() {
      return this.appliedModel.selectedList.map(g => g.groupName).join(' ')
    }
  }
}
</script>

<style scoped>

</style>
