<template>
  <el-menu-item v-if="sidebarLogo" :class="{'submenu-title-noDropdown':isCollapse}" index="0" style="pointer-events: none;">
    <!-- 缩小时显示的logo，可以自定义，这里直接使用图标库中的 -->
    <svg-icon v-if="isCollapse" icon-class="run" />
    <!--正常状态下显示的，可以使用本地的logoImg-->
    <div v-for="item in company" :key="item.id" class="logo-con">
      <img :src="item.logoadr==='' ? Logo : baseApi + '/file/'+item.logoadr">
      <!--<img :src="logoImg">-->
    </div>
  </el-menu-item>
</template>

<script>
// import logoImg from '@/assets/logo/logo.png'
import { mapState } from 'vuex'
import { loadSysByUserid } from '@/api/sSysmanage'
import Logo from '@/assets/logo/logo.png'
export default {
  name: 'Logo',
  props: {
    isCollapse: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      Logo: Logo,
      company: []
      // logoImg: logoImg
    }
  },
  computed: {
    ...mapState({
      sidebarLogo: state => state.settings.sidebarLogo,
      baseApi: state => state.api.baseApi
    })
  },

  created() {
    this.loadSysByUserid()
  },
  methods: {
    loadSysByUserid() {
      loadSysByUserid().then(res => {
        // console.log(res, '22')
        this.company.push(res)
      })
    }
  }
}
</script>

<style scoped>

</style>
