From caceb2868d278cc67c8cb338c1d889d7a8a524e9 Mon Sep 17 00:00:00 2001 From: Syngnat Date: Wed, 18 Mar 2026 18:01:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(data-grid):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E8=A2=AB=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E8=A3=81=E5=89=AA=E5=92=8C=E5=85=A8=E9=80=89checkbox?= =?UTF-8?q?=E6=9C=AA=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 单元格右键菜单增加视口边界检测,底部/右侧空间不足时自动偏移 - 菜单容器添加 maxHeight + overflowY auto,确保所有选项可滚动访问 - 修复表头选择列 TH 无 class(虚拟模式),用 :first-child 统一 padding 和对齐 - 行右键菜单 Dropdown 挂载到 document.body 并启用 autoAdjustOverflow --- frontend/src/components/DataGrid.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/frontend/src/components/DataGrid.tsx b/frontend/src/components/DataGrid.tsx index dd98cef..b4b10bb 100644 --- a/frontend/src/components/DataGrid.tsx +++ b/frontend/src/components/DataGrid.tsx @@ -1373,6 +1373,25 @@ const DataGrid: React.FC = ({ .${gridId} .ant-table-tbody > tr > td, .${gridId} .ant-table-tbody .ant-table-row > .ant-table-cell { background: transparent !important; border-bottom: 1px solid ${darkMode ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.05)'} !important; border-inline-end: 1px solid transparent !important; } .${gridId} .ant-table-thead > tr > th { background: transparent !important; border-bottom: 1px solid ${darkMode ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.05)'} !important; border-inline-end: 1px solid transparent !important; } + /* 选择列对齐:header TH 无 class(Ant Design 虚拟模式),需用 :first-child 匹配 */ + .${gridId} .ant-table-selection-col, + .${gridId} .ant-table-bordered .ant-table-selection-col, + .${gridId} .ant-table-selection-col.ant-table-selection-col-with-dropdown { + width: ${selectionColumnWidth}px !important; + } + .${gridId} .ant-table-header th:first-child, + .${gridId} .ant-table-thead > tr > th:first-child { + text-align: center !important; + padding-inline-start: 0 !important; + padding-inline-end: 0 !important; + padding-left: 0 !important; + padding-right: 0 !important; + } + .${gridId} .ant-table-selection-column { + text-align: center !important; + padding-inline-start: 0 !important; + padding-inline-end: 0 !important; + } .${gridId} .ant-table-thead > tr:first-child > th:first-child, .${gridId} .ant-table-header table > thead > tr:first-child > th:first-child { border-top-left-radius: ${panelRadius}px !important;