<template>
  <div class="navbar">
    <div class="left-menu">
        <i class="el-icon-arrow-left icon-menu" slot="reference" @click="backHome()"></i>
        <div class="divider"></div>
        <div class="text" :class="{'activate': status}" @click="changeStatus()">
          发起审批
        </div>
        <div class="text" :class="{'activate': !status}" @click="changeStatus()">
          查看数据
        </div>
    </div>
  </div>
</template>

<script>
import {getPath} from "@/utils/ruoyi";
import logoImg from '@/assets/logo/work.png'
export default {
  data() {
    return {
      status: true,
      logo: logoImg
    }
  },
  methods: {
    backHome(){
      this.$router.push({path: '/'})
    },
    changeStatus(){
      this.status = !this.status
      this.$parent.setStatus(this.status);
    },

    childMethod() {
        this.$parent.fatherMethod();
    },
    async logout() {
      this.$modal.confirm('确定注销并退出系统吗？', '提示').then(() => {
        this.$store.dispatch('LogOut').then(() => {
          location.href = getPath('/index');
        })
      }).catch(() => {});
    }
  }
}
</script>
<style lang="scss">
.down-popover {
  top: 60px !important;
}
</style>
<style lang="scss" scoped>
a {
  outline: none;
  text-decoration: none;
}
.corp-switch{
  align-items: center;
  display: flex;
  height: 65px;
  justify-content: space-between;
  padding-left: 20px;
  .current-corp {
      color: #141e31;
      font-size: 18px;
      line-height: 32px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      width: 240px;
  }      
}
.navbar {
  height: 60px;
  overflow: hidden;
  position: relative;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,21,41,.08);

  .hamburger-container {
    line-height: 46px;
    height: 100%;
    float: left;
    cursor: pointer;
    transition: background .3s;
    -webkit-tap-highlight-color:transparent;

    &:hover {
      background: rgba(0, 0, 0, .025)
    }
  }

  .breadcrumb-container {
    float: left;
  }

  .topmenu-container {
    position: absolute;
    left: 50px;
  }

  .errLog-container {
    display: inline-block;
    vertical-align: top;
  }
  
  .left-menu {
    font-size: 18px;
    padding: 0px 15px;
    float: left;
    height: 100%;
    // line-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    .icon-menu:hover {
        background: #e6e8ed;
        border-radius: 3px;
    }
    .icon-menu{
      color: #525967;
      cursor: pointer;
      display: inline-block;
      font-size: 20px;
      height: 30px;
      line-height: 30px;
      text-align: center;
      width: 30px;
    }
    .divider{
      height: 20px;
      margin: 0 5px;
      border: solid #EBECEE;
      border-width: 0 0 0 1px;
      display: inline-block;
      height: .9em;
      // margin: 0 15px;
      vertical-align: middle;
    }
    .text:hover {
        background: #e6e8ed;
    }
    
    .text{
      font-size: 18px;
      height: 50px;
      align-items: center;
      border-radius: 4px;
      color: gray;
      display: flex;
      padding: 0 20px;
      transition: background .2s ease;
      .menu-icon{
        background-size: 100px 20px;
        height: 20px;
        margin-right: 5px;
        width: 20px;
      }
    }
    .activate{
      color: black;
      font-weight: 800;
    }
  }
  
  .right-menu {
    float: right;
    height: 100%;
    line-height: 60px;

    &:focus {
      outline: none;
    }

    .right-menu-item {
      display: inline-block;
      padding: 0 8px;
      height: 100%;
      font-size: 18px;
      color: #5a5e66;
      vertical-align: text-bottom;

      &.hover-effect {
        cursor: pointer;
        transition: background .3s;

        &:hover {
          background: rgba(0, 0, 0, .025)
        }
      }
    }

    .avatar-container {
      margin-right: 20px;

      .avatar-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;

        .user-avatar {
          cursor: pointer;
          width: 35px;
          height: 35px;
          border-radius: 50%;
        }
        .user-nickname{
          margin-left: 5px;
          font-size: 14px;
        }

        .el-icon-caret-bottom {
          cursor: pointer;
          position: absolute;
          right: -20px;
          top: 25px;
          font-size: 12px;
        }
      }
    }
  }
}
</style>
