| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template>
- <div class="body">
- <div class="top">
- <div class="title">CocoClass后台管理</div>
- <div class="person">
- <div class="person_name">{{ userinfo ? userinfo.username : "" }}</div>
- <el-button type="text" @click="handleLogout" style="margin-left: 20px">退出</el-button>
- </div>
- </div>
- <div class="container">
- <div class="left">
- <ul>
- <router-link class="menu_left" to="/user-list">
- <i class="el-icon-s-custom"></i>账号列表
- </router-link>
- <router-link class="menu_left" to="/user-examine">
- <i class="el-icon-edit"></i>账号审核
- </router-link>
- <router-link class="menu_left" to="/organ-list">
- <i class="el-icon-office-building"></i>组织列表
- </router-link>
- <router-link class="menu_left" to="/school-list">
- <i class="el-icon-school"></i>学校列表
- </router-link>
- <!-- <router-link class="menu_left" to="/version-add">
- <i class="el-icon-office-building"></i>版本更新
- </router-link> -->
- </ul>
- </div>
- <div class="table-container">
- <router-view></router-view>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { mapGetters, mapActions } from 'vuex';
- import { loginOut } from '@/api/user';
- export default {
- name: "HomeView",
- computed: {
- ...mapGetters(['userinfo']),
- },
- methods: {
- ...mapActions({
- logout: 'user/logout'
- }),
- async handleLogout() {
- this.$confirm('确定退出吗', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- loginOut()
- .then(async () => {
- this.$message({
- message: '退出成功',
- type: 'success'
- });
- await this.logout();
- this.$router.push('/login');
- })
- .catch(err => {
- console.error(err);
- });
- }).catch(() => {
- // 取消操作
- });
- }
- },
- mounted() {},
- };
- </script>
- <style scoped>
- .body {
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
- .top {
- width: 100%;
- height: 50px;
- background-color: #ffffff;
- display: flex;
- align-items: center;
- padding: 0 20px;
- box-sizing: border-box;
- }
- .top > .title {
- font-weight: bold;
- font-size: 20px;
- line-height: 40px;
- }
- .person {
- margin-left: auto;
- display: flex;
- align-items: center;
- }
- .person > .person_name {
- font-size: 15px;
- color: black;
- font-weight: 400;
- }
- .container {
- display: flex;
- width: 100%;
- height: calc(100% - 50px);
- overflow: hidden;
- }
- .table-container {
- width: calc(100% - 180px);
- overflow: hidden;
- height: 100%;
- }
- .left {
- width: 180px;
- height: 100%;
- background-color: #ffffff;
- display: flex;
- flex-direction: column;
- border: 5px;
- align-items: center;
- }
- .left ul {
- width: 100%;
- background-color: #ffffff;
- }
- .menu_left {
- width: 100%;
- height: 50px;
- text-decoration: none;
- color: rgb(154, 154, 154);
- background-color: #ffffff;
- line-height: 40px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .menu_left > i {
- margin-right: 10px;
- }
- .router-link-active {
- background-color: #3d67bc;
- color: rgb(255, 255, 255);
- }
- .router-link-exact-active {
- background-color: #3d67bc;
- color: rgb(255, 255, 255);
- }
- </style>
|