<template>
  <div class="page_configureCenter">
    <div class="configureCenterTitle">
      <i class="iconfont icon-zuojiantou jiantou" @click="toReturn"></i>
      <span class="titleName">配置中心</span>
    </div>
    <div class="configureCenterMain">
      <van-tabs v-model="active" sticky>
        <van-tab title="分区">
          <partition :active="active"></partition>
        </van-tab>
        <van-tab title="分组">
          <grouping :active="active"></grouping>
        </van-tab>
        <van-tab title="床位">
          <bed :active="active"></bed>
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script>
import Partition from "@/pages/configureCenter/components/Partition";
import Grouping from "@/pages/configureCenter/components/Grouping";
import Bed from "@/pages/configureCenter/components/Bed";
import { setRem } from "@/libs/functionRem";
export default {
  components: {
    Partition,
    Grouping,
    Bed,
    value1: 0,
    isCreateOrg: false,
    center: 0
  },
  data() {
    return {
      active: 0
    };
  },
  methods: {
    toReturn() {
      if (this.center == 1) {
        this.$router.push("/homeIndex");
        localStorage.removeItem("center");
        return false;
      }
      var centertwo = this.$route.query.centertwo;
      if (centertwo == 2) {
        this.$router.push("/manageconsole");
      }
    },
    GetHomeData() {
      GetHomeData().then(response => {
        if (response.data.state === 1) {
          this.value1 = this.$store.getters.user.org.id;
        }
      });
    }
  },
  created() {
    setRem();
    // if (this.$route.query.active) {
    // this.active = parseInt(this.$route.query.active);
    // console.log("ac", this.active);
    // }

    this.active = parseInt(localStorage.getItem("test"));
    localStorage.removeItem("test");
    // console.log(this.active);
    var center = parseInt(localStorage.getItem("center"));
    this.center = center;
    // console.log("------", center);
  },
  mounted() {
    setRem();
  }
};
</script>

<style lang="scss" scoped>
.page_configureCenter {
  height: 100%;
  overflow: hidden;
  overflow-y: auto;
  .configureCenterTitle {
    background: #fff;
    padding: 0 1.125rem;
    height: 3.125rem;
    display: flex;
    align-items: center;
  }
  .jiantou {
    font-size: 1.5rem;
    font-weight: 600;
    margin-right: 7rem;
  }
  .titleName {
    font-size: 1.125rem;
    font-weight: 600;
  }
}
</style>
<style lang="scss">
.page_configureCenter {
  .van-tabs__line {
    background: #5b98ff;
  }
  .van-tab--active {
    font-size: 1rem;
    color: #000;
    font-weight: bold;
  }
}
</style>
