|
@@ -0,0 +1,133 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="main layout">
|
|
|
|
+ <el-container>
|
|
|
|
+ <el-header style="height:70px;">
|
|
|
|
+ <div class="header-left logo">
|
|
|
|
+ <img class="logo-img" src="../../assets/logo.png" alt="" srcset="">
|
|
|
|
+ <h3>ITT运营后台</h3>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="header-right userinfo">
|
|
|
|
+ <div class="headimg"></div>
|
|
|
|
+ <div class="username">管理员</div>
|
|
|
|
+ <el-button type="text" @click="handleLogout">退出</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-header>
|
|
|
|
+ <el-container>
|
|
|
|
+ <el-aside style="width: 200px;">
|
|
|
|
+ <el-menu style="border:0;" :default-active="defaultActive" class="el-menu-vertical-demo" router @select="menuSelect">
|
|
|
|
+ <el-menu-item index="/main/user">
|
|
|
|
+ <i class="el-icon-user-solid"></i>
|
|
|
|
+ <span slot="title">用户管理</span>
|
|
|
|
+ </el-menu-item>
|
|
|
|
+ <el-menu-item index="/main/appointment">
|
|
|
|
+ <i class="el-icon-message-solid"></i>
|
|
|
|
+ <span slot="title">预约管理</span>
|
|
|
|
+ </el-menu-item>
|
|
|
|
+ <el-menu-item index="/main/config">
|
|
|
|
+ <i class="el-icon-s-grid"></i>
|
|
|
|
+ <span slot="title">配置管理</span>
|
|
|
|
+ </el-menu-item>
|
|
|
|
+ </el-menu>
|
|
|
|
+ </el-aside>
|
|
|
|
+ <el-main>
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
+ <transition name="el-fade-in">
|
|
|
|
+ <router-view/>
|
|
|
|
+ </transition>
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-main>
|
|
|
|
+ </el-container>
|
|
|
|
+ </el-container>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+export default {
|
|
|
|
+ name: 'Main',
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ defaultActive: '/main/user'
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ const currentPath = sessionStorage.getItem('currentPath')
|
|
|
|
+ if (currentPath) {
|
|
|
|
+ this.defaultActive = currentPath
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ menuSelect (index) {
|
|
|
|
+ sessionStorage.setItem('currentPath', index)
|
|
|
|
+ },
|
|
|
|
+ handleLogout () {
|
|
|
|
+ this.$confirm('确认退出吗?').then( _=> {
|
|
|
|
+ sessionStorage.clear()
|
|
|
|
+ this.$router.replace('/login')
|
|
|
|
+ }).catch(_ => {});
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
+.layout {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+.el-header {
|
|
|
|
+ background-color: #D3DCE6;
|
|
|
|
+ color: #333;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ .header-left {
|
|
|
|
+ width: 300px;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .logo-img {
|
|
|
|
+ width: 50px;
|
|
|
|
+ height: 50px;
|
|
|
|
+ margin-right: 20px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .header-right {
|
|
|
|
+ width: 300px;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .headimg {
|
|
|
|
+ width: 50px;
|
|
|
|
+ height: 50px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background-color: #45A6B5;
|
|
|
|
+ }
|
|
|
|
+ .username {
|
|
|
|
+ margin: 0 20px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+ .el-aside {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ color: #333;
|
|
|
|
+ height: 100%;
|
|
|
|
+ text-align: center;
|
|
|
|
+ line-height: 200px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-main {
|
|
|
|
+ background-color: #f3f5f7;
|
|
|
|
+ color: #333;
|
|
|
|
+ padding: 10px;
|
|
|
|
+ .box-card {
|
|
|
|
+ height: 99%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-container {
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+</style>
|