From 84a7ce9b7a3e87535a9478ffbf17c166f4b9fb31 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Thu, 16 Jan 2025 15:00:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/7706=E3=80=91=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E6=A0=8F=E5=AF=BC=E8=88=AA=E5=86=85=E9=83=A8=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E4=B9=9F=E5=8F=AF=E4=BB=A5=E6=94=AF=E6=8C=81=E9=87=87=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E6=B5=8F=E8=A7=88=E5=99=A8tab=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Menu/src/BasicMenu.vue | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/jeecgboot-vue3/src/components/Menu/src/BasicMenu.vue b/jeecgboot-vue3/src/components/Menu/src/BasicMenu.vue index 2048541a..328d6c1d 100644 --- a/jeecgboot-vue3/src/components/Menu/src/BasicMenu.vue +++ b/jeecgboot-vue3/src/components/Menu/src/BasicMenu.vue @@ -123,6 +123,13 @@ window.open(key); return; } + // update-begin--author:liaozhiyang---date:20250114---for:【issues/7706】顶部栏导航内部路由也可以支持采用新浏览器tab打开 + const findItem = getMatchingMenu(props.items, key); + if (findItem?.internalOrExternal == true) { + window.open(location.origin + key); + return; + } + // update-end--author:liaozhiyang---date:20250114---for:【issues/7706】顶部栏导航内部路由也可以支持采用新浏览器tab打开 // update-end--author:liaozhiyang---date:20240402---for:【QQYUN-8773】配置外部网址在顶部菜单模式和搜索打不开 if (beforeClickFn && isFunction(beforeClickFn)) { const flag = await beforeClickFn(key); @@ -218,6 +225,25 @@ } return null; } + /** + * 2025-01-14 + * liaozhiyang + * 获取菜单中匹配的path所在的项 + */ + const getMatchingMenu = (menus, path) => { + for (let i = 0, len = menus.length; i < len; i++) { + const item = menus[i]; + if (item.path === path && !item.redirect && !item.paramPath) { + return item; + } else if (item.children?.length) { + const result = getMatchingMenu(item.children, path); + if (result) { + return result; + } + } + } + return ''; + }; return { handleMenuClick,