guhongwei 4 years ago
parent
commit
cac89c4fc1

+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <link rel="stylesheet" type="text/css" href="iconfont.css" />
+    <!-- <link rel="stylesheet" type="text/css" href="iconfont.css" /> -->
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>
   <body>

File diff suppressed because it is too large
+ 57 - 0
src/iconfonts/iconfont.css


BIN
src/iconfonts/iconfont.eot


File diff suppressed because it is too large
+ 56 - 0
src/iconfonts/iconfont.svg


BIN
src/iconfonts/iconfont.ttf


BIN
src/iconfonts/iconfont.woff


+ 32 - 7
src/layout/layout-part/menus.vue

@@ -2,7 +2,7 @@
   <div id="menus">
     <el-row>
       <el-col :span="24">
-        <el-menu :default-active="$route.path" background-color="#353852" text-color="#ffffff" active-text-color="#409eff" router>
+        <!-- <el-menu :default-active="$route.path" background-color="#353852" text-color="#ffffff" active-text-color="#409eff" router>
           <el-menu-item index="/">
             <i class="iconfont iconshouye"></i>
             <span slot="title">后台首页</span>
@@ -27,6 +27,16 @@
             <i class="iconfont icontongji"></i>
             <span slot="title">统计管理</span>
           </el-menu-item>
+        </el-menu> -->
+        <el-menu background-color="#353852" text-color="#ffffff" active-text-color="#409eff">
+          <template v-for="item in menu">
+            <template>
+              <el-menu-item :index="item.path" @click="selectMenu(item.path)" :key="item.name">
+                <i v-if="item.icon" :class="item.icon"></i>
+                <span v-if="item.name" slot="title">{{ item.name }}</span>
+              </el-menu-item>
+            </template>
+          </template>
         </el-menu>
       </el-col>
     </el-row>
@@ -34,21 +44,28 @@
 </template>
 
 <script>
+import { index, user, role, live, room, stat } from '@/util/role_menu.js';
+import * as menus from '@/util/role_menu.js';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'menus',
   props: {},
   components: {},
   data: function() {
-    return {};
+    return {
+      menu: [],
+    };
+  },
+  created() {
+    this.search();
   },
-  created() {},
   methods: {
-    handleOpen(key, keyPath) {
-      console.log(key, keyPath);
+    search() {
+      this.menu.push(index, user, role, live, room, stat);
+      return;
     },
-    handleClose(key, keyPath) {
-      console.log(key, keyPath);
+    selectMenu(path) {
+      this.$router.push({ path: path });
     },
   },
   computed: {
@@ -60,6 +77,14 @@ export default {
   metaInfo() {
     return { title: this.$route.meta.title };
   },
+  // watch: {
+  //   user: {
+  //     handler(val, oval) {
+  //       if (val && !_.isEqual(val, oval)) this.search();
+  //     },
+  //     immediate: true,
+  //   },
+  // },
 };
 </script>
 

+ 1 - 0
src/main.js

@@ -12,6 +12,7 @@ import '@/plugins/loading';
 import '@/plugins/var';
 import '@/plugins/methods';
 import '@/plugins/setting';
+import '@/iconfonts/iconfont.css';
 
 new Vue({
   router,

+ 3 - 3
src/store/index.js

@@ -1,5 +1,5 @@
-import Vue from "vue";
-import Vuex from "vuex";
+import Vue from 'vue';
+import Vuex from 'vuex';
 
 Vue.use(Vuex);
 
@@ -7,5 +7,5 @@ export default new Vuex.Store({
   state: {},
   mutations: {},
   actions: {},
-  modules: {}
+  modules: {},
 });

+ 30 - 0
src/util/role_menu.js

@@ -0,0 +1,30 @@
+export const index = {
+  name: '首页',
+  path: '/',
+  icon: 'iconfont iconshouye',
+};
+export const user = {
+  name: '用户管理',
+  path: '/user/index',
+  icon: 'iconfont iconyonghu',
+};
+export const role = {
+  name: '权限管理',
+  path: '/role/index',
+  icon: 'iconfont iconquanxian',
+};
+export const live = {
+  name: '直播管理',
+  path: '/live/index',
+  icon: 'iconfont iconzhibo',
+};
+export const room = {
+  name: '房间管理',
+  path: '/room/index',
+  icon: 'iconfont iconfangjian',
+};
+export const stat = {
+  name: '统计管理',
+  path: '/stat/index',
+  icon: 'iconfont icontongji',
+};

+ 3 - 3
src/views/index.vue

@@ -3,10 +3,10 @@
     <el-row>
       <el-col :span="24">
         <el-col :span="24" class="top">
-          头部as
+          头部assdfsfsdf
         </el-col>
         <el-col :span="24" class="main">
-          主题asszfd
+          nihaosdsdfsaedlfk
         </el-col>
       </el-col>
     </el-row>
@@ -20,7 +20,7 @@ export default {
   props: {},
   components: {},
   data: function() {
-    return { show2: true };
+    return {};
   },
   created() {},
   methods: {},