From 3402b56fdb4786e6edd266f4b6377aa79b88f4e5 Mon Sep 17 00:00:00 2001 From: Syngnat Date: Wed, 1 Apr 2026 15:03:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20style(data-grid):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E7=AD=9B=E9=80=89=E9=9D=A2=E6=9D=BF=E4=B8=BA=20flex?= =?UTF-8?q?=20=E5=88=86=E5=8C=BA=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 外层改为 flex column,拆分为可滚动内容区(maxHeight: 200px)和固定操作栏 - "添加排序"从内容区提升到操作栏,条件渲染依赖 onSort 存在性 - "添加条件"使用 primary ghost 按钮增强辨识度 - refs #295 --- frontend/src/components/DataGrid.tsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/DataGrid.tsx b/frontend/src/components/DataGrid.tsx index 53112ac..9d168ce 100644 --- a/frontend/src/components/DataGrid.tsx +++ b/frontend/src/components/DataGrid.tsx @@ -4801,7 +4801,11 @@ const DataGrid: React.FC = ({ padding: `${filterTopPadding}px ${panelPaddingX}px ${panelPaddingY}px ${panelPaddingX}px`, background: 'transparent', boxSizing: 'border-box', + display: 'flex', + flexDirection: 'column', }}> + {/* 筛选条件 + 排序区域:固定最大高度,超出后可滚动,避免条件过多挤压数据表 */} +
{filterConditions.map((cond, condIndex) => (
= ({ }} />
))} -
)} -
0) ? 4 : 0, paddingTop: (onSort && sortInfo.length > 0) ? 6 : 0, borderTop: (onSort && sortInfo.length > 0) ? `1px dashed ${panelFrameColor}` : 'none' }}> - +
+
0) || filterConditions.length > 0 ? 4 : 0, paddingTop: (onSort && sortInfo.length > 0) || filterConditions.length > 0 ? 6 : 0, borderTop: (onSort && sortInfo.length > 0) || filterConditions.length > 0 ? `1px dashed ${panelFrameColor}` : 'none' }}> + + {onSort && ( + + )}