| | |
| | | let matched = route.matched.filter(item => item.meta && item.meta.title); |
| | | const first = matched[0] |
| | | |
| | | // 不自动添加首页到面包屑中 |
| | | // if (!isDashboard(first)) { |
| | | // matched = [{ path: '/index', meta: { title: '首页' } }].concat(matched) |
| | | // } |
| | | // 添加调试日志 |
| | | console.log('Current route path:', route.path); |
| | | console.log('Route matched:', route.matched); |
| | | console.log('Filtered matched routes:', matched); |
| | | |
| | | // 如果是首页看板路由,确保它被添加到面包屑中 |
| | | if (route.path === '/index' || route.path === '/index/index') { |
| | | matched = [{ path: '/index', meta: { title: '首页看板' } }].concat(matched) |
| | | console.log('Added index route to matched:', matched); |
| | | } |
| | | |
| | | levelList.value = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) |
| | | console.log('Final breadcrumb items:', levelList.value); |
| | | } |
| | | |
| | | function isDashboard(route) { |
| | | const name = route && route.name |
| | | if (!name) { |
| | | return false |
| | | } |
| | | return name.trim() === 'Index' |
| | | return name.trim().toLowerCase() === 'index' |
| | | } |
| | | |
| | | function handleLink(item) { |
| | | const { redirect, path } = item |
| | | if (redirect) { |
| | |
| | | <template> |
| | | <div id="tags-view-container" class="tags-view-container"> |
| | | <div id="tags-view-container" class="tags-view-container" :class="{'theme-dark': sideTheme === 'theme-dark', 'theme-light': sideTheme === 'theme-light'}"> |
| | | <scroll-pane ref="scrollPaneRef" class="tags-view-wrapper" @scroll="handleScroll"> |
| | | <router-link |
| | | v-for="tag in visitedViews" |
| | |
| | | const visitedViews = computed(() => useTagsViewStore().visitedViews) |
| | | const routes = computed(() => usePermissionStore().routes) |
| | | const theme = computed(() => useSettingsStore().theme) |
| | | const sideTheme = computed(() => useSettingsStore().sideTheme) |
| | | |
| | | watch(route, () => { |
| | | addTags() |
| | |
| | | margin-top: 10px; |
| | | margin-left: 14px; |
| | | box-sizing: border-box; |
| | | // 添加水平内边距与app-main的内边距一致 |
| | | background: #0A3465; |
| | | |
| | | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); |
| | | |
| | | &.theme-dark { |
| | | background: #0A3465; |
| | | .tags-view-item { |
| | | color: #fff; |
| | | background: #0c3f79; |
| | | border: 1px solid #0c4685; |
| | | |
| | | &.active { |
| | | background-color: var(--el-color-primary) !important; |
| | | color: #fff !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | &.theme-light { |
| | | background: #fff; |
| | | .tags-view-item { |
| | | color: #495060; |
| | | background: #fff; |
| | | border: 1px solid #d8dce5; |
| | | |
| | | &.active { |
| | | background-color: var(--el-color-primary) !important; |
| | | color: #fff !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .tags-view-wrapper { |
| | | .tags-view-item { |
| | | display: inline-block; |
| | |
| | | cursor: pointer; |
| | | height: 26px; |
| | | line-height: 26px; |
| | | border: 1px solid #d8dce5; |
| | | color: #495060; |
| | | background: #fff; |
| | | padding: 0 8px; |
| | | border-radius: 3px; |
| | | padding: 0 10px; |
| | | font-size: 12px; |
| | | margin-left: 5px; |
| | | margin-top: 4px; |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .contextmenu { |
| | | margin: 0; |
| | | background: #fff; |
| | |
| | | cursor: pointer; |
| | | &:hover { |
| | | background: #eee; |
| | | } |
| | | } |
| | | } |
| | | } |