<template>
  <div>
    <el-container>
      <el-header style="background-color: #ccc; line-height: 50px">
        <div class="navs">
          <div class="maintitle">神豚医疗信息系统</div>

          <div class="btn">
            当前用户{{ user }}
            <el-dropdown>
              <span class="el-dropdown-link">
                操作<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item @click.native="logout"
                  >退出登录</el-dropdown-item
                >
                <el-dropdown-item>修改密码</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </div>
      </el-header>

      <el-container>
        <el-aside :width="isCollapse ? '64px' : '220px'">
          <el-menu
            style="height: 100%"
            default-active="2"
            class="el-menu-vertical-demo"
            background-color="#545c64"
            router
            active-text-color="#fff"
            :unique-opened="true"
            text-color="#000"
            @select="aa"
            :collapse="isCollapse"
            :collapse-transition="false"
          >
            <div class="collapseandunfoled" @click="isCollapse = !isCollapse">
              | | |
            </div>
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-document"></i>
                <span>用户权限管理</span>
              </template>
              <el-menu-item index="role">
                <i class="el-icon-menu"></i> <span slot="title">角色管理</span>
              </el-menu-item>
              <el-menu-item index="user-list">
                <i class="el-icon-menu"></i> <span slot="title">用户管理</span>
              </el-menu-item>
              <el-menu-item index="organization-units"
                ><i class="el-icon-menu"></i><span slot="title">组织架构</span>
              </el-menu-item>
              <el-menu-item index="audit-log">
                <i class="el-icon-menu"></i> <span slot="title">安全日志</span>
              </el-menu-item>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-s-tools"></i>
                <span>基础字典</span>
              </template>
              <el-menu-item index="guide-type"
                ><i class="el-icon-menu"></i>导引类别</el-menu-item
              >
              <el-menu-item index="medical-report-type"
                ><i class="el-icon-menu"></i>体检报告类别</el-menu-item
              >
              <el-menu-item index="sex"
                ><i class="el-icon-menu"></i>性别</el-menu-item
              >
              <el-menu-item index="marital-status"
                ><i class="el-icon-menu"></i>婚姻状况</el-menu-item
              >
              <el-menu-item index="nation"
                ><i class="el-icon-menu"></i>民族</el-menu-item
              >
              <el-menu-item index="birth-place"
                ><i class="el-icon-menu"></i>籍贯</el-menu-item
              >
              <el-menu-item index="result-status"
                ><i class="el-icon-menu"></i>结果状态</el-menu-item
              >
              <el-menu-item index="medical-type"
                ><i class="el-icon-menu"></i>体检类别</el-menu-item
              >
              <el-menu-item index="personnel-type"
                ><i class="el-icon-menu"></i>人员类别</el-menu-item
              >
              <el-menu-item index="device-type"
                ><i class="el-icon-menu"></i>仪器类别</el-menu-item
              >
              <el-menu-item index="sample-type"
                ><i class="el-icon-menu"></i>标本类型</el-menu-item
              >
              <el-menu-item index="unit"
                ><i class="el-icon-menu"></i>单位</el-menu-item
              >
              <el-menu-item index="diagnosis-postfix"
                ><i class="el-icon-menu"></i>诊断后缀</el-menu-item
              >
              <el-menu-item index="medical-conclusion-type"
                ><i class="el-icon-menu"></i>体检结论类别</el-menu-item
              >
              <el-menu-item index="medical-conclusion"
                ><i class="el-icon-menu"></i>体检结论</el-menu-item
              >
              <el-menu-item index="sample-container"
                ><i class="el-icon-menu"></i>标本容器</el-menu-item
              >
              <el-menu-item index="common-char-type"
                ><i class="el-icon-menu"></i>常用字符类别</el-menu-item
              >
              <el-menu-item index="common-char"
                ><i class="el-icon-menu"></i>常用字符</el-menu-item
              >
              <el-menu-item index="customer-org-type"
                ><i class="el-icon-menu"></i>客户单位类别</el-menu-item
              >
              <el-menu-item index="item-default-result"
                ><i class="el-icon-menu"></i>项目默认结果</el-menu-item
              >
              <el-menu-item index="diagnosis-level"
                ><i class="el-icon-menu"></i>诊断级别</el-menu-item
              >
            </el-submenu>
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-s-tools"></i>
                <span>收费设置</span>
              </template>
              <el-menu-item index="invoice-item-type"
                ><i class="el-icon-menu"></i>发票项目类别</el-menu-item
              >
              <el-menu-item index="pay-mode"
                ><i class="el-icon-menu"></i>支付方式</el-menu-item
              >
            </el-submenu>
            <el-submenu index="4">
              <template slot="title">
                <i class="el-icon-s-tools"></i>
                <span>常用设置</span>
              </template>
              <el-menu-item index="item-type"
                ><i class="el-icon-menu"></i>项目类别</el-menu-item
              >
              <el-menu-item index="sample-group"
                ><i class="el-icon-menu"></i>条码分组</el-menu-item
              >
              <el-menu-item index="asbitem"
                ><i class="el-icon-menu"></i>组和项目</el-menu-item
              >
              <el-menu-item index="item"
                ><i class="el-icon-menu"></i>项目</el-menu-item
              >
              <el-menu-item index="reference-range"
                ><i class="el-icon-menu"></i>参考范围</el-menu-item
              >
              <el-menu-item index="sex-hormone-reference-range"
                ><i class="el-icon-menu"></i>性激素参考范围</el-menu-item
              >
              <el-menu-item index="diagnosis"
                ><i class="el-icon-menu"></i>诊断</el-menu-item
              >
              <el-menu-item index="diagnosis-template"
                ><i class="el-icon-menu"></i>诊断模板</el-menu-item
              >
              <el-menu-item index="item-result-template"
                ><i class="el-icon-menu"></i>项目结果模板</el-menu-item
              >
              <el-menu-item index="item-result-match"
                ><i class="el-icon-menu"></i>项目结果匹配</el-menu-item
              >
              <el-menu-item index="item-template"
                ><i class="el-icon-menu"></i>项目模板</el-menu-item
              >
              <el-menu-item index="medical-package"
                ><i class="el-icon-menu"></i>套餐</el-menu-item
              >
              <el-menu-item index="sys-parm-type"
                ><i class="el-icon-menu"></i>系统参数类别</el-menu-item
              >
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
          <!-- Main -->
          <!-- <el-card>
            <el-button type="primary" @click="btn">主要按钮</el-button>
          </el-card> -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
///api/app/item/in-filter
import router from "@/router";

export default {
  data() {
    return {
      index: 1,
      isCollapse: false,
      user: "",
    };
  },
  created() {
    this.user = localStorage.getItem("user");
  },
  methods: {
    logout() {
      // localStorage.removeItem("tokentype");
      // localStorage.removeItem("token");
      localStorage.clear();
      this.$router.push({ path: "/login" });
    },
    aa(aa) {
      console.log(aa);
    },
  },
  components: { router },
};
</script>
<style scoped>
.el-menu {
  border-right: none;
}

.expandend {
  text-align: center;
  margin-right: 5%;
}

.navs {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.maintitle {
  font-size: 20px;
  font-weight: 700;
}

.el-header {
  height: 70px;
}

.el-aside {
  /* height: calc(100vh, -70px); */
  height: calc(100vh - 0px);
  /* height: 100%; */
  height: 91.5vh;
  /* height: 100%; */
  /* height: calc(100vh, -0px); */
}

.el-main {
  height: calc(100vh, -70px);
}

.el-menu-vertical-demo .el-menu {
  /* min-height: 100vh; */
  height: calc(100vh, -70px);
}

.btn {
  margin-right: 5%;
}

.collapseandunfoled {
  text-align: center;
  line-height: 40px;
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
</style>