<template>
  <div class="navitem">
    <div class="logo">
      <div class="nav-title">车辆大屏管理系统</div>
    </div>
    <!-- <el-radio-group class="logo">
      <IconSvg :W="44" :H="44" name="item-logo" />
    </el-radio-group> -->
    <el-menu
      text-color="#000"
      :default-active="$route.path"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      :collapse="isCollapse"
      router
    >
      <el-menu-item index="/carcome">
        <div class="icons">
          <img
            style="width:25px"
            v-if="ItemIndex == '/carcome'"
            src="../../assets/images/carcome-active.png"
          />
          <img
            style="width:25px"
            v-else
            src="../../assets/images/carcome.png"
          />
        </div>
        <span slot="title">出入统计</span>
      </el-menu-item>
      <el-menu-item index="/car">
        <div class="icons">
          <img
            v-if="ItemIndex == '/car'"
            src="../../assets/images/car-active.png"
          />
          <img v-else src="../../assets/images/car.png" />
        </div>
        <span slot="title">车辆管理</span>
      </el-menu-item>
      <el-menu-item index="/role">
        <div class="icons">
          <img
            v-if="ItemIndex == '/role'"
            src="../../assets/images/role-active.png"
          />
          <img v-else src="../../assets/images/role.png" />
        </div>
        <span slot="title">账号管理</span>
      </el-menu-item>
      <el-menu-item index="/affiche">
        <div class="icons">
          <img
            v-if="ItemIndex == '/affiche'"
            src="../../assets/images/affiche-active.png"
          />
          <img v-else src="../../assets/images/affiche.png" />
        </div>
        <span slot="title">公告管理</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: "NavbarItem",
  data() {
    return {
      isCollapse: false
    };
  },
  mounted() {},
  computed: {
    ItemIndex: {
      get() {
        return this.$route.path;
      },
      set(val) {}
    }
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>

<style scoped lang="scss">
.navitem {
  width: 260px;

  .logo {
    height: 96px;
    background-color: rgba(19, 41, 73, 1);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    .nav-title {
      position: absolute;
      display: inline-block;
      height: 45px;
      line-height: 53px;
      color: #fff;
      font-size: 36px;
      font-weight: 500;
      margin-left: 35px;
    }
  }

  .el-menu {
    margin-top: 20px;
    border: none;
    .is-active {
      background-color: rgba(43, 76, 254, 1) !important;
      color: #fff;
      border-top-left-radius: 27px;
      border-bottom-left-radius: 27px;
      margin-left: 20px;
    }

    .el-menu-item {
      margin-left: 20px;
      height: 45px;
      line-height: 0;
      margin-bottom: 13px;
      font-size: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid transparent;
      box-sizing: border-box;
      border-top-left-radius: 27px;
      border-bottom-left-radius: 27px;

      .icons {
        margin-left: 27px;
      }

      span {
        width: 87px;
        height: 26px;
        display: flex;
        align-items: center;
        padding-left: 16px;
      }
    }
  }
}
</style>
