<script>
import add from "./add.vue";
import list from "./list.vue";

export default {
  name: "AppBreedArchive",
  label: "电子档案",
  props: {
    instance: Function,
    dict: Object,
    permissions: Function
  },
  computed: {
    currentPage() {
      let {hash} = this.$route
      return hash == "#add" ? add : list
    }
  },
  created() {
    this.dict.load("archiveStatus", "category", "variety", "insuranceType", "deathReason", "dataSources", "yesOrNo")
  }
}
</script>

<template>
  <section class="AppBreedArchive">
    <component :is="currentPage" v-bind="$props"/>
  </section>
</template>

<style scoped lang="scss">
.AppBreedArchive {
  height: 100%;
}
</style>
