<template>
  <div class="sidebar-logo-container" :class="{'collapse':collapse}">
    <transition name="sidebarLogoFade">
      <!--pre环境-->
      <a href="/" class="sidebar-logo-link" v-if="this.$store.state.user.userurl=='adminpre.bjzxtw.org.cn'||this.$store.state.user.userurl=='localhost:9527'">
        <h1 class="sidebar-title">返回首页</h1>
      </a>
      <a :href="'http://' + this.$store.state.user.userurl" class="sidebar-logo-link" target="_blank" v-else>
        <h1 class="sidebar-title">返回首页</h1>
      </a>
      <!--dev环境-->
      <!-- <a href="/" class="sidebar-logo-link" v-if="this.$store.state.user.userurl=='admindev.bjzxtw.org.cn'||this.$store.state.user.userurl=='localhost:9527'">
        <h1 class="sidebar-title">返回首页</h1>
      </a>
      <a :href="'http://' + this.$store.state.user.userurl" class="sidebar-logo-link" target="_blank" v-else>
        <h1 class="sidebar-title">返回首页</h1>
      </a> -->


      <!-- <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
        <h1 class="sidebar-title">{{ title }} </h1>
      </router-link>
      <router-link v-else key="expand" class="sidebar-logo-link" to="/">
        <h1 class="sidebar-title">{{ title }} </h1>
      </router-link> -->
      <!-- <a :href="'http://' + this.$store.state.user.userurl" v-if="collapse" key="collapse" class="sidebar-logo-link">
        <h1 class="sidebar-title" v-if="this.$store.state.user.usertype==10000">返回首页</h1>
        <h1 class="sidebar-title" v-else>返回首页</h1>
      </a>
      <a :href="'http://' + this.$store.state.user.userurl" v-else key="expand" class="sidebar-logo-link">
        <h1 class="sidebar-title" v-if="this.$store.state.user.usertype==10000">返回首页</h1>
        <h1 class="sidebar-title" v-else>返回首页</h1>
      </a> -->
    </transition>
  </div>
</template>

<script>
export default {
  name: 'SidebarLogo',
  props: {
    collapse: {
      type: Boolean,
      required: true
    }
  },
  data() {
    return {
      title: '恒星管理平台',
      //logo: '/assets/public/nav/logo.png'
    }
  }
}
</script>

<style lang="scss" scoped>
.sidebarLogoFade-enter-active {
  transition: opacity 1.5s;
}

.sidebarLogoFade-enter,
.sidebarLogoFade-leave-to {
  opacity: 0;
}

.sidebar-logo-container {
  position: relative;
  width: 100%;
  height: 104px;
  line-height: 96px;
  background: #2F2F2F;
  text-align: center;
  overflow: hidden;

  & .sidebar-logo-link {
    height: 100%;
    width: 100%;
    & .sidebar-logo {
      width: 198px;
      height: 23px;
      vertical-align: middle;
      margin-right: 12px;
    }

    & .sidebar-title {
      display: inline-block;
      margin: 0;
      color: #fff;
      font-weight: 800;
      line-height: 50px;
      font-size: 22px;
      font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
      vertical-align: middle;
    }
  }

  &.collapse {
    .sidebar-logo {
      margin-right: 0px;
    }
  }
}
</style>
