diff --git a/furniture-3d-system/src/app/supply-chain/management/custom-table/ComboLimitSection.tsx b/furniture-3d-system/src/app/supply-chain/management/custom-table/ComboLimitSection.tsx index aeb8993c..eff8ed8c 100644 --- a/furniture-3d-system/src/app/supply-chain/management/custom-table/ComboLimitSection.tsx +++ b/furniture-3d-system/src/app/supply-chain/management/custom-table/ComboLimitSection.tsx @@ -248,6 +248,7 @@ export function ComboLimitSection({ numeric={column.numeric} hint="组合限价 = 各子商品限价 × 组合明细数量后相加" sortScope="all" + stickyTop={0} sort={sort ? { key: sort.field, direction: sort.direction } : null} menuOpen={openSortKey === column.key} onToggleMenu={() => setOpenSortKey((current) => (current === column.key ? null : column.key))} diff --git a/furniture-3d-system/src/app/supply-chain/management/custom-table/CustomTableView.test.tsx b/furniture-3d-system/src/app/supply-chain/management/custom-table/CustomTableView.test.tsx index 36643a75..cde9c190 100644 --- a/furniture-3d-system/src/app/supply-chain/management/custom-table/CustomTableView.test.tsx +++ b/furniture-3d-system/src/app/supply-chain/management/custom-table/CustomTableView.test.tsx @@ -271,6 +271,7 @@ describe('限价管理', () => { expect(screen.getByText('运营甲')).toBeInTheDocument() expect(document.querySelectorAll('[data-limit-filter]')).toHaveLength(2) expect(screen.getByRole('button', { name: '筛选运营负责人' })).toBeInTheDocument() + expect((screen.getByRole('columnheader', { name: /^组合编码/ }) as HTMLElement).style.top).toBe('0px') const columnLabels = screen.getAllByRole('columnheader').map((cell) => (cell.textContent ?? '').replace(/[↕↑↓▾]/g, '').trim()) expect(columnLabels.indexOf('运营负责人')).toBe(columnLabels.indexOf('组合编码') + 1) expect(screen.queryByRole('button', { name: '导出明细' })).not.toBeInTheDocument() diff --git a/furniture-3d-system/src/app/supply-chain/management/custom-table/LimitTableHeaderCell.tsx b/furniture-3d-system/src/app/supply-chain/management/custom-table/LimitTableHeaderCell.tsx index 62529091..46434218 100644 --- a/furniture-3d-system/src/app/supply-chain/management/custom-table/LimitTableHeaderCell.tsx +++ b/furniture-3d-system/src/app/supply-chain/management/custom-table/LimitTableHeaderCell.tsx @@ -29,6 +29,8 @@ type Props = { numeric?: boolean hint?: string sortScope?: 'page' | 'all' + /** 单行表头传 0;双行表头(含分组行)默认沿用 CSS 的 30px */ + stickyTop?: number onToggleMenu: () => void onCloseMenu: () => void onSort: (direction: 'asc' | 'desc') => void @@ -52,6 +54,7 @@ export function LimitTableHeaderCell({ numeric, hint, sortScope = 'page', + stickyTop, onToggleMenu, onCloseMenu, onSort, @@ -135,6 +138,7 @@ export function LimitTableHeaderCell({ return (