feat(system): 添加菜单显示状态控制功能并完善租户ID设置
- 在MetaVo中添加visible字段用于控制菜单显示状态 - 修改SysMenuServiceImpl中的路由构建逻辑,传递visible信息到前端 - 更新SidebarItem.vue组件,根据visible属性控制菜单项显示 - 在多个医嘱管理相关服务类中显式设置租户ID以确保多租户隔离 - 调整字典管理相关路由配置,优化页面跳转路径 - 在菜单管理界面添加显示状态查询和表格列展示功能
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-if="!item.hidden">
|
||||
<div v-if="!item.hidden && !(item.meta && item.meta.visible === '1')">
|
||||
<template v-if="hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
|
||||
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
|
||||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
|
||||
|
||||
@@ -97,22 +97,6 @@ export const constantRoutes = [
|
||||
|
||||
// 动态路由,基于用户权限动态去加载
|
||||
export const dynamicRoutes = [
|
||||
{
|
||||
path: '/basicmanage',
|
||||
component: Layout,
|
||||
redirect: '/basicmanage/invoice-management',
|
||||
name: 'BasicManage',
|
||||
meta: { title: '基础管理', icon: 'component' },
|
||||
children: [
|
||||
{
|
||||
path: 'invoice-management',
|
||||
component: () => import('@/views/basicmanage/InvoiceManagement/index.vue'),
|
||||
name: 'invoice-management',
|
||||
meta: { title: '发票管理' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/system/tenant-user',
|
||||
component: Layout,
|
||||
@@ -169,20 +153,7 @@ export const dynamicRoutes = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system/dict-data',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:dict:list'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:dictId(\\d+)',
|
||||
component: () => import('@/views/system/dict/data'),
|
||||
name: 'Data',
|
||||
meta: { title: '字典数据', activeMenu: '/system/dict' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/monitor',
|
||||
component: Layout,
|
||||
@@ -265,33 +236,7 @@ export const dynamicRoutes = [
|
||||
meta: { title: '帮助中心'},
|
||||
},
|
||||
],
|
||||
},
|
||||
// 字典类型路由(直接复制这段)
|
||||
{
|
||||
path: '/system/dict',
|
||||
component: Layout,
|
||||
alwaysShow: true,
|
||||
name: 'DictType',
|
||||
meta: {
|
||||
title: '字典类型管理',
|
||||
icon: 'list' // 图标随便选一个,比如list、dict,不影响跳转
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/system/dict/index.vue'),
|
||||
name: 'DictTypeList',
|
||||
meta: {title: '字典类型', noCache: false}
|
||||
},
|
||||
{
|
||||
path: 'data/:dictId?', // 带字典ID参数,?表示可选
|
||||
component: () => import('@/views/system/dict/data.vue'), // 你的data.vue路径
|
||||
name: 'DictData',
|
||||
hidden: true, // 不在侧边栏显示(子页面)
|
||||
meta: {title: '字典数据', activeMenu: '/system/dict'} // 保持侧边栏高亮
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
// 合并常量路由和动态路由,确保所有路由都能被访问
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<router-link :to="'/system/dict/data/' + scope.row.dictId" class="link-type">
|
||||
<router-link :to="'/system/basicmanage/dict/data/' + scope.row.dictId" class="link-type">
|
||||
<span>{{ scope.row.dictType }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="显示状态" prop="visible">
|
||||
<el-select v-model="queryParams.visible" placeholder="显示状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_show_hide"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item class="search-buttons">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@@ -70,6 +80,11 @@
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" class="dict-tag" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="visible" label="显示状态" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_show_hide" :value="scope.row.visible" class="dict-tag" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
|
||||
Reference in New Issue
Block a user