From 7a5dda02aa2f9928ba464704ea82ba7165270eb4 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Wed, 17 Dec 2025 19:46:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E5=8F=8C=E8=AF=AD]=20=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E4=B8=8D=E4=BB=8E=E8=AF=AD=E8=A8=80=E9=85=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E6=98=AF=E8=AE=BE=E7=BD=AE=E6=88=90=E4=B8=AD=E6=96=87?= =?UTF-8?q?=EF=BC=8C=E4=BB=8E=E5=AF=B9=E8=B1=A1=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Breadcrumb/index.vue | 4 +-- src/lang/en.js | 2 +- src/lang/zh.js | 2 -- src/layout/components/Sidebar/SidebarItem.vue | 4 +-- src/layout/components/TagsView/index.vue | 2 +- src/main.js | 2 ++ src/utils/menu.js | 44 +++++++++++++++++++++++++++ 7 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 src/utils/menu.js diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 03c6a12..7f31fc7 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -2,8 +2,8 @@ - {{ $t('menu.'+item.meta.title) }} - {{ $t('menu.'+item.meta.title) }} + {{ getMenuName(item.meta.title) }} + {{ getMenuName(item.meta.title) }} diff --git a/src/lang/en.js b/src/lang/en.js index 095af12..82265ef 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -85,7 +85,7 @@ export default { name: 'name', namePlaceholder: 'namePlaceholder', status: 'status', - statusAll: 'statusAll', + statusAll: 'All', statusVisible: 'visible', statusHide: 'hide', diff --git a/src/lang/zh.js b/src/lang/zh.js index 9282471..fd4bcd1 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -107,8 +107,6 @@ export default { addMenu: '添加菜单', modifyMenu: '修改菜单', - addMent: '添加菜单', - addMent: '添加菜单', root: '主类目', diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index e13ebbb..fd3cc0e 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -3,14 +3,14 @@ - {{ $t('menu.'+tag.title) }} + {{ getMenuName(tag.title) }} diff --git a/src/main.js b/src/main.js index 39bc9b9..073c4bf 100644 --- a/src/main.js +++ b/src/main.js @@ -26,6 +26,7 @@ import { selectDictLabels, handleTree } from '@/utils/ruoyi' +import { getMenuName } from '@/utils/menu' // 分页组件 import Pagination from '@/components/Pagination' // 自定义表格工具组件 @@ -53,6 +54,7 @@ Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree +Vue.prototype.getMenuName = getMenuName // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/src/utils/menu.js b/src/utils/menu.js new file mode 100644 index 0000000..360eae4 --- /dev/null +++ b/src/utils/menu.js @@ -0,0 +1,44 @@ +// 菜单语言适配 +let menuObj = { + 个人中心: 'PersonalCenter', + 工作台: 'Workbench', + + 试验管理: 'TrialManage', + + 表单管理: 'FormManage', + 非试验表单: 'NonTrialForm', + 麻精药表单: 'DrugForm', + + 资源库管理: 'ResourceManage', + 试剂管理: 'ReagentManage', + 供试品管理: 'SpecimenManage', + 给药制剂管理: 'DosageManage', + 麻精药管理: 'DrugManage', + 钥匙管理: 'KeyManage', + 仪器管理: 'InstrumentManage', + + 档案管理: 'ArchiveManage', + 试验档案管理: 'TrialArchiveManage', + 非试验档案管理: 'NonTrialArchiveManage', + 麻精药配置档案管理: 'DrugConfigArchiveManage', + 供试品档案管理: 'SpecimenArchiveManage', + 给药制剂档案管理: 'DosageArchiveManage', + 麻精药档案管理: 'DrugArchiveManage', + 试剂档案管理: 'ReagentArchiveManage', + 档案记录: 'ArchiveRecord', + + 系统管理: 'SystemManage', + 菜单管理: 'MenuManage', + 角色管理: 'RoleManage', + 用户管理: 'UserManage', + '部门/学科管理': 'DeptManage', + 模板管理: 'TemplateManage', + 字典管理: 'DictManage', + 日志管理: 'LogManage' +} +export function getMenuName(menuName) { + if (!this.$i18n.locale || this.$i18n.locale === 'zh_CN') { + return menuName + } + return menuObj[menuName] +}