fix: 还原之前版本

This commit is contained in:
刘洪洪
2024-01-02 11:05:01 +08:00
parent 705572b245
commit 374c66fcff
5 changed files with 47 additions and 83 deletions

View File

@@ -125,7 +125,7 @@
:show-close="false"
>
<div class="cn-menu__left" v-if="otherMenu">
<div class="left-menu" v-for="menu in otherMenu" :key="menu.id" @click="jumpOther(menu.route,'','',0)">
<div class="left-menu" v-for="menu in otherMenu" :key="menu.id" @click="jump(menu.route,'','',0)">
<i :class="menu.icon"></i>
<span>{{ $t(menu.i18n || menu.name) }}</span>
<i class="cn-icon cn-icon-right"></i>
@@ -423,6 +423,39 @@ export default {
},
methods: {
generateBreadcrumb (breadcrumb, menus) {
if (this.route === '/entityDetail') {
const entityMenu = menus.find(m => m.route === '/entity')
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
} else if (this.route === '/entityGraph') {
const entityMenu = menus.find(m => m.route === '/entity')
const entityGraphMenu = menus.find(m => m.route === '/entityGraph')
breadcrumb.push({
code: entityMenu.code,
value: entityMenu.i18n ? this.$t(entityMenu.i18n) : entityMenu.name,
route: entityMenu.route,
type: entityMenu.type
})
breadcrumb.push({
code: entityGraphMenu.code,
value: entityGraphMenu.i18n ? this.$t(entityGraphMenu.i18n) : entityGraphMenu.name,
route: entityGraphMenu.route,
type: entityGraphMenu.type
})
return true
}
const menu = menus.find(m => m.route === this.route)
if (menu) {
breadcrumb.unshift({
@@ -448,65 +481,6 @@ export default {
}
}
},
// generateBreadcrumb (breadcrumb, menus) {
// if (this.route === '/entityDetail') {
// const entityMenu = menus.find(m => m.route === '/entity')
// 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
// } else if (this.route === '/entityGraph') {
// const entityMenu = menus.find(m => m.route === '/entity')
// const entityGraphMenu = menus.find(m => m.route === '/entityGraph')
// breadcrumb.push({
// code: entityMenu.code,
// value: entityMenu.i18n ? this.$t(entityMenu.i18n) : entityMenu.name,
// route: entityMenu.route,
// type: entityMenu.type
// })
// breadcrumb.push({
// code: entityGraphMenu.code,
// value: entityGraphMenu.i18n ? this.$t(entityGraphMenu.i18n) : entityGraphMenu.name,
// route: entityGraphMenu.route,
// type: entityGraphMenu.type
// })
// return true
// }
// const menu = menus.find(m => m.route === this.route)
// if (menu) {
// breadcrumb.unshift({
// code: menu.code,
// value: menu.i18n ? this.$t(menu.i18n) : menu.name,
// route: menu.route,
// type: menu.type
// })
// return true
// } else {
// for (let i = 0; i < menus.length; i++) {
// if (!_.isEmpty(menus[i].children)) {
// if (this.generateBreadcrumb(breadcrumb, menus[i].children)) {
// breadcrumb.unshift({
// code: menus[i].code,
// value: menus[i].i18n ? this.$t(menus[i].i18n) : menus[i].name,
// route: menus[i].route,
// type: menus[i].type
// })
// return true
// }
// }
// }
// }
// },
handleClose () {
this.showChangePin = false
},
@@ -722,23 +696,6 @@ export default {
}
}
},
// 仅处理除panel外的相关路径的导航
async jumpOther (route, index) {
route = route.replace('redirect:', '')
this.showMenu = false
if (route === this.route && index > 0) { // 当前只有一级菜单时,点击不进行刷新,重新跳转
this.refresh()
return
}
if (route) {
this.$router.push({
path: route,
query: {
t: +new Date()
}
})
}
},
async jump (route, columnName, columnValue, opeType) {
if (route === '/panel/linkMonitor' && opeType === 3) {
return true