CN-980 fix: 实体详情增加顶部菜单和面包屑
This commit is contained in:
@@ -289,7 +289,7 @@ export default {
|
||||
return this.$store.getters.menuList.find(menu => menu.code === 'networkAnalytics')
|
||||
},
|
||||
otherMenu () {
|
||||
return this.$store.getters.menuList.filter(menu => ['networkAnalytics', 'chart', 'I18N'].indexOf(menu.code) === -1)
|
||||
return this.$store.getters.menuList.filter(menu => ['networkAnalytics', 'chart', 'I18N', 'entityDetail', 'temp'].indexOf(menu.code) === -1)
|
||||
|
||||
/* function excludeButton (menu) {
|
||||
for (let i = 0; i < menu.length; i++) {
|
||||
@@ -392,6 +392,23 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
generateBreadcrumb (breadcrumb, menus) {
|
||||
if (this.route === '/entityDetail') {
|
||||
const entityMenu = menus.find(m => m.route === '/entityExplorer')
|
||||
const entityDetailMenu = menus.find(m => m.route === '/entityDetail')
|
||||
breadcrumb.push({
|
||||
code: entityMenu.code,
|
||||
value: entityMenu.i18n ? this.$t(entityMenu.i18n) : entityMenu.name,
|
||||
route: entityMenu.route,
|
||||
type: entityMenu.type
|
||||
})
|
||||
breadcrumb.push({
|
||||
code: entityDetailMenu.code,
|
||||
value: entityDetailMenu.i18n ? this.$t(entityDetailMenu.i18n) : entityDetailMenu.name,
|
||||
route: entityDetailMenu.route,
|
||||
type: entityDetailMenu.type
|
||||
})
|
||||
return true
|
||||
}
|
||||
const menu = menus.find(m => m.route === this.route)
|
||||
if (menu) {
|
||||
breadcrumb.unshift({
|
||||
|
||||
@@ -7,7 +7,7 @@ import { storageKey } from '@/utils/constants'
|
||||
import { loadI18n } from '@/i18n'
|
||||
|
||||
const loginWhiteList = ['/login', '/'] // 免登陆白名单
|
||||
const permissionWhiteList = [...loginWhiteList, '/entityDetail'] // 权限白名单
|
||||
const permissionWhiteList = [...loginWhiteList] // 权限白名单
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
if (to.path.indexOf('/login') == -1) {
|
||||
|
||||
@@ -6,10 +6,6 @@ const routes = [
|
||||
path: '/login',
|
||||
component: () => import('@/Login')
|
||||
},
|
||||
{
|
||||
path: '/entityDetail',
|
||||
component: () => import('@/views/entityExplorer/EntityDetail')
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: () => import('@/components/layout/Home'),
|
||||
@@ -27,6 +23,10 @@ const routes = [
|
||||
path: '/entityExplorer',
|
||||
component: () => import('@/views/entityExplorer/EntityExplorer')
|
||||
},
|
||||
{
|
||||
path: '/entityDetail',
|
||||
component: () => import('@/views/entityExplorer/EntityDetail')
|
||||
},
|
||||
{
|
||||
path: '/detection',
|
||||
redirect: '/detection/securityEvent'
|
||||
|
||||
@@ -79,9 +79,6 @@ export default {
|
||||
if (entityType !== 'app') {
|
||||
tabs.unshift({ name: entityDetailTabsName.informationAggregation, label: i18n.global.t('entities.informationAggregation'), icon: 'cn-icon cn-icon-information-aggregation' })
|
||||
}
|
||||
if (entityType === 'domain') {
|
||||
tabs.splice(2, 0, { name: entityDetailTabsName.subdomain, label: i18n.global.t('entities.subdomain'), icon: 'cn-icon cn-icon-sub-type' })
|
||||
}
|
||||
const activeTab = ref(tabs[0].name)
|
||||
|
||||
const { query } = useRoute()
|
||||
|
||||
Reference in New Issue
Block a user