From 0801fddd7940fece09d2e717b321b58f3e94630d Mon Sep 17 00:00:00 2001 From: bypanghu Date: Mon, 7 Dec 2020 21:33:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?scss=E5=8F=98=E9=87=8F=EF=BC=8C=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E6=A0=87=E7=AD=BE=EF=BC=8C=E9=A1=B5=E9=9D=A2=E5=88=B7?= =?UTF-8?q?=E6=96=B0=EF=BC=8C=E7=82=B9=E5=87=BB=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/permission.js | 3 + web/src/style/aside.scss | 146 ++++++++++++++++++ web/src/style/main.scss | 49 +----- web/src/utils/page.js | 9 ++ .../layout/aside/historyComponent/history.vue | 5 + web/src/view/layout/index.vue | 29 ++-- web/src/view/person/person.vue | 42 +++-- 7 files changed, 215 insertions(+), 68 deletions(-) create mode 100644 web/src/style/aside.scss create mode 100644 web/src/utils/page.js diff --git a/web/src/permission.js b/web/src/permission.js index 48a7dc5f..989b1aa4 100644 --- a/web/src/permission.js +++ b/web/src/permission.js @@ -1,5 +1,6 @@ import router from './router' import { store } from '@/store/index' +import getPageTitle from '@/utils/page' let asyncRouterFlag = 0 @@ -7,6 +8,8 @@ const whiteList = ['login'] router.beforeEach(async(to, from, next) => { const token = store.getters['user/token'] + //修改网页标签名称 + document.title = getPageTitle(to.meta.title) // 在白名单中的判断情况 if (whiteList.indexOf(to.name) > -1) { if (token) { diff --git a/web/src/style/aside.scss b/web/src/style/aside.scss new file mode 100644 index 00000000..658819c3 --- /dev/null +++ b/web/src/style/aside.scss @@ -0,0 +1,146 @@ + +@import '@/style/basics.scss'; + .aside { + background-color: $bg-aside !important; + .el-menu { + border: none; + height: 100%; + background-color: $bg-aside !important; + } + .el-menu-item { + background-color: $bg-aside !important; + color: $aside-title !important; + &:hover{ + background-color: $aside-active !important; + } + &.is-active{ + background-color: $aside-active !important; + box-shadow: 2px 6px 10px 1px,#EBEEF5; + &.is-opend{ + ul{ + border: none; + } + } + } + + } + + + + + + // menu hover + .submenu-title-noDropdown, + .el-submenu__title { + color: $aside-title !important; + &:hover { + background-color: $aside-hover !important; + } + } + + .is-active>.el-submenu__title { + color: $aside-title-active !important; + } + + & .nest-menu .el-submenu>.el-submenu__title, + & .el-submenu .el-menu-item { + color: $aside-title !important; + background-color: $bg-aside !important; + + &:hover { + background-color: $aside-hover !important; + } + &.is-active{ + background-color:$aside-active !important; + } + } + } + + .hideSidebar { + .sidebar-container { + width: 54px !important; + } + + .main-container { + margin-left: 54px; + } + + .submenu-title-noDropdown { + padding: 0 !important; + position: relative; + + .el-tooltip { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + } + } + + .el-submenu { + overflow: hidden; + + &>.el-submenu__title { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + + .el-submenu__icon-arrow { + display: none; + } + } + } + + .el-menu--collapse { + .el-submenu { + &>.el-submenu__title { + &>span { + height: 0; + width: 0; + overflow: hidden; + visibility: hidden; + display: inline-block; + } + } + } + } + } + + // when menu collapsed + .el-menu--vertical { + &>.el-menu { + .svg-icon { + margin-right: 16px; + } + } + + .nest-menu .el-submenu>.el-submenu__title, + .el-menu-item { + &:hover { + // you can use $subMenuHover + background-color: #3788ee !important; + } + } + + // the scroll bar appears when the subMenu is too long + >.el-menu--popup { + max-height: 100vh; + overflow-y: auto; + + &::-webkit-scrollbar-track-piece { + background: $aside-hover; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + } + } + + } \ No newline at end of file diff --git a/web/src/style/main.scss b/web/src/style/main.scss index 2789fd36..2dc458dd 100644 --- a/web/src/style/main.scss +++ b/web/src/style/main.scss @@ -7,7 +7,7 @@ * 2. Prevent adjustments of font size after orientation changes in iOS. */ -@import '@/style/basics.scss'; + @import '@/style/basics.scss'; html { line-height: 1.15; @@ -591,54 +591,7 @@ li { } - .aside { - .el-menu-vertical { - background-color: $bg-aside; - } - .el-submenu { - background-color: $bg-aside; - .el-menu { - .el-menu-item { - background-color: #000408; - height: 44px; - line-height: 44px; - } - .is-active { - background-color: #1890ff; - // 关闭三级菜单二级菜单样式 - ul{ - border:none; - } - } - // 关闭三级菜单二级菜单样式 - .is-active.is-opened{ - background-color: #191a23; - ul{ - border:none; - } - } - } - } - .el-menu-item:focus, .el-menu-item:hover{ - background-color: transparent; - } - .el-menu-item:hover i, - .el-menu-item:hover span { - color: #fff; - } - - .el-submenu__title:hover { - background-color: $bg-aside; - } - .el-submenu__title:hover i, - .el-submenu__title:hover span { - color: #fff; - } - .el-menu--inline { - border-left: 5px solid #2c3b41; - } - } .hideside { .aside { diff --git a/web/src/utils/page.js b/web/src/utils/page.js new file mode 100644 index 00000000..dddad4a7 --- /dev/null +++ b/web/src/utils/page.js @@ -0,0 +1,9 @@ + +const title = 'GIN-VUE-ADMIN' + +export default function getPageTitle(pageTitle) { + if (pageTitle) { + return `${pageTitle} - ${title}` + } + return `${title}` +} diff --git a/web/src/view/layout/aside/historyComponent/history.vue b/web/src/view/layout/aside/historyComponent/history.vue index 0e96f20e..0e93e760 100644 --- a/web/src/view/layout/aside/historyComponent/history.vue +++ b/web/src/view/layout/aside/historyComponent/history.vue @@ -19,6 +19,7 @@