From 3321e8e979dbb75b086ce4b0217cd8d9ba4d7577 Mon Sep 17 00:00:00 2001 From: linbin <495561397@qq.com> Date: Mon, 8 Sep 2025 00:53:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E8=BF=B0:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=AB=AFweb=E6=9D=83=E9=99=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E7=9A=84iframe=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改权限编辑菜单项的链接方式,从hash路由改为相对路径引用 - 新增openTabWithIframe函数,用于通过iframe方式加载子页面 - 优化菜单项点击事件处理逻辑,支持默认链接跳转行为 - 为iframe标签页添加基础样式支持 --- 平台端web/index.html | 65 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/平台端web/index.html b/平台端web/index.html index 8ced12a..228f471 100644 --- a/平台端web/index.html +++ b/平台端web/index.html @@ -448,7 +448,7 @@
@@ -670,6 +670,46 @@ setActiveTab(tabId, title); } + // 通过iframe打开标签页 + function openTabWithIframe(link, title) { + const tabId = title.toLowerCase().replace(/\s+/g, '-'); + + // 检查标签页是否已存在 + const existingTab = document.querySelector(`[data-tab="${tabId}"]`); + if (existingTab) { + // 激活已存在的标签页 + setActiveTab(tabId, title); + return; + } + + // 创建新标签页 + const tabsContainer = document.querySelector('.tabs-container'); + const newTab = document.createElement('div'); + newTab.className = 'tab-item'; + newTab.setAttribute('data-tab', tabId); + newTab.innerHTML = ` + ${title} + × + `; + newTab.onclick = () => setActiveTab(tabId, title); + tabsContainer.appendChild(newTab); + + // 创建新内容区域,使用iframe嵌入页面 + const contentArea = document.querySelector('.content-container'); + const newContent = document.createElement('div'); + newContent.id = `tab-content-${tabId}`; + newContent.className = 'tab-content'; + newContent.style.display = 'none'; + newContent.innerHTML = ` +