feat: 隐藏命中测试

This commit is contained in:
wangdan-fit2cloud 2024-06-20 17:36:34 +08:00
parent c859678779
commit 1e7ba06560
2 changed files with 15 additions and 6 deletions

View File

@ -161,8 +161,10 @@ function changeMenu(id: string) {
router.push({ name: lastMatched.name, params: { id: id } })
} else if (isApplication.value) {
const type = list.value?.filter((v) => v.id === id)?.[0]?.type
if (lastMatched.name === 'AppSetting' && type === 'WORK_FLOW') {
router.push({ path: `/application/${id}/${type}/overview` })
if (type === 'WORK_FLOW') {
if (lastMatched.name === 'AppSetting' || lastMatched.name === 'AppHitTest') {
router.push({ path: `/application/${id}/${type}/overview` })
}
} else {
router.push({
name: lastMatched.name,

View File

@ -1,5 +1,5 @@
<template>
<div v-if="!menu.meta || !menu.meta.hidden" class="sidebar-item">
<div v-if="(!menu.meta || !menu.meta.hidden) && showMenu()" class="sidebar-item">
<el-menu-item
ref="subMenu"
:index="menu.path"
@ -23,15 +23,22 @@ const props = defineProps<{
activeMenu: any
}>()
const route = useRoute()
const router = useRouter()
const route = useRoute()
const {
params: { id, type }
} = route as any
function showMenu() {
if (type === 'WORK_FLOW') {
return props.menu.name !== 'AppHitTest'
} else {
return true
}
}
function clickHandle(item: any) {
if (item.name === 'AppSetting' && type === 'WORK_FLOW') {
if (type === 'WORK_FLOW' && item.name === 'AppSetting') {
router.push({ path: `/application/${id}/workflow` })
}
}