Commit a49e0935 by 胡悦

提交优化

1 parent 78cc3786
......@@ -11,29 +11,8 @@ import Menu from '@/components/Menu/index.vue';
</script>
<template>
<div class="layout">
<a-layout>
<a-layout-header><NavBar /></a-layout-header>
<a-layout>
<a-layout-sider>
<Menu />
</a-layout-sider>
<a-layout-content class="content">
<router-view></router-view>
</a-layout-content>
</a-layout>
</a-layout>
</div>
<router-view></router-view>
</template>
<style lang="scss" scoped>
.content {
box-sizing: border-box;
width: 100%;
height: calc(100vh - 48px);
background-color: #f7f8f9;
box-sizing: border-box;
padding: 16px 20px;
overflow-y: auto
}
</style>
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-07-24 20:28:10
* @LastEditors: huyue
* @LastEditTime: 2024-10-17 17:38:27
* @LastEditTime: 2024-10-18 16:02:45
-->
<script lang="ts" setup>
......@@ -14,15 +14,11 @@ import { useRouter, useRoute } from 'vue-router';
const router = useRouter();
const route = useRoute();
let defaultSelectedKeys = ref(['']);
const menuList = ref(staticRoutes.filter(item => item.isMenu));
const routerList = staticRoutes.find(item => item.path === '/layout')?.children;
const menuList = ref(routerList!.filter(item => item.isMenu));
onBeforeMount (() => {
console.log(route)
if (route.path == '/login') {
defaultSelectedKeys.value = ['/investorRelated']
} else {
const _parentPath = staticRoutes.find(item => item.path === route.path)?.parentPath
defaultSelectedKeys.value = [_parentPath]
}
const _parentPath = routerList!.find(item => item.path === route.path)?.parentPath
defaultSelectedKeys.value = _parentPath === undefined ? ['/investorRelated'] : [_parentPath]
})
</script>
<template>
......
......@@ -17,56 +17,56 @@ const staticRoutes = Object.freeze([
component: () => import('views/login/index.vue'),
},
{
id: '1',
name: '投资者相关',
path: '/investorRelated',
parentPath: '/investorRelated',
component: () => import('views/investorRelated/index.vue'),
isMenu: true,
icon: 'icon-user',
children: []
path: '/layout',
component: () => import('views/layout/index.vue'),
children: [
{
id: '1',
name: '投资者相关',
path: '/investorRelated',
parentPath: '/investorRelated',
component: () => import('views/investorRelated/index.vue'),
isMenu: true,
icon: 'icon-user',
children: []
},
{
parentPath: '/investorRelated',
name: '新增公告',
path: '/investorRelated/addInvnotice',
component: () => import('views/investorRelated/addInvnotice.vue'),
},
{
id: '2',
name: '新闻动态',
parentPath: '/news',
path: '/news',
component: () => import('views/news/index.vue'),
isMenu: true,
icon: 'icon-public'
},
{
parentPath: '/news',
name: '新增动态',
path: '/news/addNews',
component: () => import('views/news/AddNews.vue'),
}
// {
// name: '投资者相关',
// path: '/layout/investorRelated',
// component: () => import('views/investorRelated/index.vue')
// },
// {
// name: '新增公告',
// path: '/layout/addInvnotice',
// component: () => import('views/investorRelated/addInvnotice.vue'),
// },
// {
// name: '新闻',
// path: '/layout/news',
// component: () => import('views/news/index.vue'),
// }
]
},
{
parentPath: '/investorRelated',
name: '新增公告',
path: '/investorRelated/addInvnotice',
component: () => import('views/investorRelated/addInvnotice.vue'),
},
{
id: '2',
name: '新闻动态',
parentPath: '/news',
path: '/news',
component: () => import('views/news/index.vue'),
isMenu: true,
icon: 'icon-public'
},
{
parentPath: '/news',
name: '新增动态',
path: '/news/addNews',
component: () => import('views/news/AddNews.vue'),
}
// {
// path: '/layout',
// component: () => import('views/layout/index.vue'),
// children: [
// {
// name: '投资者相关',
// path: '/layout/investorRelated',
// component: () => import('views/investorRelated/index.vue')
// },
// {
// name: '新增公告',
// path: '/layout/addInvnotice',
// component: () => import('views/investorRelated/addInvnotice.vue'),
// },
// {
// name: '新闻',
// path: '/layout/news',
// component: () => import('views/news/index.vue'),
// }
// ]
// },
])
export default staticRoutes
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!