This commit is contained in:
hzz 2024-03-27 17:08:01 +08:00
parent d3153c4bc2
commit fd22451b03
5 changed files with 54 additions and 4 deletions

View File

@ -1,4 +1,23 @@
export default { export default {
"menus":{
"home": "Home",
"dashboard": "Dashboard",
"system": "System",
"user": "User",
"role": "Role",
"menu": "Menu",
"dept": "Dept",
"dict": "Dict",
"config": "Config",
"notice": "Notice",
"log": "Log",
"loginLog": "Login Log",
"task": "Task",
"druid": "Druid",
"druidWallBoard": "Wall Board",
"druidSql": "SQL",
"druidStat": "Stat",
},
"common": { "common": {
"add": "Add", "add": "Add",
"edit": "Edit", "edit": "Edit",

View File

@ -1,4 +1,24 @@
export default { export default {
//菜单
"menus":{
"home": "首页",
"dashboard": "仪表盘",
"system": "系统管理",
"user": "用户管理",
"role": "角色管理",
"menu": "菜单管理",
"dept": "部门管理",
"dict": "字典管理",
"config": "参数管理",
"notice": "通知公告",
"log": "操作日志",
"loginLog": "登录日志",
"task": "定时任务",
"druid": "监控管理",
"druidWallBoard": "大盘监控",
"druidSql": "SQL监控",
"druidStat": "统计监控",
},
"common":{ "common":{
"add": "新增", "add": "新增",
"edit": "修改", "edit": "修改",

View File

@ -4,7 +4,7 @@
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"> <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }"> <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
<svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)"/> <svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)"/>
<template #title><span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span></template> <template #title><span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ menusTitle(onlyOneChild.meta.title) }}</span></template>
</el-menu-item> </el-menu-item>
</app-link> </app-link>
</template> </template>
@ -12,7 +12,7 @@
<el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported> <el-sub-menu v-else ref="subMenu" :index="resolvePath(item.path)" teleported>
<template v-if="item.meta" #title> <template v-if="item.meta" #title>
<svg-icon :icon-class="item.meta && item.meta.icon" /> <svg-icon :icon-class="item.meta && item.meta.icon" />
<span class="menu-title" :title="hasTitle(item.meta.title)">{{ item.meta.title }}</span> <span class="menu-title" :title="hasTitle(item.meta.title)">{{ menusTitle(item.meta.title) }}</span>
</template> </template>
<sidebar-item <sidebar-item
@ -31,6 +31,8 @@
import { isExternal } from '@/utils/validate' import { isExternal } from '@/utils/validate'
import AppLink from './Link' import AppLink from './Link'
import { getNormalPath } from '@/utils/ruoyi' import { getNormalPath } from '@/utils/ruoyi'
import { useI18n } from 'vue-i18n'
let {te,t} = useI18n();
const props = defineProps({ const props = defineProps({
// route object // route object
@ -50,6 +52,15 @@ const props = defineProps({
const onlyOneChild = ref({}); const onlyOneChild = ref({});
//
function menusTitle(item) {
if (te("menus." + item)) {
return t("menus." + item)
}
return item
}
function hasOneShowingChild(children = [], parent) { function hasOneShowingChild(children = [], parent) {
if (!children) { if (!children) {
children = []; children = [];

View File

@ -66,7 +66,7 @@ export const constantRoutes = [
path: '/index', path: '/index',
component: () => import('@/views/index'), component: () => import('@/views/index'),
name: 'Index', name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true } meta: { title: 'home', icon: 'dashboard', affix: true }
} }
] ]
}, },

View File

@ -47,7 +47,7 @@
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer">
<span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span> <span>Copyright © 2018-2023 Copyright.vip All Rights Reserved.</span>
</div> </div>
</div> </div>
</template> </template>