feat: 项目详情路由调整
This commit is contained in:
parent
17b0871ab5
commit
0a062cb564
@ -1,12 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="breadcrumb-container">
|
<div class="breadcrumb-container">
|
||||||
<el-breadcrumb separator="/">
|
<el-breadcrumb separator="/">
|
||||||
<el-breadcrumb-item
|
<el-breadcrumb-item v-for="(item, index) in breadcrumbList" :key="index"
|
||||||
v-for="(item, index) in breadcrumbList"
|
:class="{ 'is-link': index < breadcrumbList.length - 1 }" @click="handleBreadcrumbClick(item, index)">
|
||||||
:key="index"
|
|
||||||
:class="{ 'is-link': index < breadcrumbList.length - 1 }"
|
|
||||||
@click="handleBreadcrumbClick(item, index)"
|
|
||||||
>
|
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
@ -15,7 +11,9 @@
|
|||||||
<div class="breadcrumb-actions" v-if="breadcrumbList.length > 1">
|
<div class="breadcrumb-actions" v-if="breadcrumbList.length > 1">
|
||||||
<el-dropdown trigger="click" @command="handleCloseAction">
|
<el-dropdown trigger="click" @command="handleCloseAction">
|
||||||
<el-button type="text" size="small" class="close-btn">
|
<el-button type="text" size="small" class="close-btn">
|
||||||
<el-icon><Close /></el-icon>
|
<el-icon>
|
||||||
|
<Close />
|
||||||
|
</el-icon>
|
||||||
关闭
|
关闭
|
||||||
</el-button>
|
</el-button>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
@ -23,7 +21,8 @@
|
|||||||
<el-dropdown-item command="close-current">关闭当前页</el-dropdown-item>
|
<el-dropdown-item command="close-current">关闭当前页</el-dropdown-item>
|
||||||
<el-dropdown-item command="close-other" :disabled="breadcrumbList.length <= 2">关闭其他页</el-dropdown-item>
|
<el-dropdown-item command="close-other" :disabled="breadcrumbList.length <= 2">关闭其他页</el-dropdown-item>
|
||||||
<el-dropdown-item command="close-left" :disabled="currentIndex === 0">关闭左侧</el-dropdown-item>
|
<el-dropdown-item command="close-left" :disabled="currentIndex === 0">关闭左侧</el-dropdown-item>
|
||||||
<el-dropdown-item command="close-right" :disabled="currentIndex === breadcrumbList.length - 1">关闭右侧</el-dropdown-item>
|
<el-dropdown-item command="close-right"
|
||||||
|
:disabled="currentIndex === breadcrumbList.length - 1">关闭右侧</el-dropdown-item>
|
||||||
<el-dropdown-item command="close-all" :disabled="breadcrumbList.length <= 1">全部关闭</el-dropdown-item>
|
<el-dropdown-item command="close-all" :disabled="breadcrumbList.length <= 1">全部关闭</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
@ -102,7 +101,25 @@ const generateBreadcrumb = () => {
|
|||||||
name: 'projectAdd',
|
name: 'projectAdd',
|
||||||
meta: { title: '项目填报' }
|
meta: { title: '项目填报' }
|
||||||
})
|
})
|
||||||
} else {
|
} else if (currentPath.includes('/projectDetail')) {
|
||||||
|
// 特殊处理:项目详情页面(项目管理的子页面)
|
||||||
|
// 添加项目管理(父级)
|
||||||
|
breadcrumbList.value.push({
|
||||||
|
title: '项目管理',
|
||||||
|
path: '/projectManagement',
|
||||||
|
name: 'projectManagement',
|
||||||
|
meta: { title: '项目管理' }
|
||||||
|
})
|
||||||
|
|
||||||
|
// 添加项目填报(当前页)
|
||||||
|
breadcrumbList.value.push({
|
||||||
|
title: '项目详情',
|
||||||
|
path: currentPath,
|
||||||
|
name: 'projectDetail',
|
||||||
|
meta: { title: '项目详情' }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
// 普通路由处理
|
// 普通路由处理
|
||||||
matched.forEach((record, index) => {
|
matched.forEach((record, index) => {
|
||||||
// 跳过根路径(已经在上面添加了首页)
|
// 跳过根路径(已经在上面添加了首页)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user