<template>
  <div class="menu">
    <div class="nav-left">
      <img class="logo" src="../../assets/img/logo-header.png" alt="logo" />
      <div class="btn" @click="setStatus">{{name}}</div>
    </div>
  </div>
</template>

<script>
// import {surveyAPI} from '../../../../services'
export default {
  data () {
    // let account = '--';
    // try {
    //   account = G.UserInfo.user_info.account
    // } catch (e) {

    // }
    return {
      userName: 'admin',
      status: false,
      name: '收起'
    }
  },
  methods: {
    // logout () {
    //   surveyAPI.logout()
    //   window.location = '/login.html'
    // },
    setStatus () {
      if (this.status) {
        this.status = false
        this.name = '收起'
      } else {
        this.status = true
        this.name = '展开'
      }
      this.$root.$emit('updateStatus', this.status)
    }
  }
}
</script>

<style scoped lang="scss">
.menu {
  width: 100%;
  height: 100%;
  .nav-left {
    float: left;
    position: relative;
    width: 200px;
    height: 100%;
    img.logo {
      position: absolute;
      top: 50%;
      height: 70%;
      width: auto;
      transform: translateY(-50%);
    }
    .btn {
      float: right;
      margin-right: 20px;
      line-height: 60px;
      font-size: 12px;
      user-select: none;
      cursor: pointer;
      &:hover {
        color: #4A90E2
      }
    }
  }
}
</style>
