<template>
  <div>
    <title-bar :title="title" @clickLeft="onClick">
      <van-icon slot="left" name="cross" size="20" />
    </title-bar>
    <div class="text-content">
      <div class="text-content-left">
        <van-sidebar
          style="width: 100%"
          line-height="100px"
          v-model="activeKey"
        >
          <van-sidebar-item
            v-for="(item, index) in AgencyTask"
            :key="index"
            @click="interest_pricing(index)"
            class="label"
            :title="item.AgencyName"
          />
        </van-sidebar>
      </div>
      <div class="text-content-right">
        <!-- 营销任务 -->
        <upcoming-marketing-task
          v-if="activeKey == 0"
        ></upcoming-marketing-task>
        <!-- 风险预警 -->
        <upcoming-risk-warning v-if="activeKey == 1"></upcoming-risk-warning>
        <!-- 贷后检查 -->
        <upcoming-periodic-inspection
          v-if="activeKey == 2"
        ></upcoming-periodic-inspection>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import TitleBar from "@/components/general/TitleBar.vue";
import { Sidebar, SidebarItem } from "vant";
import UpcomingRiskWarning from "@/components/workbench/upcoming-tasks-content/company-business/upcoming/UpcomingRiskWarning.vue";
import UpcomingMarketingTask from "@/components/workbench/upcoming-tasks-content/company-business/upcoming/UpcomingMarketingTask.vue";
import UpcomingPeriodicInspection from "@/components/workbench/upcoming-tasks-content/company-business/upcoming/UpcomingPeriodicInspection.vue";

Vue.use(Sidebar);
Vue.use(SidebarItem);
/**
 * @Description 催收管理
 * @Author JiangTao
 * @Date 2021-10-25 下午 08:55
 */
@Component({
  name: "AgencyTask",
  components: {
    TitleBar,
    UpcomingMarketingTask,
    UpcomingRiskWarning,
    UpcomingPeriodicInspection,
  },
})
export default class AgencyTask extends Vue {
  activeKey = 0;
  title = "待办任务"; // 页面标题

  AgencyTask = [
    { AgencyName: "营销任务", iconName: "", actionType: "CSGL", path: "/AddContractFaceSign", },
    { AgencyName: "风险预警", iconName: "", actionType: "FXYJ", path: "/risk-warning-list", },
    { AgencyName: "贷后检查", iconName: "", actionType: "DHJC", path: "/risk-warning-list", },
  ];
  onClick() {
    console.log(111111);
  }
  mounted() {}
  interest_pricing_content = true;
  loan_calculation_content = false;
  repayment_trial_content = false;
  calculate_content = false;
  financial_trial_content = false;

  interest_pricing(index: any) {
    this.activeKey = index;
    this.interest_pricing_content = true;
    this.loan_calculation_content = false;
    this.repayment_trial_content = false;
    this.calculate_content = false;
    this.financial_trial_content = false;
  }
  loan_calculation() {
    this.interest_pricing_content = false;
    this.loan_calculation_content = true;
    this.repayment_trial_content = false;
    this.calculate_content = false;
    this.financial_trial_content = false;
  }
  repayment_trial() {
    this.interest_pricing_content = false;
    this.loan_calculation_content = false;
    this.repayment_trial_content = true;
    this.calculate_content = false;
    this.financial_trial_content = false;
  }
  calculate() {
    this.interest_pricing_content = false;
    this.loan_calculation_content = false;
    this.repayment_trial_content = false;
    this.calculate_content = true;
    this.financial_trial_content = false;
  }
  financial_trial() {
    this.interest_pricing_content = false;
    this.loan_calculation_content = false;
    this.repayment_trial_content = false;
    this.calculate_content = false;
    this.financial_trial_content = true;
  }
}
</script>

<style scoped>
.text-content {
  width: 100%;
  height: calc(100vh - 60px);
  display: flex;
  justify-content: flex-start;
}
.text-content-left {
  width: 25%;
  background-color: rgba(245, 245, 245, 1);
  border: 1px solid rgba(222, 222, 222, 1);
}
.text-content-right {
  width: 75%;
}
.label {
  border-bottom: 1px solid #999999;
}
van-sidebar-item {
}
::v-deep .van-sidebar-item--select::before {
  height: 100%;
}
::v-deep .van-sidebar-item__text {
  font-size: 18px;
}
</style>
