diff --git a/resources/views/business/pages/courier-payables/final-workspace.blade.php b/resources/views/business/pages/courier-payables/final-workspace.blade.php index f9e9a551..27334879 100644 --- a/resources/views/business/pages/courier-payables/final-workspace.blade.php +++ b/resources/views/business/pages/courier-payables/final-workspace.blade.php @@ -83,7 +83,8 @@ } // Preserve each page's own scripts, forms and routes in its document. const style = doc.createElement('style'); - style.textContent = '.js-menu,body>.container,#header [data-page-title-first]{display:none!important} #panel{margin:0!important;padding:0!important} #main-body>.container{margin:0!important;padding:0!important;width:100%!important} #header{padding:0!important;margin:0!important}'; + // 子页面在 iframe 里不再显示外层那一整排菜单和标签栏,只保留页面本身。 + style.textContent = '.js-menu,body>.container,#header [data-page-title-first],.open-tabs{display:none!important} #panel{margin:0!important;padding:0!important} #main-body>.container{margin:0!important;padding:0!important;width:100%!important} #header{padding:0!important;margin:0!important}'; doc.head.appendChild(style); frame.style.visibility = 'visible'; delete frame.dataset.failed; diff --git a/resources/views/business/pages/partials/open-page-tabs.blade.php b/resources/views/business/pages/partials/open-page-tabs.blade.php index f6c65f41..291b94f5 100644 --- a/resources/views/business/pages/partials/open-page-tabs.blade.php +++ b/resources/views/business/pages/partials/open-page-tabs.blade.php @@ -79,6 +79,11 @@ if (!root) { return; } + // 目录里有用 iframe 打开子页面的页面(例如快递报价)。iframe 内不再显示标签栏: + // 它既和外层那条重复,点标签也只会在 iframe 内部再套一层同样的页面。 + if (window.self !== window.top) { + return; + } const list = root.querySelector('[data-open-tabs-list]'); const userId = root.dataset.userId || 'anon'; const storageKey = 'caiwu.open-pages.v1.' + userId; diff --git a/tests/Feature/Settings/NavigationTest.php b/tests/Feature/Settings/NavigationTest.php index f92217f9..84cf5d6b 100644 --- a/tests/Feature/Settings/NavigationTest.php +++ b/tests/Feature/Settings/NavigationTest.php @@ -202,7 +202,9 @@ class NavigationTest extends FeatureTestCase // 已打开页面标签栏(固定在页面上方,点开的页面并排显示)。 ->assertSee('data-open-tabs', false) ->assertSee('data-open-tabs-list', false) - ->assertSee('caiwu.open-pages.v1.', false); + ->assertSee('caiwu.open-pages.v1.', false) + // 目录 iframe 里的子页面不再重复渲染这条标签栏。 + ->assertSee('window.self !== window.top', false); } public function testProcessStatisticsPageIsAvailableUnderRiskControl(): void