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
.i { display: inline-block; vertical-align: middle; background-image: url(./sprite.png) }
.i-activityCenter-active { width: 20px; height: 20px; background-position: -42px 0px; }
.i-activityCenter { width: 20px; height: 20px; background-position: 0px -42px; }
.i-appreciation-active { width: 20px; height: 20px; background-position: -30px -42px; }
.i-appreciation { width: 20px; height: 20px; background-position: -72px 0px; }
.i-arrow-down { width: 20px; height: 20px; background-position: -72px -30px; }
.i-authorize-active { width: 20px; height: 20px; background-position: 0px -72px; }
.i-authorize { width: 20px; height: 20px; background-position: -30px -72px; }
.i-avatar { width: 32px; height: 32px; background-position: 0px 0px; }
.i-back { width: 10px; height: 10px; background-position: -252px -220px; }
.i-checked { width: 20px; height: 20px; background-position: -60px -72px; }
.i-commodity-active { width: 20px; height: 20px; background-position: -102px 0px; }
.i-commodity { width: 20px; height: 20px; background-position: -102px -30px; }
.i-contact { width: 16px; height: 16px; background-position: -252px -120px; }
.i-content-active { width: 20px; height: 20px; background-position: -102px -60px; }
.i-content { width: 20px; height: 20px; background-position: 0px -102px; }
.i-coupon-active { width: 20px; height: 20px; background-position: -30px -102px; }
.i-coupon { width: 20px; height: 20px; background-position: -60px -102px; }
.i-custom-active { width: 20px; height: 20px; background-position: -90px -102px; }
.i-custom { width: 20px; height: 20px; background-position: -132px 0px; }
.i-default-active { width: 20px; height: 20px; background-position: -132px -30px; }
.i-default { width: 20px; height: 20px; background-position: -132px -60px; }
.i-discover-active { width: 20px; height: 20px; background-position: -132px -90px; }
.i-discover { width: 20px; height: 20px; background-position: 0px -132px; }
.i-dot { width: 12px; height: 12px; background-position: -252px -198px; }
.i-edit-active { width: 20px; height: 20px; background-position: -30px -132px; }
.i-edit { width: 20px; height: 20px; background-position: -60px -132px; }
.i-equity-active { width: 20px; height: 20px; background-position: -90px -132px; }
.i-equity { width: 20px; height: 20px; background-position: -120px -132px; }
.i-exchange-active { width: 20px; height: 20px; background-position: -162px 0px; }
.i-exchange-disabled { width: 20px; height: 20px; background-position: -162px -30px; }
.i-exchange { width: 20px; height: 20px; background-position: -162px -60px; }
.i-finance-active { width: 20px; height: 20px; background-position: -162px -90px; }
.i-finance { width: 20px; height: 20px; background-position: -162px -120px; }
.i-home-active { width: 20px; height: 20px; background-position: 0px -162px; }
.i-home { width: 20px; height: 20px; background-position: -30px -162px; }
.i-inventory-active { width: 20px; height: 20px; background-position: -60px -162px; }
.i-inventory { width: 20px; height: 20px; background-position: -90px -162px; }
.i-left { width: 10px; height: 9px; background-position: 0px -252px; }
.i-link-active { width: 20px; height: 20px; background-position: -120px -162px; }
.i-link { width: 20px; height: 20px; background-position: -150px -162px; }
.i-live-active { width: 20px; height: 20px; background-position: -192px 0px; }
.i-live { width: 20px; height: 20px; background-position: -192px -30px; }
.i-logoff-active { width: 20px; height: 20px; background-position: -192px -60px; }
.i-logoff { width: 20px; height: 20px; background-position: -192px -90px; }
.i-mall-active { width: 20px; height: 20px; background-position: -192px -120px; }
.i-mall { width: 20px; height: 20px; background-position: -192px -150px; }
.i-mapping-active { width: 20px; height: 20px; background-position: 0px -192px; }
.i-mapping { width: 20px; height: 20px; background-position: -30px -192px; }
.i-message-active { width: 16px; height: 16px; background-position: -252px -146px; }
.i-message { width: 16px; height: 16px; background-position: -252px -172px; }
.i-ordermanage-active { width: 20px; height: 20px; background-position: -60px -192px; }
.i-ordermanage { width: 20px; height: 20px; background-position: -90px -192px; }
.i-outbound-active { width: 20px; height: 20px; background-position: -120px -192px; }
.i-outbound { width: 20px; height: 20px; background-position: -150px -192px; }
.i-password { width: 20px; height: 20px; background-position: -180px -192px; }
.i-provider-active { width: 20px; height: 20px; background-position: -222px 0px; }
.i-provider { width: 20px; height: 20px; background-position: -222px -30px; }
.i-purchase-active { width: 20px; height: 20px; background-position: -222px -60px; }
.i-purchase { width: 20px; height: 20px; background-position: -222px -90px; }
.i-right { width: 8px; height: 8px; background-position: -20px -252px; }
.i-salepre-active { width: 20px; height: 20px; background-position: -222px -120px; }
.i-salepre { width: 20px; height: 20px; background-position: -222px -150px; }
.i-scene-active { width: 20px; height: 20px; background-position: -222px -180px; }
.i-scene { width: 20px; height: 20px; background-position: 0px -222px; }
.i-settings-active { width: 20px; height: 20px; background-position: -30px -222px; }
.i-settings { width: 20px; height: 20px; background-position: -60px -222px; }
.i-shop-active { width: 20px; height: 20px; background-position: -90px -222px; }
.i-shop { width: 20px; height: 20px; background-position: -120px -222px; }
.i-store-active { width: 20px; height: 20px; background-position: -150px -222px; }
.i-store { width: 20px; height: 20px; background-position: -180px -222px; }
.i-subscription-active { width: 20px; height: 20px; background-position: -210px -222px; }
.i-subscription { width: 20px; height: 20px; background-position: -252px 0px; }
.i-tools-active { width: 20px; height: 20px; background-position: -252px -30px; }
.i-tools { width: 20px; height: 20px; background-position: -252px -60px; }
.i-user { width: 20px; height: 20px; background-position: -252px -90px; }
\ No newline at end of file
.i-activityCenter-active { width: 20px; height: 20px; background-position: 0px 0px; }
.i-activityCenter { width: 20px; height: 20px; background-position: -30px 0px; }
.i-appreciation-active { width: 20px; height: 20px; background-position: 0px -30px; }
.i-appreciation { width: 20px; height: 20px; background-position: -30px -30px; }
.i-arrow-down { width: 20px; height: 20px; background-position: -60px 0px; }
.i-authorize-active { width: 20px; height: 20px; background-position: -60px -30px; }
.i-authorize { width: 20px; height: 20px; background-position: 0px -60px; }
.i-avatar { width: 16px; height: 16px; background-position: -240px -90px; }
.i-back { width: 12px; height: 12px; background-position: -240px -194px; }
.i-checked { width: 20px; height: 20px; background-position: -30px -60px; }
.i-commodity-active { width: 20px; height: 20px; background-position: -60px -60px; }
.i-commodity { width: 20px; height: 20px; background-position: -90px 0px; }
.i-contact { width: 16px; height: 16px; background-position: -240px -116px; }
.i-content-active { width: 20px; height: 20px; background-position: -90px -30px; }
.i-content { width: 20px; height: 20px; background-position: -90px -60px; }
.i-coupon-active { width: 20px; height: 20px; background-position: 0px -90px; }
.i-coupon { width: 20px; height: 20px; background-position: -30px -90px; }
.i-custom-active { width: 20px; height: 20px; background-position: -60px -90px; }
.i-custom { width: 20px; height: 20px; background-position: -90px -90px; }
.i-default-active { width: 20px; height: 20px; background-position: -120px 0px; }
.i-default { width: 20px; height: 20px; background-position: -120px -30px; }
.i-discover-active { width: 20px; height: 20px; background-position: -120px -60px; }
.i-discover { width: 20px; height: 20px; background-position: -120px -90px; }
.i-dot { width: 12px; height: 12px; background-position: -240px -216px; }
.i-edit-active { width: 20px; height: 20px; background-position: 0px -120px; }
.i-edit { width: 20px; height: 20px; background-position: -30px -120px; }
.i-equity-active { width: 20px; height: 20px; background-position: -60px -120px; }
.i-equity { width: 20px; height: 20px; background-position: -90px -120px; }
.i-exchange-active { width: 20px; height: 20px; background-position: -120px -120px; }
.i-exchange-disabled { width: 20px; height: 20px; background-position: -150px 0px; }
.i-exchange { width: 20px; height: 20px; background-position: -150px -30px; }
.i-finance-active { width: 20px; height: 20px; background-position: -150px -60px; }
.i-finance { width: 20px; height: 20px; background-position: -150px -90px; }
.i-home-active { width: 20px; height: 20px; background-position: -150px -120px; }
.i-home { width: 20px; height: 20px; background-position: 0px -150px; }
.i-inventory-active { width: 20px; height: 20px; background-position: -30px -150px; }
.i-inventory { width: 20px; height: 20px; background-position: -60px -150px; }
.i-left { width: 10px; height: 9px; background-position: 0px -240px; }
.i-link-active { width: 20px; height: 20px; background-position: -90px -150px; }
.i-link { width: 20px; height: 20px; background-position: -120px -150px; }
.i-live-active { width: 20px; height: 20px; background-position: -150px -150px; }
.i-live { width: 20px; height: 20px; background-position: -180px 0px; }
.i-logoff-active { width: 20px; height: 20px; background-position: -180px -30px; }
.i-logoff { width: 20px; height: 20px; background-position: -180px -60px; }
.i-mall-active { width: 20px; height: 20px; background-position: -180px -90px; }
.i-mall { width: 20px; height: 20px; background-position: -180px -120px; }
.i-mapping-active { width: 20px; height: 20px; background-position: -180px -150px; }
.i-mapping { width: 20px; height: 20px; background-position: 0px -180px; }
.i-message-active { width: 16px; height: 16px; background-position: -240px -142px; }
.i-message { width: 16px; height: 16px; background-position: -240px -168px; }
.i-ordermanage-active { width: 20px; height: 20px; background-position: -30px -180px; }
.i-ordermanage { width: 20px; height: 20px; background-position: -60px -180px; }
.i-outbound-active { width: 20px; height: 20px; background-position: -90px -180px; }
.i-outbound { width: 20px; height: 20px; background-position: -120px -180px; }
.i-password { width: 20px; height: 20px; background-position: -150px -180px; }
.i-provider-active { width: 20px; height: 20px; background-position: -180px -180px; }
.i-provider { width: 20px; height: 20px; background-position: -210px 0px; }
.i-purchase-active { width: 20px; height: 20px; background-position: -210px -30px; }
.i-purchase { width: 20px; height: 20px; background-position: -210px -60px; }
.i-right { width: 8px; height: 8px; background-position: -20px -240px; }
.i-salepre-active { width: 20px; height: 20px; background-position: -210px -90px; }
.i-salepre { width: 20px; height: 20px; background-position: -210px -120px; }
.i-scene-active { width: 20px; height: 20px; background-position: -210px -150px; }
.i-scene { width: 20px; height: 20px; background-position: -210px -180px; }
.i-settings-active { width: 20px; height: 20px; background-position: 0px -210px; }
.i-settings { width: 20px; height: 20px; background-position: -30px -210px; }
.i-shop-active { width: 20px; height: 20px; background-position: -60px -210px; }
.i-shop { width: 20px; height: 20px; background-position: -90px -210px; }
.i-store-active { width: 20px; height: 20px; background-position: -120px -210px; }
.i-store { width: 20px; height: 20px; background-position: -150px -210px; }
.i-subscription-active { width: 20px; height: 20px; background-position: -180px -210px; }
.i-subscription { width: 20px; height: 20px; background-position: -210px -210px; }
.i-tools-active { width: 20px; height: 20px; background-position: -240px 0px; }
.i-tools { width: 20px; height: 20px; background-position: -240px -30px; }
.i-user { width: 20px; height: 20px; background-position: -240px -60px; }
\ No newline at end of file

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