|
@@ -1,128 +0,0 @@
|
|
|
-<template>
|
|
|
- <div id="frame">
|
|
|
- <el-container style="height: 100vh">
|
|
|
- <el-header class="header">
|
|
|
- <el-col :span="20" class="left">
|
|
|
- <div>环南湖科创先导区双创服务平台-管理中心</div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4" class="right">
|
|
|
- <span>{{ user ? user.name : '游客' }}</span>
|
|
|
- <span @click="logoutBtn"><i class="el-icon-switch-button"></i></span>
|
|
|
- </el-col>
|
|
|
- </el-header>
|
|
|
- <el-container class="container">
|
|
|
- <el-aside width="200px" class="aside">
|
|
|
- <el-menu
|
|
|
- :default-active="$route.path"
|
|
|
- class="el-menu-vertical-demo"
|
|
|
- background-color="#242f42"
|
|
|
- text-color="#fff"
|
|
|
- active-text-color="#409eff"
|
|
|
- router
|
|
|
- overflow-y:
|
|
|
- scroll
|
|
|
- >
|
|
|
- <el-menu-item index="/adminCenter/homeIndex">首页</el-menu-item>
|
|
|
- <el-menu-item v-for="(item, index) in menuList" :key="index" :index="item.index">{{ item.name }}</el-menu-item>
|
|
|
- </el-menu>
|
|
|
- </el-aside>
|
|
|
- <el-main class="main">
|
|
|
- <router-view></router-view>
|
|
|
- </el-main>
|
|
|
- </el-container>
|
|
|
- </el-container>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import * as menu from './menu.js';
|
|
|
-import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-export default {
|
|
|
- name: 'frame',
|
|
|
- props: {},
|
|
|
- components: {},
|
|
|
- data: function() {
|
|
|
- return {
|
|
|
- menuList: [],
|
|
|
- };
|
|
|
- },
|
|
|
- created() {},
|
|
|
- methods: {
|
|
|
- // 退出登录
|
|
|
- logoutBtn() {
|
|
|
- localStorage.removeItem('token');
|
|
|
- localStorage.removeItem('type');
|
|
|
- this.$router.push({ path: '/' });
|
|
|
- },
|
|
|
- // 查询用户菜单
|
|
|
- searchMenu() {
|
|
|
- if (this.type == 'FWJG') {
|
|
|
- this.$set(this, `menuList`, menu.fwjg);
|
|
|
- } else if (this.type == 'QY') {
|
|
|
- this.$set(this, `menuList`, menu.qy);
|
|
|
- } else if (this.type == 'ZJJG') {
|
|
|
- this.$set(this, `menuList`, menu.zjjg);
|
|
|
- } else if (this.type == 'ZJ') {
|
|
|
- this.$set(this, `menuList`, menu.ZJ);
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapState(['user']),
|
|
|
- type() {
|
|
|
- return localStorage.getItem('type');
|
|
|
- },
|
|
|
- },
|
|
|
- metaInfo() {
|
|
|
- return { title: this.$route.meta.title };
|
|
|
- },
|
|
|
- watch: {
|
|
|
- type: {
|
|
|
- deep: true,
|
|
|
- immediate: true,
|
|
|
- handler(val) {
|
|
|
- this.searchMenu();
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
-.header {
|
|
|
- border-bottom: 1px solid #f1f1f1;
|
|
|
- background-color: #242f42;
|
|
|
- .left {
|
|
|
- height: 60px;
|
|
|
- line-height: 60px;
|
|
|
- font-size: 25px;
|
|
|
- font-family: cursive;
|
|
|
- font-weight: bold;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
- .right {
|
|
|
- height: 60px;
|
|
|
- line-height: 60px;
|
|
|
- font-size: 20px;
|
|
|
- text-align: right;
|
|
|
- color: #fff;
|
|
|
- span {
|
|
|
- padding: 0 10px;
|
|
|
- i {
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
- }
|
|
|
- span:hover {
|
|
|
- cursor: pointer;
|
|
|
- i {
|
|
|
- color: #ff0000;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-.container {
|
|
|
- .aside {
|
|
|
- background-color: #242f42;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|