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

<script>
import Home from "./home";
import PersonDetail from "./personDetail";
import CompanyDetail from "./companyDetail";

export default {
  name: "AppCreditReport",
  components: {CompanyDetail, PersonDetail, Home},
  label: "信息报告",
  props: {
    instance: Function,
    dict: Object,
    permissions: Function
  },
  computed: {
    currentPage() {
      const {hash} = this.$route
      return hash == "#person" ? PersonDetail :
          hash == "#company" ? CompanyDetail : Home
    }
  },
  created() {
  }
}
</script>

<style lang="scss" scoped>
::v-deep.AppCreditReport {
  height: 100%;

  .mar-t16 {
    margin-top: 16px;
  }

  .mar-l8 {
    margin-left: 8px;
  }

  .color-26f {
    color: #26f;
  }

  .color-333 {
    color: #333;
  }

  .color-666 {
    color: #666;
  }
}
</style>
