<template>
    <div class="sideColumn">
      <div class="column">
        <div class="head"><img :src="$store.getters.user.org.org_logo" alt=""></div>
        <ul class="sidebar">
            <li style="position: relative;" :class="active_index == 0 ? 'active' : ''">
                <router-link to="/main"> <span class="iconfont">&#xe6e6;</span><p>记录</p></router-link>
              <span class="redpoint" v-if="total_read_dot">{{total_read_dot > 99?total_read_dot+'+':total_read_dot}}</span>
            </li>
             <li :class="active_index == 1 ? 'active' : ''">
                <router-link to="/monitoring"><span class="iconfont">&#xe6f5;</span><p>监控</p></router-link>
            </li>
             <li :class="active_index == 2 ? 'active' : ''">
                <router-link to="/advice"><span class="iconfont">&#xe6f4;</span><p>医嘱</p></router-link>
            </li>
             <li :class="active_index == 3 ? 'active' : ''">
                <router-link to="/my"><span class="iconfont">&#xe715;</span><p>我的</p></router-link>
            </li>
        </ul>
       </div>
    </div>
</template>

<script>
export default {
  name: "SideBar",
  props: {
    active_index: {
      type: Number,
      default: 0
    },
    total_read_dot:{
      type: Number,
      default: 0
    }
  }
};
</script>

<style style="stylesheet/scss" lang="scss" scoped>
  .redpoint{
  display:inline-block;
  height:20px;
  width:20px;
  line-height:20px;
  text-align:center;
  font-size:0.2em;
  border-radius:20px;
  color:#fff;
  background:red;
  position: absolute;
  top: -5px;
  right: -15px;
  }
.sideColumn {
  float: left;
  width: 1.58rem;
  background: #f5f8fb;
  height: 100%;
  border-right: 1px  solid rgba(193, 193, 193, 0.8);
  position: fixed;
  z-index: 999;
  .column {
    .head {
      @include display-flex;
      @include align-items-center;
      @include text-align;
      @include justify-content-center;
      margin: 0.5rem auto 0.7rem auto;
      width: 1rem;
        height: 1rem;
        overflow: hidden;
        border-radius: 50%;
      img {
        width: 100%;
        height: auto;
        display: block;
      }
    }
    .sidebar {
      @include display-flex;
      @include align-items-center;
      @include flex-direction;
      @include text-align;
      padding: 0;
      li {
        padding: 0 0 0.8rem 0;
        a {
          color: #a8b3ba;
          display: inline-block;
          padding: 0;
          margin: 0;
          p {
            font-size: 0.32rem;
            margin-top: 0.05rem;
          }
          .iconfont {
            font-size: 0.52rem;
            display: inline-block;
          }
        }
        &.active {
          a {
            color: $main-color;
            .iconfont {
              color: $main-color;
            }
          }
        }
      }
    }
  }
}
</style>

