|
@@ -0,0 +1,108 @@
|
|
|
+<script setup>
|
|
|
+import { reactive, ref, watch } from "vue";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
+const route = useRoute();
|
|
|
+
|
|
|
+let activePath = ref("/activity/list");
|
|
|
+watch(
|
|
|
+ () => route.path,
|
|
|
+ (to) => {
|
|
|
+ activePath.value = to;
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
+const menuList = reactive([
|
|
|
+ {
|
|
|
+ MenuId: 1,
|
|
|
+ name: "报告及活动",
|
|
|
+ path: "/activity/list",
|
|
|
+ icon_path: new URL('../../assets/leftNav/activity-s.png', import.meta.url).href,
|
|
|
+ children: null,
|
|
|
+ },
|
|
|
+]);
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <el-aside width="166px" class="aside-wrap">
|
|
|
+ <div class="logo-box flex-row-col-center">
|
|
|
+ <img src="@/assets/logo.png" alt="logo" class="logo" />
|
|
|
+ <span>弘则研报</span>
|
|
|
+ </div>
|
|
|
+ <el-menu router :default-active="activePath" unique-opened background-color="#DAB37C" text-color="#ffffff" active-text-color="#ffffff" class="el-menu-wrap">
|
|
|
+ <template v-for="menu in menuList">
|
|
|
+ <el-menu-item :index="menu.path" :key="menu.id" v-if="!menu.children">
|
|
|
+ <img class="menu-icon" :src="menu.icon_path" alt="" />
|
|
|
+ <span class="menu-text">{{ menu.name }}</span>
|
|
|
+ </el-menu-item>
|
|
|
+ <el-sub-menu :index="menu.MenuId + ''" :key="menu.MenuId" v-else>
|
|
|
+ <template #title>
|
|
|
+ <img class="menu-icon" :src="menu.icon_path" alt="" />
|
|
|
+ <span class="menu-text">{{ menu.name }}</span>
|
|
|
+ </template>
|
|
|
+ <el-menu-item v-for="child in menu.children" :key="child.MenuId" :index="child.path" style="text-align: center">
|
|
|
+ {{ child.name }}
|
|
|
+ </el-menu-item>
|
|
|
+ </el-sub-menu>
|
|
|
+ </template>
|
|
|
+ </el-menu>
|
|
|
+ </el-aside>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.aside-wrap {
|
|
|
+ padding-top: 103px;
|
|
|
+ background-color: #fff;
|
|
|
+ position: relative;
|
|
|
+ border-right:1px solid #F2F2F2;
|
|
|
+ &::-webkit-scrollbar {
|
|
|
+ width: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+.logo-box {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 73px;
|
|
|
+ z-index: 99;
|
|
|
+ text-align: center;
|
|
|
+ background-color: #fff;
|
|
|
+ border-bottom: 1px solid #F2F2F2;
|
|
|
+ .logo {
|
|
|
+ width: 32px;
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
+ span{
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.el-menu-wrap {
|
|
|
+ width: 100%;
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+.el-menu-item.is-active {
|
|
|
+ background-color: rgba(253, 184, 99, 0.1) !important;
|
|
|
+}
|
|
|
+.menu-icon {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ margin-right: 20px;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
+.menu-text {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ font-size: 15px;
|
|
|
+}
|
|
|
+ul,
|
|
|
+li {
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+</style>
|