Browse Source

增加面包屑右侧内容显示

pull/63/head
zq 5 days ago
parent
commit
b5292dead5
  1. 19
      src/components/Breadcrumb.vue
  2. 17
      src/router/index.js
  3. 9
      src/store/index.js

19
src/components/Breadcrumb.vue

@ -1,5 +1,5 @@
<template> <template>
<div v-if="breadcrumbs.length > 0" class="breadcrumb-container"> <div v-if="breadcrumbs.length > 0" class="breadcrumb-container flex-between">
<nav> <nav>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li v-for="(item, index) in breadcrumbs" :key="index" class="breadcrumb-item" <li v-for="(item, index) in breadcrumbs" :key="index" class="breadcrumb-item"
@ -18,11 +18,17 @@
</li> </li>
</ol> </ol>
</nav> </nav>
<div v-if="breadRightText" class="gap8 breadRight">
<img class="ml-8" src="@/assets/site/bind_sites.svg" alt="" />
站点简称<a :href="breadRightText">{{ breadRightText }}</a>
</div>
</div> </div>
</template> </template>
<script> <script>
import SvgIcon1 from '@/components/SvgIcon1.vue'; import SvgIcon1 from '@/components/SvgIcon1.vue';
import { mapState } from 'vuex';
export default { export default {
name: 'Breadcrumb', name: 'Breadcrumb',
components: { components: {
@ -53,7 +59,9 @@ export default {
} }
return crumbs return crumbs
} },
...mapState(['breadRightText']) // VuexshowSidebar
}, },
methods: { methods: {
getTitle(route) { getTitle(route) {
@ -69,6 +77,13 @@ export default {
padding: 16px 12px; padding: 16px 12px;
background-color: #f5f5f5; background-color: #f5f5f5;
border-radius: 4px; border-radius: 4px;
.breadRight{
a{
text-decoration: none;
color: #006AFF;
}
}
} }
.home-icon{ .home-icon{
width: 16px; width: 16px;

17
src/router/index.js

@ -100,14 +100,14 @@ const routes = [{
breadcrumbParent: '站点列表' // 手动指定父级 breadcrumbParent: '站点列表' // 手动指定父级
} }
}, },
{ // {
path: '/agent/SitePersonalization', // path: '/agent/SitePersonalization',
name: '个性化设置', // name: '个性化设置',
// route level code-splitting // // route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route // // this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited. // // which is lazy-loaded when the route is visited.
component: () => import( /* webpackChunkName: "siteList" */ '../views/agent/SitePersonalization.vue') // component: () => import( /* webpackChunkName: "siteList" */ '../views/agent/SitePersonalization.vue')
}, // },
{ {
path: '/agent/payList', path: '/agent/payList',
isFirst: true, isFirst: true,
@ -399,6 +399,7 @@ router.beforeEach((to, from, next) => {
} else { } else {
store.commit('SET_HEADER', true); // 其他页面显示顶部 store.commit('SET_HEADER', true); // 其他页面显示顶部
} }
store.commit('SET_BREADRIGHTTEXT', '')//清空面包屑右侧内容
store.dispatch('showLoading') store.dispatch('showLoading')
next(); next();
}); });

9
src/store/index.js

@ -10,6 +10,7 @@ export default new Vuex.Store({
showHeader: false, showHeader: false,
menuList: [], //目录菜单 menuList: [], //目录菜单
showBreadcrumb: false, //是否展示面包屑 showBreadcrumb: false, //是否展示面包屑
breadRightText: '', //是否展示面包屑
pageTitle: '一般新文献', //页面标题 pageTitle: '一般新文献', //页面标题
addServiceList: [], //选中的服务 addServiceList: [], //选中的服务
isLoading: false, //页面loading isLoading: false, //页面loading
@ -336,6 +337,11 @@ export default new Vuex.Store({
}) { }) {
commit('SHOW_BREAD'); commit('SHOW_BREAD');
}, },
SET_BREADRIGHTTEXT({
commit
}) {
commit('SET_BREADRIGHTTEXT');
},
SET_PAGETITLE({ SET_PAGETITLE({
commit commit
}) { }) {
@ -393,6 +399,9 @@ export default new Vuex.Store({
SHOW_BREAD(state, show) { SHOW_BREAD(state, show) {
state.showBreadcrumb = show; state.showBreadcrumb = show;
}, },
SET_BREADRIGHTTEXT(state, text) {
state.breadRightText = text;
},
SET_PAGETITLE(state, title) { SET_PAGETITLE(state, title) {
state.pageTitle = title; state.pageTitle = title;
}, },

Loading…
Cancel
Save