From 693a8576eead0daaab5b1e2d8bc5bd4c4470f0be Mon Sep 17 00:00:00 2001 From: zhengwr Date: Sat, 13 Jun 2026 22:01:58 +0800 Subject: [PATCH] =?UTF-8?q?amis-theme:=20treegrid=20=E5=B7=A6=E6=A0=91?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E8=B7=9F=E9=9A=8F=E8=A7=86=E5=8F=A3(.cxd-Tre?= =?UTF-8?q?e=20max-height=20=E8=A7=86=E5=8F=A3=E7=9B=B8=E5=AF=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit amis .cxd-Tree--outline 默认 max-height:300px,treegrid 多级分类树「只露一半」、 下方大片留白。转换器给 treegrid 左树挂 className=eip4-treegrid-tree(见 TemplateToAmisConverter.convertTreeGrid),这里把该类内 .cxd-Tree max-height 抬到 calc(100vh-230px)+内部滚动——填满可用区域、超出树内滚(既非定高只露一半, 也非随内容无限撑高)。浏览器实证树高 615px、底部 783<视口 845。 Co-Authored-By: Claude Opus 4.8 (1M context) --- src/shell/amis-theme.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/shell/amis-theme.css b/src/shell/amis-theme.css index 8d53586..211196f 100644 --- a/src/shell/amis-theme.css +++ b/src/shell/amis-theme.css @@ -302,3 +302,15 @@ justify-content: flex-end; padding: 10px 0 4px; } + +/* ============================================================================ + 9. TreeGrid 左树高度跟随视口 + amis 的 .cxd-Tree--outline 默认 max-height:300px,多级分类树会「只露一半」、 + 下方大片留白。转换器给 treegrid 左树挂 className eip4-treegrid-tree + (见 TemplateToAmisConverter.convertTreeGrid),这里把其内树容器抬到视口相对 + 高度并内部滚动——填满可用区域、超出在树内滚(既非定高只露一半,也非随内容无限撑高)。 + ============================================================================ */ +.amis-scope .eip4-treegrid-tree .cxd-Tree, +.amis-scope .eip4-treegrid-tree.cxd-Tree { + max-height: calc(100vh - 230px); +}