<template>
  <div class="newDialysisTab">
      <van-tabs v-model="index" @change="ClickTab">
        <van-tab title="医嘱">
          <advice-table v-if="index == 0"></advice-table>
        </van-tab>
        <van-tab title="长期处方">
          <long-table></long-table>
        </van-tab>
         <van-tab title="透析记录">
          <record-table></record-table>
        </van-tab>
        <van-tab title="干体重">
          <dry-weight></dry-weight>
        </van-tab>
        <van-tab title="长期医嘱">
          <Standingorder></Standingorder>
        </van-tab>
        <van-tab title="血管通路">
          <pass-assessment></pass-assessment>
        </van-tab>

        <!-- <van-tab title="检验检查">
          <inspection style="padding-top: 2.75rem;"></inspection>
        </van-tab>
        <van-tab title="传染病检查">
          <contagion style="padding-top: 2.75rem;"></contagion>
        </van-tab> -->
        <van-tab title="病程记录">
          <course-management></course-management>
        </van-tab>
        <van-tab title="抢救记录">
          <rescue-record></rescue-record>
        </van-tab>
        <van-tab title="阶段小结">
          <treat-summary></treat-summary>
        </van-tab>
         <van-tab title="排班信息">
          <schedul-table></schedul-table>
        </van-tab>
         <van-tab title="宣教信息">
          <mission-table></mission-table>
        </van-tab>
      </van-tabs>
  </div>
</template>

<script>
import LongTable from './LongTable'
import SchedulTable from './SchedulTable'
import RecordTable from './RecordTable'
import AdviceTable from './AdviceTable'
import MissionTable from './MissionTable'
import DryWeight from './DryWeight'
import CourseManagement from './CourseManagement'
import RescueRecord from './RescueRecord'
import PassAssessment from "./PassAssesment"
import inspection from '../../doctorAdvice/components/Inspection'
import Contagion from './Contagion'
import TreatSummary from './TreatSummary'
import Standingorder from './Standingorder'
export default {
  name: 'DialysisTab',
  data () {
    return {
      index: 0
    }
  },
  props:{
    tableIndex2:Number
  },
  components: {
    LongTable,
    SchedulTable,
    RecordTable,
    AdviceTable,
    MissionTable,
    DryWeight,
    CourseManagement,
    RescueRecord,
    PassAssessment,
    inspection,
    Contagion,
    TreatSummary,
    Standingorder
  },
  created(){
    this.index = this.tableIndex2
  },
  methods: {
    ClickTab: function (tabIndex) {
      console.log('tabIndex',tabIndex);
      this.index = tabIndex
      this.$emit('tabIndex',tabIndex)
    }
  },
  mounted () {
    if (this.$route.query.active2) {
      this.index = parseInt(this.$route.query.active2)
      console.log('121212121',this.index);

    }
  }
}
</script>

<style style="stylesheet/scss" lang="scss" scoped>
.fixedBox {
  padding-top: 38px;
  // background: #fff;
  min-height: calc(100vh - 64px);
  @media only screen and (min-width: 415px) and (max-width: 767px) {
    padding-top: 58px;
  }
  @media only screen and (min-width: 768px) {
    padding-top: 82px;
  }
  // @media only screen and (min-width: 813px) and (max-width: 1024px) {
  //   padding-top: 74px;
  // }
  .nav {
    border-bottom: 1px #e5e5e5 solid;
    position: fixed;
    top: 40px;
    @media only screen and (min-width: 768px) {
      top: 63px;
    }
    @media only screen and (min-width: 415px) and (max-width: 767px) {
      top: 52px;
    }
    // @media only screen and (min-width: 813px) and (max-width: 1024px) {
    //   top: 64px;
    // }
    // @media only screen and (min-width: 376px) and (max-width: 668px) {
    //   top: 50px;
    // }
    right: 0;
    z-index: 66;
    left: 0;
    background: #fff;
    ul {
      width: 80%;
      margin: 0 auto;
      @include box-sizing;
      @include display-flex;
      @include align-items-center;
      @include text-align;
      @include justify-content-between;
      li {
        font-size: 0.45rem;
        // float: left;
        color: $pgh-color;
        padding: 0.3rem 0;
        cursor: pointer;
      }
      .active {
        position: relative;
        &::before {
          width: 100%;
          height: 2px;
          color: $main-color;
          position: absolute;
          bottom: 0;
          left: 0;
          content: "";
          background: $main-color;
        }
      }
    }
  }
}
</style>
<style lang="scss">
.newDialysisTab{
  height: 100%;
  overflow-y: auto;
  .van-tabs{
    display: flex;
    height: 100%;
  }
  .van-tabs__content{
    overflow-y: auto;
    flex: 1;
  }
  .van-tabs--line .van-tabs__wrap{
    height: 2.75rem;
    position: fixed;
    top: 3.125rem;
    right: 0;
    left: 0;
    z-index: 99;
  }
  .van-tab__pane{
    height: 100%;
  }
  // .van-tabs__wrap--scrollable .van-tab{
  //   flex-basis: 28% !important;
  // }
  // .van-tabs__line {
  //   width: 47px;
  //   -webkit-transform: translateX(47px) translateX(-50%);
  //   transform: translateX(47px) translateX(-50%);
  //   -webkit-transition-duration: 0.3s;
  //   transition-duration: 0.3s;
  // }
}
</style>
