From 78f92bf23fd4a9206f6ec79efa12c1f537386cee Mon Sep 17 00:00:00 2001 From: wen <1515> Date: Sat, 22 Oct 2022 19:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=82=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E8=8F=9C=E5=8D=95=E6=A0=8F=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=88=B6=E8=8F=9C=E5=8D=95=E4=B9=9F=E5=8F=AF=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=86=85=E5=AE=B9=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=96=E9=93=BE=E8=B7=B3=E8=BD=AC=E5=BD=93=E5=89=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2404=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/components/Breadcrumb/index.vue | 6 +- src/layout/components/Sidebar/Link.vue | 1 + src/layout/components/Sidebar/Logo.vue | 2 +- src/layout/components/Sidebar/SidebarItem.vue | 26 ++++- src/layout/components/Sidebar/index.vue | 8 +- .../components/Sidebar/leftMenusData.js | 12 +- src/peizhi.js | 5 + src/router/index.js | 109 +++++------------- src/styles/element-ui.scss | 2 + src/styles/sidebar.scss | 17 ++- src/views/subfile/index.vue | 2 +- 12 files changed, 82 insertions(+), 109 deletions(-) create mode 100644 src/peizhi.js diff --git a/package.json b/package.json index 6d0fe1e..927d3f4 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ }, "dependencies": { "axios": "^1.1.2", + "core-js": "3.6.5", "element-ui": "2.13.2", "js-cookie": "2.2.0", "normalize.css": "7.0.0", diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 503a7ab..dc03771 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -1,5 +1,5 @@ @@ -102,14 +115,19 @@ export default { return false }, resolvePath(routePath) { + if (isExternal(routePath)) { return routePath } + //console.log(this.basePath); + //console.log(routePath); if (isExternal(this.basePath)) { + //console.log(this.basePath); return this.basePath } + return path.resolve(this.basePath, routePath) } } } - + \ No newline at end of file diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 2a31347..b7c3499 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -3,7 +3,6 @@ import('@/views/filemange/index'), meta: { title: '', icon: 'dashboard' } }, @@ -73,28 +75,22 @@ export const constantRoutes = [ ] }, { - path: '/', + path: '/usermange', component: Layout, - children: [{ - path: 'usermange', - name: 'Usermange', - component: () => import('@/views/usermanage/index'), - meta: { title: '用户管理', icon: 'dashboard' } - }] + name: 'usermange', + children: [ + { + path: 'index', + name: 'Usermange', + component: () => import('@/views/usermanage/index'), + meta: { title: '用户管理', icon: 'form' } + } + ] }, - // { - // path: '/', - // component: Layout, - // children: [{ - // path: 'subfile', - // name: 'Subfile', - // component: () => import('@/views/subfile/index'), - // meta: { title: '文件管理', icon: 'dashboard' } - // }] - // }, { path: '/systme', component: Layout, + redirect: '/systme/changepass', name: 'systme', meta: { title: '系统管理', icon: 'el-icon-s-help' }, children: [ @@ -118,77 +114,24 @@ export const constantRoutes = [ } ] }, - { - path: 'external-link', - component: Layout, - children: [ - { - path: 'https://dev.filesite.io/', - meta: { title: '前端展示页面', icon: 'link' } - } - ] - }, - + + { path: '*', redirect: '/404', hidden: true } // 404 page must be placed at the end !!! - { path: '*', redirect: '/404', hidden: true } + ] -const createRouter = (a) => new Router({ - //mode: 'history', // require service support - scrollBehavior: () => ({ y: 0 }), - routes: a +const createRouter = () => new Router({ + //mode: 'history', // require service supportmode: 'history', + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes }) -//let router -const router = createRouter(constantRoutes) -// 动态添加路由 -// import { mirlist } from '@/api/user' -// let pachs = () => import('@/views/filemange/index'); -// mirlist().then(response => { -// let datamain = response.data; -// //routesData(datamain.data.menus); -// //console.log(response); -// datamain.data.menus.forEach(item => { -// menus.push( -// { -// path: item.directory, -// name: item.directory, -// component: pachs, -// meta: { title: item.directory, icon: 'dashboard' } -// } -// ); -// }); -// //console.log(menus); -// //router = createRouter(constantRoutes) -// console.log(router.options); -// router = createRouter(constantRoutes) -// // { -// // path: 'filemange', -// // name: 'Filemange', -// // component: () => import('@/views/filemange/index'), -// // meta: { title: '文件管理', icon: 'dashboard' } -// // } - -// }).catch(function (error) { -// Message({ -// showClose: true, -// message: error, -// type: 'error' -// }); -// }); -//router = createRouter(constantRoutes) -//router.addRoutes(constantRoutes); - +const router = createRouter() // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 export function resetRouter() { const newRouter = createRouter() - router.matcher = newRouter.matcher // reset router 重置路由器 + router.matcher = newRouter.matcher // reset router } -// router.reloadRouter = function () { -// router.matcher = new Router({ -// mode: "history", -// constantRoutes -// }).matcher -// } + export default router diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index 0062411..a41481e 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -47,3 +47,5 @@ .el-range-separator { box-sizing: content-box; } + +.el-submenu__title i{color:#FFF;} diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss index ca8b22f..d36a53d 100644 --- a/src/styles/sidebar.scss +++ b/src/styles/sidebar.scss @@ -20,6 +20,10 @@ z-index: 2002; overflow: hidden; + .el_submenu_link{width:76%;height:56px;z-index:100;position:absolute;left:0;top:0;bottom:0;right:10%;} + .el_submenu_link:hover{background-color:rgba(0, 0, 0, 0.3);} + + // reset element-ui css .horizontal-collapse-transition { transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; @@ -67,14 +71,15 @@ height: 100%; width: 100% !important; } + .el-menu>div{position:relative;} // menu hover - .submenu-title-noDropdown, - .el-submenu__title { - &:hover { - background-color: $menuHover !important; - } - } + // .submenu-title-noDropdown, + // .el-submenu__title { + // &:hover { + // background-color: $menuHover !important; + // } + // } .is-active>.el-submenu__title { color: $subMenuActiveText !important; diff --git a/src/views/subfile/index.vue b/src/views/subfile/index.vue index 1f88de0..433be28 100644 --- a/src/views/subfile/index.vue +++ b/src/views/subfile/index.vue @@ -14,7 +14,7 @@ 搜索
- +