<template>
<!--  个人业务查询-->
  <div>
    <title-bar :title="title">
      <van-icon slot="left" name="cross" size="24" />
    </title-bar>
    <div class="text-content">
      <div class="text-content-left">
        <van-sidebar @change="onChange" style="width: 100%" line-height="100px" v-model="active">
          <van-sidebar-item v-for="(item, index) in CommonFunctionsList" :key="index" class="label" :title="item.AgencyName" />
        </van-sidebar>
      </div>
      <div class="text-content-right">
        <!-- 电话查询历史查询 -->
        <MarketingQuery v-if="active == 0"></MarketingQuery>
        <!-- 个贷催收列表 -->
        <CollectionManagement v-if="active == 1"></CollectionManagement>
      </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 MarketingQuery from "@/components/workbench/personal-common-functions/agency-task/telemarketing/MarketingQuery.vue";
import SMEMarketingPool from "@/components/workbench/SME-common-functions/SMEMarketingPool.vue";
import CollectionManagement from "@/components/workbench/personal-common-functions/agency-task/CollectionManagement.vue";

Vue.use(Sidebar);
Vue.use(SidebarItem);
/**
 * @Description  个人业务查询
 * @Author JiangTao
 * @Date 2021-10-25 下午 08:55
 */
@Component({
  name: "GDBusinessQuery",
  components: { TitleBar, MarketingQuery,CollectionManagement, SMEMarketingPool },
})
export default class CommonFunctions extends Vue {
  active: any=0;
  activeKey: any = 0;
  title = "个人业务查询"; // 页面标题

  CommonFunctionsList = [
    {AgencyName: "电话营销列表历史查询", iconName: "", actionType: "CSGL", path: "/CollectionManagement"},
    {AgencyName: "个贷催收列表", iconName: "", actionType: "DHJC", path: "/AfterLoan"},
  ];
  onClick() {
    console.log(111111);
  }
  mounted() {
    // this.activeKey = sessionStorage.getItem("CYactiveKey") || 0;
    this.active = sessionStorage.getItem('GDCXactiveKey') ? Number(sessionStorage.getItem('GDCXactiveKey')) : 0;
    console.log('abcde', this.active);
  }
  onChange() {
    sessionStorage.setItem("GDCXactiveKey", this.active);
  }
}
</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 #e0e1e2;
}
van-sidebar-item {
}
::v-deep .van-sidebar-item--select::before {
  background-color: #FF574C;
  height: 100%;
}
::v-deep .van-sidebar-item__text {
  font-size: 18px;
}
::v-deep .text-content-left {
  z-index: 2100;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
::v-deep .van-sidebar-item__text:before {
  content: "😊";
  /*content: url("../../../../assets/images/logo.png");*/
  width: 30px;
  height: 30px;
  border-radius: 5px;
}
::v-deep .van-sidebar-item--select > div:before {
  background-color: #00a3ff;
}
</style>
