<template>
  <div class="home">
    <nav-bar/>
    <van-cell>
      <ul>
        <li v-for="(item,i) in list" :key="i">
          <van-cell
              :title="item.name"
              is-link
              @click="handleGuke(item)"
          />
        </li>
      </ul>
    </van-cell>


  </div>
</template>

<script>
import {
  getAllMZData,
} from "@/request/api.js";

export default {
  data() {
    return {
      // title: "",
      list: [],
      yuyue: {
        t: "",//时间
        k: "",//科室编号
        e: "",//科室名称
        z: 1,//类型-1今日/2预约
      },

    };
  },
  mounted() {
    this.getAllMZ();
  },
  methods: {

    getAllMZ() {
      getAllMZData().then(res => {
        this.list = res.data

      })
    },
    handleGuke(val) {
      this.yuyue.DeptCode = val.departcode;
      this.yuyue.DeptName = val.name;
      console.log(this.yuyue.DeptCode);
      sessionStorage.setItem("yuyue", JSON.stringify(this.yuyue));
      this.$router.push({path: "/Guke"});
    }
  }
};
</script>


<style scoped lang="scss">
.ksbox {
  position: absolute;
  top: 1.5rem;
  z-index: 1;
}

.van-tabs {
  display: flex;
  color: #fff;

}

::v-deep .van-tabs--line .van-tabs__wrap {
  height: calc(100% - 1rem);
  overflow-y: auto;
  width: 4rem;
  color: #fff;
}

::v-deep .van-tabs__nav--line {
  display: block;
  background: #fff;
}

::v-deep .van-tab {
  height: 1rem;
  flex: inherit;
}

::v-deep .van-tab--active {
  background: #e6e6e6;
  position: relative;
}

::v-deep .van-tab--active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(0, -50%);
  width: 0.1rem;
  height: 1rem;
  background: #46c3b0;
}

</style>
