From 240a069a08a4da872978764b0790e3d1839410fd Mon Sep 17 00:00:00 2001 From: x1ao4 Date: Wed, 17 Sep 2025 00:35:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E8=BF=BD=E5=89=A7=E6=97=A5=E5=8E=86?= =?UTF-8?q?=E7=9A=84=E6=B5=B7=E6=8A=A5=E8=A7=86=E5=9B=BE=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=8F=AF=E7=94=A8=E5=AE=BD=E5=BA=A6=E4=B8=8A=E9=99=90=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B6=85=E5=88=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/index.html | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/templates/index.html b/app/templates/index.html index daeac82..476acaa 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -13022,9 +13022,23 @@ // 计算主内容区域可用宽度 const availableWidth = windowWidth - sidebarWidth - 20; // 减去侧边栏宽度和左右边距 - + // 根据页面宽度模式应用最大宽度上限,避免中/窄模式下超限 + // 对应 CSS: .page-width-narrow/.page-width-medium/.page-width-wide 的 container-fluid max-width + let maxContentWidth; + if (this.pageWidthMode === 'narrow') { + maxContentWidth = 1440; // 与 CSS 保持一致 + } else if (this.pageWidthMode === 'medium') { + maxContentWidth = 1680; // 与 CSS 保持一致 + } else { + maxContentWidth = 2160; // 宽模式上限 + } + // 主内容区域在 Bootstrap 栅格中通常占 10/12 宽度(col-md-10 col-lg-10),需要按比例折算 + // 这里以可视窗口宽度估算容器宽度并取上限,再减去侧边栏与边距后作为可用宽度 + const containerMaxWidth = Math.min(windowWidth, maxContentWidth); + const maxAvailableByMode = containerMaxWidth - sidebarWidth - 20; + const boundedWidth = Math.min(availableWidth, maxAvailableByMode); - return Math.max(availableWidth, 300); // 确保最小可用宽度为300px + return Math.max(boundedWidth, 300); // 确保最小可用宽度为300px }, // 格式化日期为YYYY-MM-DD格式(使用本地时间)