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 = ` +