guhongwei 4 năm trước cách đây
mục cha
commit
f8f865149a

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 57 - 0
public/iconfont.css


+ 1 - 0
public/index.html

@@ -5,6 +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" />
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>
   <body>

+ 54 - 6
src/layout/layout-part/heads.vue

@@ -7,32 +7,73 @@
           <span>{{ afterInfo.title }}</span>
         </el-col>
         <el-col :span="12" class="right">
-          <span>绑定微信</span>
-          <span>修改密码</span>
-          <span>账号名称</span>
-          <span>退出登录</span>
+          <span @click="bindBtn()"><i class="iconfont iconbangding"></i>绑定微信</span>
+          <span @click="passwdBtn()"><i class="iconfont iconmima_huaban1"></i>修改密码</span>
+          <span @click="nameBtn()"><i class="iconfont iconicon-person"></i>账号名称</span>
+          <span @click="logoutBtn()"><i class="iconfont iconiconfront-"></i>退出登录</span>
         </el-col>
       </el-col>
     </el-row>
+    <el-dialog title="绑定" :visible.sync="bindDia" width="30%" :before-close="handleClose">
+      <bind @bindDown="bindDown"></bind>
+    </el-dialog>
+    <el-dialog title="修改密码" :visible.sync="passwdDia" width="30%" :before-close="handleClose">
+      <passwdDias></passwdDias>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+import bind from './parts/bind.vue';
+import passwdDias from './parts/passwdDia.vue';
 export default {
   name: 'heads',
   props: {},
-  components: {},
+  components: {
+    // 绑定微信
+    bind,
+    // 修改密码
+    passwdDias,
+  },
   data: function() {
     return {
       afterInfo: {
         logo: require('@/assets/logo.png'),
         title: '管理后台',
       },
+      // 绑定微信
+      bindDia: false,
+      // 修改密码
+      passwdDia: false,
     };
   },
   created() {},
-  methods: {},
+  methods: {
+    // 绑定微信
+    bindBtn() {
+      this.bindDia = true;
+    },
+    // 修改密码
+    passwdBtn() {
+      this.passwdDia = true;
+    },
+    // 点击名字
+    nameBtn() {
+      alert('点击名字事件');
+    },
+    // 退出登录
+    logoutBtn() {
+      alert('退出登录');
+    },
+    // 绑定微信关闭
+    bindDown() {
+      this.bindDia = false;
+    },
+    handleClose(done) {
+      done();
+    },
+  },
   computed: {
     ...mapState(['user']),
     pageTitle() {
@@ -73,6 +114,13 @@ export default {
   span {
     border-right: 1px solid #000;
     padding: 0 15px;
+    color: #000;
+    .iconfont {
+      margin: 0 5px 0 0;
+    }
+  }
+  span:hover {
+    cursor: pointer;
   }
   span:last-child {
     border-right: 0;

+ 21 - 5
src/layout/layout-part/menus.vue

@@ -4,12 +4,28 @@
       <el-col :span="24">
         <el-menu :default-active="$route.path" background-color="#353852" text-color="#ffffff" active-text-color="#409eff" router>
           <el-menu-item index="/">
-            <i class="el-icon-menu"></i>
-            <span slot="title">首页</span>
+            <i class="iconfont iconshouye"></i>
+            <span slot="title">后台首页</span>
           </el-menu-item>
-          <el-menu-item index="/home/index">
-            <i class="el-icon-setting"></i>
-            <span slot="title">导航四</span>
+          <el-menu-item index="/user/index">
+            <i class="iconfont iconyonghu"></i>
+            <span slot="title">用户管理</span>
+          </el-menu-item>
+          <el-menu-item index="/role/index">
+            <i class="iconfont iconquanxian"></i>
+            <span slot="title">权限管理</span>
+          </el-menu-item>
+          <el-menu-item index="/live/index">
+            <i class="iconfont iconzhibo"></i>
+            <span slot="title">直播管理</span>
+          </el-menu-item>
+          <el-menu-item index="/room/index">
+            <i class="iconfont iconfangjian"></i>
+            <span slot="title">房间管理</span>
+          </el-menu-item>
+          <el-menu-item index="/stat/index">
+            <i class="iconfont icontongji"></i>
+            <span slot="title">统计管理</span>
           </el-menu-item>
         </el-menu>
       </el-col>

+ 39 - 0
src/layout/layout-part/parts/bind.vue

@@ -0,0 +1,39 @@
+<template>
+  <div id="bind">
+    <el-row>
+      <el-col :span="24">
+        <p>绑定微信</p>
+        <el-button @click="bindDown()">关闭</el-button>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'bind',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {
+    bindDown() {
+      this.$emit('bindDown');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 61 - 0
src/layout/layout-part/parts/passwdDia.vue

@@ -0,0 +1,61 @@
+<template>
+  <div id="passwdDia">
+    <el-row>
+      <el-col :span="24">
+        <el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-ruleForm">
+          <el-form-item label="旧密码" prop="oldPassword">
+            <el-input v-model="form.oldPassword" placeholder="请输入旧密码" show-password></el-input>
+          </el-form-item>
+          <el-form-item label="新密码" prop="newPassword">
+            <el-input v-model="form.newPassword" placeholder="请输入新密码" show-password></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="submitForm('form')">保存</el-button>
+          </el-form-item>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'passwdDia',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      rules: {
+        oldPassword: [{ required: true, message: '请输入旧密码', trigger: 'blur' }],
+        newPassword: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
+      },
+      form: {},
+    };
+  },
+  created() {},
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          alert('submit!');
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 25 - 0
src/router/index.js

@@ -9,6 +9,31 @@ const routes = [
     meta: { title: '首页' },
     component: () => import('../views/index.vue'),
   },
+  {
+    path: '/user/index',
+    meta: { title: '用户管理' },
+    component: () => import('../views/user/index.vue'),
+  },
+  {
+    path: '/role/index',
+    meta: { title: '权限管理' },
+    component: () => import('../views/role/index.vue'),
+  },
+  {
+    path: '/live/index',
+    meta: { title: '直播管理' },
+    component: () => import('../views/live/index.vue'),
+  },
+  {
+    path: '/room/index',
+    meta: { title: '房间管理' },
+    component: () => import('../views/room/index.vue'),
+  },
+  {
+    path: '/stat/index',
+    meta: { title: '统计管理' },
+    component: () => import('../views/stat/index.vue'),
+  },
 ];
 
 const router = new VueRouter({

+ 2 - 2
src/views/index.vue

@@ -3,10 +3,10 @@
     <el-row>
       <el-col :span="24">
         <el-col :span="24" class="top">
-          头部
+          头部as
         </el-col>
         <el-col :span="24" class="main">
-          主题
+          主题asszfd
         </el-col>
       </el-col>
     </el-row>

+ 30 - 0
src/views/live/index.vue

@@ -0,0 +1,30 @@
+<template>
+  <div id="index">
+    <p>直播管理</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 30 - 0
src/views/role/index.vue

@@ -0,0 +1,30 @@
+<template>
+  <div id="index">
+    <p>权限管理</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 30 - 0
src/views/room/index.vue

@@ -0,0 +1,30 @@
+<template>
+  <div id="index">
+    <p>房间管理</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 30 - 0
src/views/stat/index.vue

@@ -0,0 +1,30 @@
+<template>
+  <div id="index">
+    <p>统计管理</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 30 - 0
src/views/user/index.vue

@@ -0,0 +1,30 @@
+<template>
+  <div id="index">
+    <p>用户管理</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>