Commit 41cf52c1 by liimin

面包屑调整

1 parent 250cae90
<template>
<div class="com-bc3">
<div class="back-wrap" v-show="page.isShowBack" @click="$router.back()">
<i class="i i-back"></i>
<span class="back-text">返回</span>
<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" :key="item.id" :class="isLink(item) ? 'isLink' : 'noLink'">{{ item.title }}</el-breadcrumb-item>
</el-breadcrumb>
</div>
</div>
</template>
<script>
import { Breadcrumb, BreadcrumbItem } from 'element-ui'
import { mapGetters } from 'vuex'
import { utils } from 'glsx-common'
export default {
name: 'GLBreadcrumb3',
components: {
[Breadcrumb.name]: Breadcrumb,
[BreadcrumbItem.name]: BreadcrumbItem
},
computed: {
page() {
const { id, hidden, title: pageTitle = '' } = this.app.currentPage || {}
const isShowBack = id?.split('-').length > 2 && hidden
const title = decodeURI(pageTitle)
return { isShowBack, title }
},
breadcrumbs() {
const { currentPage, menuList: menus } = this.app
if (!currentPage || !menus || !menus.length) return []
const { id: curId, title, navIds = curId.split('-'), curTitle = decodeURI(title) } = currentPage
return navIds.reduce((navs, next) => {
const { length, nextId = length ? `${navs[length - 1].id}-${next}` : next } = navs
const [menu] = utils.array.valInDeep(this.app.menuList, nextId, 'id', 'children') || []
const { id, title, path, titleLogic = nextId === curId ? curTitle : title } = menu
navs.push({ id, title: titleLogic, path })
return navs
}, [])
},
isNotHome() {
const { currentPage } = this.app
return currentPage && currentPage.path !== this.auth.session.defaultPath
},
...mapGetters(['app', 'auth'])
},
methods: {
isLink({ path }) {
return path.startsWith('/') && !path.includes('@')
}
}
}
</script>
<style lang="scss" scoped>
$bread-item-color: #333 !important;
.com-bc3 {
display: flex;
align-items: center;
font-weight: 600;
.back-wrap {
font-size: 12px;
color: $bread-item-color;
cursor: pointer;
i {
margin-right: 4px;
}
.sprator {
margin: 0 8px;
color: #c3c3c3;
}
}
.page-title {
font-size: 14px;
color: $bread-item-color;
}
/deep/.el-breadcrumb {
&__item {
.el-breadcrumb__inner {
color: $bread-item-color;
font-weight: 500;
cursor: default !important;
}
.el-breadcrumb__separator {
color: $bread-item-color;
font-weight: 500 !important;
}
&:last-child {
.el-breadcrumb__inner {
text-decoration: none !important;
font-weight: 700 !important;
color: $main-color !important;
cursor: default !important;
}
}
&.isLink {
.el-breadcrumb__inner {
&:hover {
text-decoration: underline;
cursor: pointer !important;
}
}
}
}
}
}
</style>
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}, },
methods: { methods: {
mouseleave: function () { mouseleave: function () {
!this.menu.isCollapse && this.bus.$emit('menuChanged', { isReload: true }) // !this.menu.isCollapse && this.bus.$emit('menuChanged', { isReload: true })
} }
} }
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<script> <script>
import { currentId } from './mixins/index' import { currentId } from './mixins/index'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: 'LeftSideMenuLv2', name: 'LeftSideMenuLv2',
mixins: [currentId], mixins: [currentId],
......
...@@ -115,7 +115,7 @@ $active-background-color: rgba(88, 80, 255, 0.2) !important; ...@@ -115,7 +115,7 @@ $active-background-color: rgba(88, 80, 255, 0.2) !important;
} }
} }
span { span {
font-size: 16px; font-size: 15px;
color: #444; color: #444;
font-weight: 600; font-weight: 600;
} }
......
<template> <template>
<div class="scrm-base-nav flex-row"> <div class="scrm-base-nav flex-row">
<div class="flex-1 none-border nav-left"> <div class="flex-1 none-border nav-left">
<GLBreadcrumb2></GLBreadcrumb2> <GLBreadcrumb3></GLBreadcrumb3>
</div> </div>
<div class="flex-row flex-items-center nav-right"> <div class="flex-row flex-items-center nav-right">
<template v-if="$config.productCode !== 'PC0008'"> <template v-if="$config.productCode !== 'PC0008'">
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
z-index: 1; z-index: 1;
flex: 0 0 $menu-width; flex: 0 0 $menu-width;
text-align: left; text-align: left;
transition: flex 0.1s; transition: flex 0.08s;
// box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); // box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
} }
&-right { &-right {
......
...@@ -3,7 +3,7 @@ const menu = { ...@@ -3,7 +3,7 @@ const menu = {
state: () => ({ state: () => ({
hoverId: '', hoverId: '',
openId: '', openId: '',
isCollapse: false isCollapse: true
}), }),
mutations: { mutations: {
SET_HOVER_ID(state, id) { SET_HOVER_ID(state, id) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!