From 667e1a5b49ffc2f7af9237b4542b1c2e4d00731f Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期一, 28 十一月 2022 16:37:12 +0800
Subject: [PATCH] 趋势分析
---
src/views/layout/components/AsideBar/index.vue | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 154 insertions(+), 0 deletions(-)
diff --git a/src/views/layout/components/AsideBar/index.vue b/src/views/layout/components/AsideBar/index.vue
new file mode 100644
index 0000000..f3e391f
--- /dev/null
+++ b/src/views/layout/components/AsideBar/index.vue
@@ -0,0 +1,154 @@
+<template>
+ <div class="AsideBar">
+ <!-- 浜岀骇渚ц竟鏍� -->
+ <el-aside width="200px" class="aside">
+ <el-scrollbar>
+ <el-menu class="el-menu-vertical" :default-active="$route.path">
+ <div v-for="item in asideList" :key="item.name">
+ <span class="AsideBarTitle">{{item.name}}</span>
+ <el-menu-item v-for="child in item.children" :key="child.name" :index="child.index" class="firstMenu"
+ @click="Jump(child.index)">
+ <span class="firstSpan">{{child.name}}</span>
+ </el-menu-item>
+ </div>
+ </el-menu>
+ </el-scrollbar>
+ </el-aside>
+ </div>
+</template>
+
+<script>
+export default {
+ data() {
+ return {
+ menu: [
+ {
+ name: '/home/system', children: [
+ {
+ name: "鍩虹璁剧疆", index: '/home/system/base', children: [
+ {
+ name: '鐢ㄦ埛绠$悊', index: '/home/system/user',
+ },
+ {
+ name:'瑙掕壊绠$悊', index:'/home/system/role',
+ },
+ {
+ name:'鏉冮檺绠$悊',index:'/home/system/authority',
+ },
+ {
+ name:'閮ㄩ棬绠$悊',index:'/home/system/department',
+ }
+ ]
+ },
+ { name: "骞冲彴璁剧疆", index: "/home/system/plateform", children: [
+ {
+ name:'闂ㄦ埛璁剧疆',index:'/home/system/portalSetting'
+ },
+ {
+ name:'绗笁鏂规帴鍙g鐞�',index:'/home/system/otherInterface'
+ }
+ ] },
+ ],
+ }
+ ],
+ asideList: null,
+ }
+ },
+ created() {
+ this.getAsideList(this.$route.path);
+ },
+ watch: {
+ $route(to, from) {
+ this.getAsideList(to.fullPath);
+ }
+ },
+ methods: {
+ getAsideList(path) {
+ let { menu } = this;
+ const that = this;
+ this.asideList = null;
+ menu.forEach(item => {
+ if (path.indexOf(item.name) !== -1) {
+ that.asideList = item.children;
+ }
+ })
+ },
+ Jump(path) {
+ this.$router.push(path);
+ }
+ }
+};
+</script>
+
+<style lang="scss" scpoed>
+.icon-padding {
+ padding-right: 10px;
+}
+
+.aside {
+ background: #eaedf1;
+ color: black;
+ text-align: center;
+ box-sizing: border-box;
+ position: relative;
+ // 鍥哄畾鏍囬
+ .siderbar-title {
+ position: fixed;
+ text-align: center;
+ margin: 0;
+ font-size: 26px;
+ width: 200px;
+ line-height: 66px;
+ top: 0;
+ left: 0;
+ z-index: 999;
+ // box-shadow: 0 -5px 5px #0ff inset;
+ }
+
+ .el-scrollbar {
+ height: calc(100vh - 66px);
+ box-sizing: border-box;
+
+ .el-menu {
+ border: 0;
+ .AsideBarTitle {
+ display: block;
+ line-height: 60px;
+ color: #999;
+ font-weight: 650;
+ background-color: #f2f2f2;
+ border-bottom: 1px solid #e4e4e4;
+ }
+
+ .firstMenu {
+ background: #eaedf1;
+ text-align: center;
+ height: 40px;
+ line-height: 40px;
+ background-color: #eaedf1;
+ color: #666666;
+ border-bottom: 1px solid #e4e4e4;
+
+ &:hover .firstSpan {
+ color: #1a87fe;
+ }
+
+ .el-menu-item {
+ &:hover {
+ color: #22d3eb;
+ }
+ }
+ }
+
+ .is-active {
+ background-color: #fff;
+ color: #1a87fe;
+ }
+ }
+
+ .el-scrollbar__wrap {
+ overflow-x: hidden;
+ }
+ }
+}
+</style>
\ No newline at end of file
--
Gitblit v1.8.0