From 4558e5ff4728927504f0a783b951ce6d308c7b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=AD=E5=A5=87?= Date: Mon, 19 May 2025 22:50:50 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20menu=20add=20i18n=20fix:=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4icon=E4=B8=BA=E6=9C=AC=E5=9C=B0=E6=97=B6select?= =?UTF-8?q?=E7=9A=84placeholder=E6=9C=AA=E6=AD=A3=E7=A1=AE=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/langs/en-us.ts | 43 ++++++- src/locales/langs/zh-cn.ts | 37 +++++- src/typings/app.d.ts | 33 +++++- src/views/system/menu/index.vue | 60 +++++----- .../menu/modules/menu-operate-drawer.vue | 108 +++++++++++------- 5 files changed, 201 insertions(+), 80 deletions(-) diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 13e9c780..8d076e9f 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -551,19 +551,40 @@ const local: App.I18n.Schema = { }, menu: { title: 'Menu List', + parentId: 'Parent Menu', + iconType: 'Icon Type', menuName: 'Menu Name', icon: 'Menu Icon', - sort: 'Sort', - permission: 'Permission', + orderNum: 'Sort', + perms: 'Permission Code', component: 'Component Path', path: 'Route Path', + externalPath: 'External Path', query: 'Route Parameters', + iframeQuery: 'Iframe Address', isFrame: 'External Link', isCache: 'Cache', menuType: 'Menu Type', visible: 'Visible', status: 'Status', createTime: 'Create Time', + cache: 'cache', + noCache: 'No Cache', + rootName: 'Root', + buttonPermissionList: 'Button Permission List', + emptyMenu: 'Empty Menu', + menuDetail: 'Menu Detail', + iconifyTip: 'iconify address:`https://icones.js.org`', + isFrameTip: 'If you choose External Link, the routing address needs to start with `http(s)://`', + isCacheTip: + 'If you select yes, it will be cached by `keep-alive`, and the `name` and address of the matching component must be consistent', + visibleTip: 'If you choose Hide, the route will not appear in the sidebar, but it can still be accessed.', + statusTip: 'If you choose to disable, the route will not appear in the sidebar and cannot be accessed.', + permsTip: "Permission string defined in the controller, such as: @SaCheckPermission('system:user:list')", + componentTip: + 'The component path to access, such as: `system/user/index`, which is in the `views` directory by default', + pathTip: + 'Router path,Example:`user`,If the external network address needs to be accessed in the internal link,then `http(s)://` beginning', form: { parentId: { required: 'Please select Parent Menu', @@ -581,9 +602,13 @@ const local: App.I18n.Schema = { required: 'Please enter Menu Name', invalid: 'Menu Name cannot be empty' }, - sort: { - required: 'Please enter Sort', - invalid: 'Sort cannot be empty' + perms: { + required: 'Please enter permission code', + invalid: 'Permission code cannot be empty' + }, + orderNum: { + required: 'Please enter order num', + invalid: 'Order num cannot be empty' }, isFrame: { required: 'Please select External Link', @@ -618,10 +643,18 @@ const local: App.I18n.Schema = { invalid: 'Permission cannot be empty' } }, + placeholder: { + iconifyIconPlaceholder: 'Please enter an icon', + localIconPlaceholder: 'Please select the local icon', + queryKey: 'Please enter a key', + queryValue: 'Please enter a value', + queryIframe: 'Please enter a iframe address' + }, directory: 'Directory', menu: 'Menu', button: 'Button', addMenu: 'Add Menu', + addChildMenu: 'Add Child Menu', editMenu: 'Edit Menu' }, notice: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index da4dd3d1..47b8d889 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -551,19 +551,38 @@ const local: App.I18n.Schema = { }, menu: { title: '菜单列表', + parentId: '上级菜单', + iconType: '图标类型', menuName: '菜单名称', icon: '菜单图标', - sort: '排序', - permission: '权限标识', + orderNum: '排序', + perms: '权限字符', component: '组件路径', path: '路由地址', + externalPath: '外链地址', query: '路由参数', + iframeQuery: 'iframe 地址', isFrame: '是否外链', isCache: '是否缓存', menuType: '菜单类型', visible: '显示状态', status: '菜单状态', createTime: '创建时间', + cache: '缓存', + noCache: '不缓存', + rootName: '根目录', + buttonPermissionList: '按钮权限列表', + emptyMenu: '暂无菜单', + menuDetail: '菜单详情', + iconifyTip: 'iconify 地址:https://icones.js.org', + isFrameTip: '选择是外链则路由地址需要以`http(s)://`开头', + isCacheTip: '选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致', + visibleTip: '选择隐藏则路由将不会出现在侧边栏,但仍然可以访问', + statusTip: '选择停用则路由将不会出现在侧边栏,也不能被访问', + permsTip: "控制器中定义的权限字符,如:`@SaCheckPermission('system:user:list')`", + componentTip: '访问的组件路径,如:`system/user/index`,默认在`views`目录下', + pathTip: + 'Router path,Example:`user`,If the external network address needs to be accessed in the internal link,then `http(s)://` beginning', form: { parentId: { required: '请选择上级菜单', @@ -581,10 +600,14 @@ const local: App.I18n.Schema = { required: '请输入菜单名称', invalid: '菜单名称不能为空' }, - sort: { + orderNum: { required: '请输入排序', invalid: '排序不能为空' }, + perms: { + required: '请输入权限字符', + invalid: '权限字符不能为空' + }, isFrame: { required: '请选择是否外链', invalid: '是否外链不能为空' @@ -618,10 +641,18 @@ const local: App.I18n.Schema = { invalid: '权限标识不能为空' } }, + placeholder: { + iconifyIconPlaceholder: '请输入图标', + localIconPlaceholder: '请选择本地图标', + queryKey: '请输入 Key', + queryValue: '请输入 Value', + queryIframe: '请输入 iframe 地址' + }, directory: '目录', menu: '菜单', button: '按钮', addMenu: '新增菜单', + addChildMenu: '新增子菜单', editMenu: '编辑菜单' }, notice: { diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index d9ec7b98..b37b9083 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -657,25 +657,44 @@ declare namespace App { }; menu: { title: string; + parentId: string; + iconType: string; menuName: string; icon: string; - sort: string; - permission: string; + orderNum: string; + perms: string; component: string; path: string; + externalPath: string; query: string; + iframeQuery: string; isFrame: string; isCache: string; menuType: string; visible: string; status: string; createTime: string; + cache: string; + noCache: string; + rootName: string; + buttonPermissionList: string; + emptyMenu: string; + menuDetail: string; + iconifyTip: string; + isFrameTip: string; + isCacheTip: string; + visibleTip: string; + statusTip: string; + permsTip: string; + componentTip: string; + pathTip: string; form: { parentId: FormMsg; menuType: FormMsg; icon: FormMsg; menuName: FormMsg; - sort: FormMsg; + orderNum: FormMsg; + perms: FormMsg; isFrame: FormMsg; path: FormMsg; component: FormMsg; @@ -685,10 +704,18 @@ declare namespace App { status: FormMsg; permission: FormMsg; }; + placeholder: { + iconifyIconPlaceholder: string; + localIconPlaceholder: string; + queryKey: string; + queryValue: string; + queryIframe: string; + }; directory: string; menu: string; button: string; addMenu: string; + addChildMenu: string; editMenu: string; }; notice: { diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 731bc88e..c710d51d 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -46,7 +46,7 @@ const getMeunTree = async () => { treeData.value = [ { menuId: 0, - menuName: '根目录', + menuName: $t('page.system.menu.rootName'), icon: 'material-symbols:home-outline-rounded', children: handleTree(data, { idField: 'menuId', filterFn: item => item.menuType !== 'F' }) } @@ -112,7 +112,7 @@ function renderSuffix({ option }: { option: TreeOption }) { text class="h-18px" icon="ic-round-plus" - tooltip-content="新增子菜单" + tooltip-content={$t('page.system.menu.addChildMenu')} onClick={(event: Event) => { event.stopPropagation(); handleAddMenu(option.menuId as CommonType.IdType); @@ -203,18 +203,18 @@ const btnColumns: DataTableColumns = [ } }, { - title: '权限名称', + title: $t('page.system.menu.menuName'), key: 'menuName', minWidth: 120 }, { - title: '权限标识', + title: $t('page.system.menu.perms'), key: 'perms', align: 'center', minWidth: 120 }, { - title: '状态', + title: $t('page.system.menu.status'), key: 'status', minWidth: 80, align: 'center', @@ -223,13 +223,13 @@ const btnColumns: DataTableColumns = [ } }, { - title: '创建时间', + title: $t('page.system.menu.createTime'), key: 'createTime', align: 'center', minWidth: 150 }, { - title: '操作', + title: $t('common.action'), key: 'actions', width: 80, align: 'center', @@ -286,27 +286,27 @@ const btnColumns: DataTableColumns = [