<template>
  <div id="heads">
    <el-row>
      <div class="headTop">
        <a href="" class="headImg">
          <img src="../../assets/logo.png" width="50" height="50" />
        </a>
        <h3 class="headCompany">吉林省计算中心科技服务平台管理后台</h3>
      </div>
      <div class="headBtn">
        <span class="mr14">|</span>
        <span class="mr14">
          <span class="el-icon-s-custom info_icon"></span>
          &nbsp;{{ user.name || '请登录' }}
        </span>
        <span class="mr14">|</span>
        <span style="color: #333;" @click="toLogout"
          ><span class="el-icon-switch-button info_icon"></span>
          &nbsp;退出
        </span>
      </div>
    </el-row>
  </div>
</template>

<script>
import { mapActions, mapState, mapMutations, createNamespacedHelpers } from 'vuex';
const { mapActions: login } = createNamespacedHelpers('login');
export default {
  name: 'heads',
  props: {},
  components: {},
  data: () => ({}),
  created() {},
  watch: {},
  computed: {
    ...mapState(['user']),
  },
  methods: {
    ...login(['logout']),
    toLogout() {
      localStorage.removeItem('token');
      //TODO 跳转到登陆
      window.location.href = 'http://free.liaoningdoupo.com/platlogin';
    },
  },
};
</script>

<style lang="less" scoped>
img {
  max-height: 100%;
  max-width: 100%;
}
a {
  text-decoration: none;
}
.headTop {
  float: left;
  width: 50%;
  padding: 0 0 0 50px;
}
.headImg {
  float: left;
  width: 60px;
  height: 60px;
  margin: 4px 0 0 0;
  text-align: center;
}
.headXinyong {
  float: left;
  width: 70px;
  height: 40px;
  margin: 13px 0 0 10px;
}
.headCompany {
  float: left;
  font-size: 21px;
  width: 500px;
  padding: 18px 10px;
  margin: 0;
  color: #333;
  font-family: 'inherit';
  font-weight: 500;
}
.headBtn {
  float: right;
  width: 40%;
  text-align: right;
  padding: 0 60px 0 0;
  margin-top: 20px;
  font-size: 14px;
  color: #333;
}
.headBtn .mr14 {
  margin-right: 14px;
  color: #333;
}
.headBtn .el-button {
  border-radius: 0px;
  border: none;
  width: 0;
  height: 0px;
}
.headBtn .el-button:hover {
  background: none;
}
.popover-content {
  margin: 0;
  padding: 0;
  .el-col {
    border-bottom: 1px dashed #cccccc;
    font-size: 0.8rem;
    height: 1.25rem;
  }
}
/deep/.el-popper {
  border: 1px solid #ccc;
  border-radius: 0px;
  height: 100px;
  padding: 0;
}
/deep/.popoverCon {
  width: 400px;
  height: 70px;
  text-align: center;
  padding: 0;
  margin: 0;
}
/deep/.popoverCon li {
  list-style: none;
}
/deep/.popoverBtn {
  position: absolute;
  bottom: 0;
  left: 0px;
  width: 424px;
  height: 30px;
  line-height: 30px;
  text-align: right;
  color: #333;
  border-radius: 0 0 4px 4px;
  background: #f6f6f6;
  margin: 0;
  padding: 0;
}
/deep/.popoverBtn:hover {
  text-decoration: underline;
  color: #409eff;
}
/deep/.el-form-item__label {
  padding: 0px 0px 0 0;
}
/deep/.el-dialog__header {
  background-color: #40a44c;
}
/deep/.el-icon-close:before {
  color: #000;
}
/deep/.el-dialog__footer {
  padding: 0px 20px 10px;
}
/deep/.el-dialog__body {
  padding: 15px 20px;
}
</style>
