<template>
  <div class="background">
    <el-container>
      <el-aside width="200px">
        <div style="height: 100%;background-color: #334154">
          <el-menu
              active-text-color="#1989FA"
              background-color="#334154"
              class="el-menu-vertical-demo"
              default-active="2"
              text-color="#fff"
              :router="true">
            <div style="height: 70px;width: 100%;padding-top: 20px">
              <img src="../assets/img/logoW.png" style="height: 60%;width: 80%; margin-left: 20px;margin-top: 5px"
                   alt="">
            </div>
            <el-menu-item index="/ApplyExperiment" v-if="userInfo.role!=='student'">实验项目申请</el-menu-item>
            <el-menu-item index="/Admit" v-if="userInfo.role==='admin'">实验项目审核</el-menu-item>
            <el-menu-item index="/ExperimentCheck" v-if="userInfo.role!=='student'">实验项目批阅</el-menu-item>

            <el-menu-item index="/BorrowRoom" v-if="userInfo.role!=='student'">教室申请</el-menu-item>
            <el-menu-item index="/BorrowRoom" v-if="userInfo.role==='student'">课表查看</el-menu-item>
            <el-menu-item index="/RecordList" v-if="userInfo.role!=='student'">教室申请记录</el-menu-item>
            <el-menu-item index="/Sub" v-if="userInfo.role==='student'">我的实验</el-menu-item>

            <el-menu-item index="/UserManage" v-if="userInfo.role==='admin'">用户管理</el-menu-item>
            <el-menu-item index="/Personal">个人信息</el-menu-item>

            <el-menu-item index="/System" v-if="userInfo.role!=='student'">系统管理</el-menu-item>
            <el-menu-item index="/Log" v-if="userInfo.role==='admin'">系统日志</el-menu-item>
          </el-menu>
        </div>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {
      userInfo: {
        userId: '',
        role: '',
        username: '',
        userDepart: '',
      },
    }
  },
  mounted() {
    this.userInfo.role = window.sessionStorage.getItem("role");
    this.userInfo.userId = window.sessionStorage.getItem("userId");
  },
}
</script>

<style scoped>
.background {
  width: 1440px;
  height: 100%;
}
</style>
