<template>
  <div style="height:100%;background-color:#FAFAFA;">
    <!-- <div style="width:100%;height:45px;background-color:rgb(55, 150, 223);font-size:13px;">
      <div style="height:1px;"></div>
      <p style="margin:13px 0px 0px 10px;color:#fff;"><Icon type="ios-arrow-back" />返回</p>
    </div> -->
    <div>
      <div :style="model1==1?'background-color:#fff;color:blue;':''" class="headone">
        <router-link to="main">
          <p @click="model1 = 1" :style="model1==1?'color:blue;':'color:black;'" class="headtwo">待办事宜</p>
        </router-link>
        <hr :style="model1 == 1?'border:0.5px solid blue;':'display:none;'" align="center">
      </div>
      <div :style="model1==2?'background-color:#fff;color:blue;':''" class="headone">
        <router-link to="zaiban" >
          <p @click="model1 = 2" :style="model1==2?'color:blue;':'color:black;'" class="headtwo">在办事宜</p>
          <hr :style="model1 == 2?'border:0.5px solid blue;':'display:none;'" align="center">
        </router-link>
      </div>
      <div :style="model1==3?'background-color:#fff;color:blue;':''" class="headone">
        <router-link to="yiban" >
          <p @click="model1 = 3" :style="model1==3?'color:blue;':'color:black;'" class="headtwo">已办事宜</p>
          <hr :style="model1 == 3?'border:0.5px solid blue;':'display:none;'" align="center">
        </router-link>
      </div>
    </div>
    <div style="background-color:fff;">
      <router-view>

      </router-view>
    </div>
    <Affix :offset-bottom="20">
        <Button v-if="system!=null" @click="openSystem" long class="demo-affix">设置</Button>
    </Affix>
  </div>
</template>

<script>
export default {
  data() {
    return {
      model1:1,
      user:JSON.parse(sessionStorage.getItem('usercode')),
      system:JSON.parse(sessionStorage.getItem('system')),
      data:null,
    }
  },
  created() {
    if(this.user==null){
      this.$router.push('/');
    }
    if(this.$route.path=='/zaiban'){
      this.model1 = 2;
    }
    if(this.$route.path=='/daiban'){
      this.model1 = 1;
    }
    if(this.$route.path=='/yiban'){
      this.model1 = 3;
    }
  },
  methods: {
    openSystem(){
      this.$router.push('/system');
    }
  },
}
</script>

<style>
.headone{
  width:33.33%;display: inline-block;text-align:center;height:40px;
}
.headtwo:hover{
  cursor: pointer;
}
.headtwo{
  margin:10px 0px 10px 0px;font-weight:bold;
}

.sub_com{
  width:100%;
  position: fixed; 
  margin-top: -100px;
}
</style>
