<template>
  <div class="bottom">
    <el-row class="tac">
      <el-col :span="12">
        <el-menu :default-active="path" background-color="#fff" text-color="#777" active-text-color="#fff" router v-if="$store.state.userInfo.type == 2 || $store.state.userInfo.type == 4">
          <el-menu-item index="/anliList" v-if="nav.indexOf('/anliList') != -1">
            <div class="img" v-if="path == '/anliList'">
              <img src="../../assets/icon/course-active.svg" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/course.png" alt="" />
            </div>
            <span>案例管理</span>
          </el-menu-item>
          <!-- <el-menu-item index="/county" v-if="nav.indexOf('/county') != -1">
            <div class="img" v-if="path == '/county'">
              <img src="../../assets/icon/city-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/city.png" alt="" />
            </div>
            <span>区县管理</span>
          </el-menu-item> -->
          <el-menu-item index="/user" v-if="nav.indexOf('/user') != -1">
            <div class="img" v-if="path == '/user'">
              <img src="../../assets/icon/user-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/user.png" alt="" />
            </div>
            <span>账号管理</span>
          </el-menu-item>
          <!-- <el-menu-item index="/school" v-if="nav.indexOf('/school') != -1">
            <div class="img" v-if="path == '/school'">
              <img src="../../assets/icon/school-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/school.png" alt="" />
            </div>
            <span>学校管理</span>
          </el-menu-item> -->
          <el-menu-item index="/score" v-if="nav.indexOf('/score') != -1">
            <div class="img" v-if="path == '/score'">
              <img src="../../assets/icon/works-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/works.png" alt="" />
            </div>
            <span>评分查看</span>
          </el-menu-item>
          <el-menu-item index="/data" v-if="nav.indexOf('/data') != -1">
            <div class="img" v-if="path == '/data'">
              <img src="../../assets/icon/data-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/data.png" alt="" />
            </div>
            <span>我的资料</span>
          </el-menu-item>
          <!-- <el-menu-item index="/notice" v-if="nav.indexOf('/notice') != -1">
            <div class="img" v-if="path == '/notice'">
              <img src="../../assets/icon/notice-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/notice.png" alt="" />
            </div>
            <span>通知公告</span>
          </el-menu-item> -->
        </el-menu>
        <el-menu :default-active="path" background-color="#fff" text-color="#777" active-text-color="#fff" router v-else-if="$store.state.userInfo.type == 5 || $store.state.userInfo.type == 6">
          <el-menu-item index="/anliList1" v-if="nav.indexOf('/anliList1') != -1">
            <div class="img" v-if="path == '/anliList1'">
              <img src="../../assets/icon/course-active.svg" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/course.png" alt="" />
            </div>
            <span>案例管理</span>
          </el-menu-item>
          <el-menu-item index="/user1" v-if="nav.indexOf('/user1') != -1">
            <div class="img" v-if="path == '/user1'">
              <img src="../../assets/icon/user-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/user.png" alt="" />
            </div>
            <span>账号管理</span>
          </el-menu-item>
          <!-- <el-menu-item index="/school1" v-if="nav.indexOf('/school1') != -1">
            <div class="img" v-if="path == '/school1'">
              <img src="../../assets/icon/school-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/school.png" alt="" />
            </div>
            <span>学校管理</span>
          </el-menu-item> -->
          <el-menu-item index="/score1" v-if="nav.indexOf('/score1') != -1">
            <div class="img" v-if="path == '/score1'">
              <img src="../../assets/icon/works-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/works.png" alt="" />
            </div>
            <span>评分查看</span>
          </el-menu-item>
          <el-menu-item index="/data" v-if="nav.indexOf('/data') != -1">
            <div class="img" v-if="path == '/data'">
              <img src="../../assets/icon/data-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/data.png" alt="" />
            </div>
            <span>我的资料</span>
          </el-menu-item>
          <!-- <el-menu-item index="/notice" v-if="nav.indexOf('/notice') != -1">
            <div class="img" v-if="path == '/notice'">
              <img src="../../assets/icon/notice-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/notice.png" alt="" />
            </div>
            <span>通知公告</span>
          </el-menu-item> -->
        </el-menu>
        <el-menu :default-active="path" background-color="#fff" text-color="#777" active-text-color="#fff" router v-else-if="$store.state.userInfo.type == 3">
          <el-menu-item index="/anliList2" v-if="nav.indexOf('/anliList2') != -1">
            <div class="img" v-if="path == '/anliList2'">
              <img src="../../assets/icon/course-active.svg" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/course.png" alt="" />
            </div>
            <span>案例管理</span>
          </el-menu-item>
          <!-- <el-menu-item index="/user1" v-if="nav.indexOf('/user1') != -1">
            <div class="img" v-if="path == '/user1'">
              <img src="../../assets/icon/user-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/user.png" alt="" />
            </div>
            <span>账号管理</span>
          </el-menu-item>
          <el-menu-item index="/school1" v-if="nav.indexOf('/school1') != -1">
            <div class="img" v-if="path == '/school1'">
              <img src="../../assets/icon/works-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/works.png" alt="" />
            </div>
            <span>学校管理</span>
          </el-menu-item>
          <el-menu-item index="/score1" v-if="nav.indexOf('/score1') != -1">
            <div class="img" v-if="path == '/score1'">
              <img src="../../assets/icon/works-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/works.png" alt="" />
            </div>
            <span>评分查看</span>
          </el-menu-item>-->
          <el-menu-item index="/data" v-if="nav.indexOf('/data') != -1">
            <div class="img" v-if="path == '/data'">
              <img src="../../assets/icon/data-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/data.png" alt="" />
            </div>
            <span>我的资料</span>
          </el-menu-item>
          <!-- <el-menu-item index="/notice" v-if="nav.indexOf('/notice') != -1">
            <div class="img" v-if="path == '/notice'">
              <img src="../../assets/icon/notice-active.png" alt="" />
            </div>
            <div class="img" v-else>
              <img src="../../assets/icon/notice.png" alt="" />
            </div>
            <span>通知公告</span>
          </el-menu-item>  -->
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props: {
    luyou: Number,
    nav: Array
  },
  data() {
    return {
      path: this.$route.path,
    };
  },
  methods: {
    clickItem: function (path) {
      this.$router.push(path);
    },
  },
  watch: {
    luyou: {
      handler(n, o) {
        this.path = this.$route.path;
      },
      deep: true, // 深度监听父组件传过来对象变化
    },
  },
};
</script>

<style scoped>
.bottom {
  position: absolute;
  left: 20px;
  margin-top: 20px;
  background-color: #fff;
  width: 180px;
  height: calc(100% - 100px);
  min-height: 500px;
  z-index: 999;
  display: inline-block;
  border-radius: 5px;
  overflow: hidden;
}

.item {
  margin: 5px 20%;
  float: left;
}

.item p {
  margin: 0;
  font-size: 15px;
}

.active {
  color: #108b70;
}

.bottom>>>.el-menu-item.is-active {
  background: #3d67bc !important;
}

.tac>>>.el-col-12 {
  width: 100%;
}

.tac>>>.el-menu {
  border-right: none;
}

.tac>>>.el-menu-item {
  display: flex;
  justify-content: center;
  align-items: center;
}

.img {
  width: 20px;
  padding-right: 5px;
  padding-bottom: 3px;
}

.img>img {
  width: 100%;
  height: 100%;
}
</style>
