<template>
  <section class="AppHelpedResident">
    <component :is="currentComponent" :instance="instance" :dict="dict" :permissions="permissions"/>
  </section>
</template>

<script>

import HrAdd from "./hrAdd";
import HrDetail from "./hrDetail";
import HrList from "./hrList";

export default {
  name: "AppHelpedResident",
  components: {HrList, HrDetail, HrAdd},
  label: "监测对象(防返贫帮扶对象)",
  props: {
    instance: Function,
    dict: Object,
    permissions: Function
  },
  computed: {
    currentComponent() {
      return this.$route.hash == "#add" ? HrAdd :
          this.$route.query.id ? HrDetail : HrList
    }
  },
  created() {
    this.dict.load("sex", "fpNation", "fpPrtpStatus", "fpHealth", "fpStudentsInSchool", 'fpYesOrNo', "fpRelationship",
        "yesOrNo", "fpLaborSkills", "fpEducation", "fpType", "fpPoliticalOutlook",
        "fpPublicWelfarePostAssistance","fpHealthAssistance","fpFnancialAssistance","fpEmploymentAssistance","fpEducationalAssistance","fpIndustrialAssistance","fpSocialAssistance")
  }
}
</script>

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