From 6b868e378fb4225f0f3321f0fed20edf57eafd7b Mon Sep 17 00:00:00 2001 From: chenqi Date: Tue, 20 Jan 2026 17:30:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(router):=20=E6=B7=BB=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E8=B7=AF=E7=94=B1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加套餐管理相关路由到公共路由,确保始终可用 - 新增基础管理模块,包含发票管理功能 - 添加系统监控模块,包含操作日志、登录日志、定时任务功能 - 新增系统工具模块,包含代码生成功能 - 扩展系统管理模块,增加租户用户、合同管理、用户角色授权等功能 - 添加字典数据、任务日志、代码生成编辑等隐藏路由 - 统一修复代码格式,调整对象属性间的空格格式 - 完善路由元信息配置,添加权限控制和图标支持 --- openhis-ui-vue3/src/router/index.js | 180 +++++++++++++++++++++++++++- 1 file changed, 175 insertions(+), 5 deletions(-) diff --git a/openhis-ui-vue3/src/router/index.js b/openhis-ui-vue3/src/router/index.js index dada00a9..84a884a8 100644 --- a/openhis-ui-vue3/src/router/index.js +++ b/openhis-ui-vue3/src/router/index.js @@ -1,4 +1,4 @@ -import {createWebHistory, createRouter} from 'vue-router' +import { createWebHistory, createRouter } from 'vue-router' /* Layout */ import Layout from '@/layout' @@ -61,7 +61,7 @@ export const constantRoutes = [ path: '/index', component: () => import('@/views/index'), name: 'Index', - meta: {title: '首页', icon: 'dashboard', affix: true} + meta: { title: '首页', icon: 'dashboard', affix: true } } ] }, @@ -75,7 +75,21 @@ export const constantRoutes = [ path: 'profile', component: () => import('@/views/system/user/profile/index'), name: 'Profile', - meta: {title: '个人中心', icon: 'user'} + meta: { title: '个人中心', icon: 'user' } + } + ] + }, + // 添加套餐管理相关路由到公共路由,确保始终可用 + { + path: '/maintainSystem/Inspection/PackageManagement', + component: Layout, + hidden: true, + children: [ + { + path: '', + component: () => import('@/views/maintainSystem/Inspection/PackageManagement.vue'), + name: 'DirectPackageManagement', + meta: { title: '套餐管理' } } ] } @@ -83,6 +97,162 @@ 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, + hidden: true, + permissions: ['*:*:*'], + children: [ + { + path: 'set/:tenantId(\\d+)', + component: () => import('@/views/system/tenant/setUser'), + name: 'SetUser', + meta: { title: '所属用户', activeMenu: '/system/tenant' } + } + ] + }, + { + path: '/system/tenant-contract', + component: Layout, + hidden: true, + permissions: ['*:*:*'], + children: [ + { + path: 'set/:tenantId(\\d+)', + component: () => import('@/views/system/tenant/setContract'), + name: 'SetContract', + meta: { title: '合同管理', activeMenu: '/system/tenant' } + } + ] + }, + { + path: '/system/user-auth', + component: Layout, + hidden: true, + permissions: ['system:user:edit'], + children: [ + { + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: { title: '分配角色', activeMenu: '/system/user' } + } + ] + }, + { + path: '/system/role-auth', + component: Layout, + hidden: true, + permissions: ['system:role:edit'], + children: [ + { + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: { title: '分配用户', activeMenu: '/system/role' } + } + ] + }, + { + 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, + redirect: '/monitor/operlog', + name: 'Monitor', + meta: { title: '系统监控', icon: 'monitor' }, + children: [ + { + path: 'operlog', + component: () => import('@/views/monitor/operlog/index.vue'), + name: 'Operlog', + meta: { title: '操作日志', icon: 'operlog', permissions: ['monitor:operlog:list'] } + }, + { + path: 'logininfor', + component: () => import('@/views/monitor/logininfor/index.vue'), + name: 'Logininfor', + meta: { title: '登录日志', icon: 'logininfor', permissions: ['monitor:logininfor:list'] } + }, + { + path: 'job', + component: () => import('@/views/monitor/job/index.vue'), + name: 'Job', + meta: { title: '定时任务', icon: 'job', permissions: ['monitor:job:list'] } + } + ] + }, + { + path: '/tool', + component: Layout, + redirect: '/tool/gen', + name: 'Tool', + meta: { title: '系统工具', icon: 'tool' }, + children: [ + { + path: 'gen', + component: () => import('@/views/tool/gen/index.vue'), + name: 'Gen', + meta: { title: '代码生成', icon: 'gen', permissions: ['tool:gen:list'] } + } + ] + }, + { + path: '/monitor/job-log', + component: Layout, + hidden: true, + permissions: ['monitor:job:list'], + children: [ + { + path: 'index/:jobId(\\d+)', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: { title: '调度日志', activeMenu: '/monitor/job' } + } + ] + }, + { + path: '/tool/gen-edit', + component: Layout, + hidden: true, + permissions: ['tool:gen:edit'], + children: [ + { + path: 'index/:tableId(\\d+)', + component: () => import('@/views/tool/gen/editTable'), + name: 'GenEdit', + meta: { title: '修改生成配置', activeMenu: '/tool/gen' } + } + ] + }, { path: '/help-center', component: Layout, @@ -92,7 +262,7 @@ export const dynamicRoutes = [ path: '', component: () => import('@/views/helpcenter/index.vue'), name: 'HelpCenter', - meta: {title: '帮助中心'}, + meta: { title: '帮助中心'}, }, ], }, @@ -115,7 +285,7 @@ const router = createRouter({ if (savedPosition) { return savedPosition } else { - return {top: 0} + return { top: 0 } } }, });