<template>
  <div class="d-page d-flex flex-column">
    <title-bar title="综合收益率" @clickLeft="onClick">
      <van-icon slot="left" name="cross" size="24" />
    </title-bar>
    <div class="information-container h-scroller flex-1-dhc">
      <van-index-bar highlight-color="#F79400" :index-list="indexList">
        <van-index-anchor index="公司综合收益率">
          <sub-title>公司综合收益率</sub-title>
        </van-index-anchor>
        <company-rate-of-return></company-rate-of-return>
        <van-index-anchor v-if="!isBranch" index="集团综合收益率">
          <sub-title>集团综合收益率</sub-title>
        </van-index-anchor>
        <group-rate-of-return v-if="!isBranch"></group-rate-of-return>
        <van-index-anchor index="综合收益率试算记录">
          <sub-title>综合收益率试算记录</sub-title>
        </van-index-anchor>
        <customer-contribution-situation-table></customer-contribution-situation-table>
      </van-index-bar>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import TitleBar from "@/components/general/TitleBar.vue";
import CustomerContributionSituationTable from "@/components/customer-information/business-application-status/customer-contribution/CustomerContributionSituationTable.vue";
import CompanyRateOfReturn from "@/components/customer-information/business-application-status/customer-contribution/CompanyRateOfReturn.vue";
import GroupRateOfReturn from "@/components/customer-information/business-application-status/customer-contribution/GroupRateOfReturn.vue";
import Public from "@/public/ts/Public";
/**
 * @Description 客户及其群体在我行贡献情况
 * @Author JiangTao
 * @Date 2021-11-10 下午 03:16
 */
@Component({
  name: "CustomerContribution",
  components: { TitleBar, CustomerContributionSituationTable, CompanyRateOfReturn, GroupRateOfReturn },
})
export default class CustomerContribution extends Vue {
  pageTitle = ""; // 页面标题

  isBranch = true; //是否为分支行
  indexList = ["公司综合收益率", "综合收益率试算记录"];

  created() {
    this.isBranch = Public.getIfBranch();
    if(!this.isBranch) {
      this.indexList = ["公司综合收益率", "集团综合收益率", "综合收益率试算记录"];
    }
  }

  mounted() {
    this.pageTitle = this.$route.meta?.name;
  }

  /**
   * @description:  返回
   * @author LiShenghui
   * @date 2022/2/21 11:02
   */
  onClick() {
    this.$router.go(-1);
  }
}
</script>

<style scoped></style>
