Commit dead196b by liimin

menu css

1 parent 8f400269

1.22 KB | W: | H:

642 Bytes | W: | H:

src/assets/images/icons-v2/avatar.png
src/assets/images/icons-v2/avatar.png
src/assets/images/icons-v2/avatar.png
src/assets/images/icons-v2/avatar.png
  • 2-up
  • Swipe
  • Onion skin

308 Bytes | W: | H:

269 Bytes | W: | H:

src/assets/images/icons-v2/back.png
src/assets/images/icons-v2/back.png
src/assets/images/icons-v2/back.png
src/assets/images/icons-v2/back.png
  • 2-up
  • Swipe
  • Onion skin

551 Bytes | W: | H:

582 Bytes | W: | H:

src/assets/images/icons-v2/contact.png
src/assets/images/icons-v2/contact.png
src/assets/images/icons-v2/contact.png
src/assets/images/icons-v2/contact.png
  • 2-up
  • Swipe
  • Onion skin

444 Bytes | W: | H:

540 Bytes | W: | H:

src/assets/images/icons-v2/message.png
src/assets/images/icons-v2/message.png
src/assets/images/icons-v2/message.png
src/assets/images/icons-v2/message.png
  • 2-up
  • Swipe
  • Onion skin

53.4 KB | W: | H:

52.4 KB | W: | H:

src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -14,4 +14,12 @@ ...@@ -14,4 +14,12 @@
background-color: #EDECFF !important; background-color: #EDECFF !important;
border-bottom: none; border-bottom: none;
} }
@mixin menu-title-span-haspage{
font-size: 15px;
color: #333;
font-weight: 500;
}
@mixin menu-title-hover{
background-color: #f0f1f7 !important;
border-radius: 4px;
}
<template> <template>
<div class="com-bc3"> <div class="com-bc3">
<div class="back-wrap" v-show="breadcrumbs.isShowBack" @click="$router.back()"> <div class="back-wrap" v-show="breadcrumbs.isShowBack" @click="$router.back()">
<i class="i i-back"></i> <div class="bt-back-wrap">
<span class="back-text">返回</span> <i class="i i-back"></i>
<span class="back-text">返回</span>
</div>
<span class="sprator">|</span> <span class="sprator">|</span>
</div> </div>
<div class="page-title"> <div class="page-title">
<el-breadcrumb separator="/" v-if="auth.session"> <el-breadcrumb separator="/" v-if="auth.session">
<el-breadcrumb-item :to="{ path: ['', item.path][+isLink(item)] }" v-for="item in breadcrumbs.breads" :key="item.id" :class="{ isLink: isLink(item) }">{{ item.title }}</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: ['', item.path][+isLink(item)] }" v-for="item in breadcrumbs.breads" :key="item.id" :class="{ isLink: isLink(item) }">{{ item.title + item.path }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
</div> </div>
...@@ -27,7 +29,7 @@ export default { ...@@ -27,7 +29,7 @@ export default {
breadcrumbs() { breadcrumbs() {
const { currentPage, menuList: menus } = this.app const { currentPage, menuList: menus } = this.app
if (!currentPage || !menus?.length) return [] if (!currentPage || !menus?.length) return []
const { id: curId, title, navIds = curId.split('-'), curTitle = decodeURI(title), hidden } = currentPage const { id: curId, title, navIds = curId.split('-'), curTitle = decodeURI(title) } = currentPage
const breads = navIds.reduce((navs, next) => { const breads = navIds.reduce((navs, next) => {
const { length, nextId = length ? `${navs[length - 1].id}-${next}` : next } = navs const { length, nextId = length ? `${navs[length - 1].id}-${next}` : next } = navs
const [menu] = utils.array.valInDeep(menus, nextId, 'id', 'children') const [menu] = utils.array.valInDeep(menus, nextId, 'id', 'children')
...@@ -35,14 +37,14 @@ export default { ...@@ -35,14 +37,14 @@ export default {
navs.push({ id, title: titleLogic, path }) navs.push({ id, title: titleLogic, path })
return navs return navs
}, []) }, [])
const isShowBack = curId?.split('-').length > 2 && hidden // const isShowBack = curId?.split('-').length > 2 && hidden
return { breads, isShowBack } return { breads, isShowBack: true }
}, },
...mapGetters(['app', 'auth']) ...mapGetters(['app', 'auth'])
}, },
methods: { methods: {
isLink({ path }) { isLink({ path }) {
return path.startsWith('/') && !path.includes('@') return path.startsWith('/') && !path.startsWith('/^') && !path.includes('@')
} }
} }
} }
...@@ -57,6 +59,8 @@ $bread-item-color: #333 !important; ...@@ -57,6 +59,8 @@ $bread-item-color: #333 !important;
font-size: 12px; font-size: 12px;
color: $bread-item-color; color: $bread-item-color;
cursor: pointer; cursor: pointer;
display: flex;
align-items: center;
i { i {
margin-right: 4px; margin-right: 4px;
} }
...@@ -64,6 +68,23 @@ $bread-item-color: #333 !important; ...@@ -64,6 +68,23 @@ $bread-item-color: #333 !important;
margin: 0 8px; margin: 0 8px;
color: #c3c3c3; color: #c3c3c3;
} }
.bt-back-wrap {
width: 52px;
height: 20px;
line-height: 20px;
background: #f2f2f2;
border-radius: 10px;
.back-text {
font-weight: 400;
color: #666;
}
&:hover {
background: #e8e8e8;
.back-text {
color: #333;
}
}
}
} }
/deep/.el-breadcrumb { /deep/.el-breadcrumb {
&__item { &__item {
......
<template> <template>
<div :class="['com-left-side-menu-lv1-item', isHighlight ? 'highlight' : '']" @mouseenter.stop="mouseenter" @mouseleave.stop="mouseleave" @click.stop="handleClick()"> <div :class="['com-left-side-menu-lv1-item', isActive]" @mouseenter.stop="mouseenter" @mouseleave.stop="mouseleave" @click.stop="handleClick()">
<i :class="['i', icon]"></i> <i :class="['i', icon]"></i>
<span class="title">{{ menuData.title }}</span> <span class="title">{{ menuData.title }}</span>
</div> </div>
...@@ -25,7 +25,15 @@ export default { ...@@ -25,7 +25,15 @@ export default {
return `i-${this.menuData.icon}${['', '-active'][+this.isHighlight]}` return `i-${this.menuData.icon}${['', '-active'][+this.isHighlight]}`
}, },
isHighlight() { isHighlight() {
return this.app?.currentPage?.id?.split('-')[0] == this.menuData.id || this.menu.hoverId == this.menuData.id return this.app?.currentPage?.id?.split('-')[0] == this.menuData.id
},
isActive() {
if (this.isHighlight) {
return 'highlight'
} else if (this.menu.hoverId == this.menuData.id) {
return 'hover'
}
return ''
} }
}, },
methods: { methods: {
...@@ -64,6 +72,9 @@ export default { ...@@ -64,6 +72,9 @@ export default {
color: $main-color; color: $main-color;
} }
} }
&.hover {
background-color: #f0f1f7;
}
.title { .title {
font-size: 10px; font-size: 10px;
color: #666; color: #666;
......
<template> <template>
<div class="com-left-side-menu-lv2"> <div class="com-left-side-menu-lv2">
<GLScroll class="com-left-side-menu-lv2-scroll-y"> <GLScroll class="com-left-side-menu-lv2-scroll-y">
<el-menu class="flex-1 none-border" background-color="#fff" active-text-color="#409EFF" text-color="#999" :default-openeds="cur.openeds" :default-active="cur.active" :collapse-transition="false"> <el-menu class="flex-1 none-border" background-color="#fff" active-text-color="#409EFF" text-color="#999" :default-openeds="cur.openeds" :default-active="cur.active" :collapse-transition="false" ref="menus" @close="handleClose">
<LeftSideMenuLv2Item></LeftSideMenuLv2Item> <LeftSideMenuLv2Item></LeftSideMenuLv2Item>
</el-menu> </el-menu>
</GLScroll> </GLScroll>
...@@ -55,6 +55,9 @@ export default { ...@@ -55,6 +55,9 @@ export default {
}) })
if (this.cur.openeds.toString() == _ids.toString()) return if (this.cur.openeds.toString() == _ids.toString()) return
this.cur.openeds = _ids this.cur.openeds = _ids
},
handleClose(key, keyPath) {
this.$refs.menus.open(keyPath)
} }
} }
} }
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<div v-for="item in menus" :key="item.id"> <div v-for="item in menus" :key="item.id">
<!-- 没有三级级菜单的二级菜单 --> <!-- 没有三级级菜单的二级菜单 -->
<div class="el-submenu" :class="{ active: `${current.lv1}-${current.lv2}` == item.id }" v-if="isMenuNoChildren(item)" @click.stop="handleModuleClick(item)"> <div class="el-submenu" :class="{ active: `${current.lv1}-${current.lv2}` == item.id }" v-if="isMenuNoChildren(item)" @click.stop="handleModuleClick(item)">
<div class="el-submenu__title"> <div class="el-submenu__title hasNoChild">
<span>{{ item.title }}</span> <span>{{ item.title }}</span>
</div> </div>
</div> </div>
<!-- 有三级菜单的二级菜单 --> <!-- 有三级菜单的二级菜单 -->
<el-submenu v-else :index="item.id"> <el-submenu v-else :index="item.id">
<span slot="title">{{ item.title }}</span> <span slot="title" class="weaken">{{ item.title }}</span>
<!-- 渲染三级菜单 --> <!-- 渲染三级菜单 -->
<LeftSideMenuLv3 :menuItems="item.children"></LeftSideMenuLv3> <LeftSideMenuLv3 :menuItems="item.children"></LeftSideMenuLv3>
</el-submenu> </el-submenu>
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
this.bus.$emit('menuOpenedsChanged', { menus }) this.bus.$emit('menuOpenedsChanged', { menus })
}, },
reload() { reload() {
if (this.menu.isCollapse || this.isPop ) return if (this.menu.isCollapse || this.isPop) return
const { lv1 } = this.current const { lv1 } = this.current
const [pid] = this.menus[0]?.id.split('-') || [] const [pid] = this.menus[0]?.id.split('-') || []
if (lv1 == pid) return if (lv1 == pid) return
...@@ -108,31 +108,37 @@ $active-background-color: rgba(88, 80, 255, 0.2) !important; ...@@ -108,31 +108,37 @@ $active-background-color: rgba(88, 80, 255, 0.2) !important;
line-height: 36px; line-height: 36px;
background-color: transparent !important; background-color: transparent !important;
padding: 0 8px !important; padding: 0 8px !important;
&:hover {
// background-color: #fff !important;
span,
i {
color: $main-color !important;
}
}
span { span {
font-size: 15px; @include menu-title-span-haspage;
color: #444;
font-weight: 600;
} }
.el-submenu__icon-arrow { .el-submenu__icon-arrow {
right: 0; // right: 0;
visibility: hidden;
} }
} &:not(.hasNoChild) {// has children title
&.is-active { cursor: default !important;
.el-submenu__title { border-bottom: 1px solid #eee;
background-color: transparent !important; margin-bottom: 1px;
span, span {
i { font-size: 13px !important;
color: $main-color !important; color: #999 !important;
font-weight: 400 !important;
cursor: default !important;
} }
} }
&.hasNoChild:hover {
@include menu-title-hover;
}
} }
// &.is-active {
// .el-submenu__title {
// background-color: transparent !important;
// span,
// i {
// color: $main-color !important;
// }
// }
// }
&.active { &.active {
@include menu-highlight; @include menu-highlight;
span { span {
......
...@@ -39,20 +39,19 @@ $menu-item-width: 144px !important; ...@@ -39,20 +39,19 @@ $menu-item-width: 144px !important;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 1px;
.el-menu-item { .el-menu-item {
width: 100% !important; width: 100% !important;
min-width: 100% !important; min-width: 100% !important;
height: 32px; height: 36px;
line-height: 32px; line-height: 36px;
align-self: center; align-self: center;
border-radius: 4px; border-radius: 4px;
// padding-left: 0 !important; // padding-left: 0 !important;
padding: 0 8px !important; padding: 0 8px !important;
span { span {
color: #666; @include menu-title-span-haspage
font-size: 14px;
} }
&:hover,
&.is-active { &.is-active {
@include menu-highlight; @include menu-highlight;
span { span {
...@@ -60,7 +59,7 @@ $menu-item-width: 144px !important; ...@@ -60,7 +59,7 @@ $menu-item-width: 144px !important;
} }
} }
&:hover:not(.is-active) { &:hover:not(.is-active) {
background-color: transparent !important; @include menu-title-hover;
} }
} }
} }
......
...@@ -261,7 +261,7 @@ $tip-color: #666 !important; ...@@ -261,7 +261,7 @@ $tip-color: #666 !important;
margin: 0 4px; margin: 0 4px;
} }
&-avatar { &-avatar {
margin-left: 8px; margin-left: 2px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
......
...@@ -143,7 +143,7 @@ function __gen(moduleName, menu) { ...@@ -143,7 +143,7 @@ function __gen(moduleName, menu) {
} }
if (path.includes('^')) { if (path.includes('^')) {
// const [originPath] = path.split('^') // const [originPath] = path.split('^')
_path = _gen_path_() + id _path = '^'//_gen_path_() + id
redirect = _gen_path_(children.noHidden()[0].path) redirect = _gen_path_(children.noHidden()[0].path)
} else { } else {
_path = _gen_path_() _path = _gen_path_()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!