diff --git a/web/src/App.vue b/web/src/App.vue index 4564d38a1161652fe7653b78cf8c7f38ab83792f..4a4bb2345673e15747b3936dd5d0b6712c90a5c7 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -16,6 +16,7 @@ export default { @import '@/style/main.scss'; @import '@/style/base.scss'; @import '@/style/mobile.scss'; +@import '@/style/aside.scss'; #app { background: #eee; height: 100vh; diff --git a/web/src/permission.js b/web/src/permission.js index 48a7dc5f1f24cd4c30014444557898444e49e440..989b1aa4fc067c7bf387bc1330f246aa0d6ce7e5 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 0000000000000000000000000000000000000000..658819c3f4089cc2211158a6f3bfecafd6ded9a6 --- /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/basics.scss b/web/src/style/basics.scss index 767a99e5ccf6c39016992ad4cfdbbafaffae6367..5845d92ed495df76073c703caf9611088343b5fc 100644 --- a/web/src/style/basics.scss +++ b/web/src/style/basics.scss @@ -14,10 +14,16 @@ $width-mobile-aside:210px; $color-aside:rgba(255, 255, 255,.9); $icon-arrow-size-aside:12px; $width-submenu-aside:55px; -$bg-aside:#191a23; + $height-aside-tilte:64px; $height-aside-img:30px; $width-aside-img:30px; + +$bg-aside:#191a23; +$aside-active:#4facfe; +$aside-hover:#595959; +$aside-title:#fff; +$aside-title-active:#4facfe; // header $height-header: 60px; // nav-scroll diff --git a/web/src/style/main.scss b/web/src/style/main.scss index 2789fd3655b1b923b209ae2e5f974d55be9c398a..2dc458dd1955f5734a2ac3976c8cdb6187328964 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 0000000000000000000000000000000000000000..dddad4a77a579c84b3659bd040ad1e12e250b518 --- /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 0e96f20ed3742a098568639a9f072153a39279e7..0e93e7603e7e55ea0349017658d1a551db149b1c 100644 --- a/web/src/view/layout/aside/historyComponent/history.vue +++ b/web/src/view/layout/aside/historyComponent/history.vue @@ -19,6 +19,7 @@