<template>
  <div class="fx-column">
    <evaluation-title title="选科测评" nav-back-button></evaluation-title>
    <mx-paper :options="options" class="pl20 pr20 pt20 pb40"></mx-paper>
  </div>
</template>

<script>
import MxPaper from '@/components/MxPaper/mx-paper'
import transferMixin from '@/components/mx-transfer-mixin'
import paperMixin from '@/components/MxPaper/mx-paper-mixin'
import EventBus from '@/components/EventBus'

export default {
  mixins: [transferMixin, paperMixin],
  name: 'electivePaper',
  components: { MxPaper },
  data() {
    return {
      overrideOpts: {
        customScoredAction: true,
        customCommittedAction: true,
        navigatorSpan: 12
      }
    }
  },
  mounted() {
    EventBus.instance.$on('customScoredAction', () => this.innerLoadPaper())
    EventBus.instance.$on('customCommittedAction', () => this.innerLoadPaper())
    this.loadPaper(this.prevData, this.overrideOpts)
  },
  beforeDestroy() {
    EventBus.instance.$off('customScoredAction')
    EventBus.instance.$off('customCommittedAction')
  },
  methods: {
    innerLoadPaper() {
      const path = '/elective/test/elective-report'
      const next = {
        ...this.prevData,
        examineeId: this.paper.examineeId
      }
      this.transferTo(path, next, null, true)
    }
  }
}
</script>

<style scoped>

</style>
