<template>
  <div class="sidebar-logo-container" >
    <!-- <div class="sidebar-logo-link" v-if="collapse">
      <router-link to="/user/profile">
        <img :src="avatar" class="sidebar-logo" />
      </router-link>
    </div> -->
    <div class="sidebar-logo-link2" >
      <!-- <router-link to="/user/profile">
        <img :src="avatar" class="sidebar-logo" />
      </router-link> -->
      <div>
        <div class="sidebar-title">
          <p>软件版本号：V0.81</p>
          <span></span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import logoImg from '@/assets/logo/logo.png'  
import variables from '@/assets/styles/variables.scss'
import { mapGetters } from 'vuex'
export default {
  name: 'SidebarLogo',
  props: {
    collapse: {
      type: Boolean,
      required: true
    }
  },
  computed: {
    ...mapGetters([
      'avatar',
    ]),
    variables() {
      return variables;
    },
    sideTheme() {
      return this.$store.state.settings.sideTheme
    }
  },
  data() {
    return {
      // logo: logoImg,
      CONTEXT_PATH:CONTEXT_PATH,
      CONTEXT_PATH2:CONTEXT_PATH2

    }
  },
  methods: {
    async logout() {
      this.$confirm('确定注销并退出系统吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$store.dispatch('LogOut').then(() => {
          //location.href = '/index';
          location.href = this.CONTEXT_PATH2;
        })
      }).catch(() => {});
    }
  }
}
</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%;
  text-align: center;
  overflow: hidden;
  margin: 70px 0 10px 0px;

  & .sidebar-logo-link {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

    & .sidebar-logo {
      width: 45px;
      height: 45px;
      vertical-align: middle;
      border-radius: 50%;
    }
    p{
      padding: 0;
      margin: 0;
    }
    & .sidebar-title {
      width: 100%;
      padding: 3px;
      color: rgb(128, 128, 128);
      font-size: 10px;
      display: flex;
      justify-content: space-between;
      &>p {
        font-size: 14px;
      }
      &>.xs {
        cursor: pointer;
      }
    }
  }
  & .sidebar-logo-link2 {
    height: 100%;
    padding: 0 25px;
    position: relative;
    bottom: 0;
    // display: flex;
    // align-items: center;

    & .sidebar-logo {
      width: 45px;
      height: 45px;
      vertical-align: middle;
      margin-right: 15px;
      border-radius: 50%;
    }
    p{
      padding: 0;
      margin: 0;
    }
    & .sidebar-title {
      width: 100%;
      padding: 3px;
      color: rgb(128, 128, 128);
      font-size: 10px;
      display: flex;
      justify-content: space-between;
      &>p {
        font-size: 14px;
      }
      &>.xs {
        cursor: pointer;
      }
    }
  }
  ::v-deep .dotClass {
   background-color: #409efe ;
   width:6px;
   height:6px;
   border-radius: 50%;
   display: inline-block;
   margin: 0 5px 1px 0;
  }
}
</style>
