fix(supply-chain): 修复组合单行表头遮挡明细

This commit is contained in:
居居 2026-10-19 14:07:06 +08:00 committed by WuYongJie
parent a843b643ed
commit 9360c553a2
3 changed files with 6 additions and 0 deletions

View File

@ -248,6 +248,7 @@ export function ComboLimitSection({
numeric={column.numeric} numeric={column.numeric}
hint="组合限价 = 各子商品限价 × 组合明细数量后相加" hint="组合限价 = 各子商品限价 × 组合明细数量后相加"
sortScope="all" sortScope="all"
stickyTop={0}
sort={sort ? { key: sort.field, direction: sort.direction } : null} sort={sort ? { key: sort.field, direction: sort.direction } : null}
menuOpen={openSortKey === column.key} menuOpen={openSortKey === column.key}
onToggleMenu={() => setOpenSortKey((current) => (current === column.key ? null : column.key))} onToggleMenu={() => setOpenSortKey((current) => (current === column.key ? null : column.key))}

View File

@ -271,6 +271,7 @@ describe('限价管理', () => {
expect(screen.getByText('运营甲')).toBeInTheDocument() expect(screen.getByText('运营甲')).toBeInTheDocument()
expect(document.querySelectorAll('[data-limit-filter]')).toHaveLength(2) expect(document.querySelectorAll('[data-limit-filter]')).toHaveLength(2)
expect(screen.getByRole('button', { name: '筛选运营负责人' })).toBeInTheDocument() 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()) const columnLabels = screen.getAllByRole('columnheader').map((cell) => (cell.textContent ?? '').replace(/[↕↑↓▾]/g, '').trim())
expect(columnLabels.indexOf('运营负责人')).toBe(columnLabels.indexOf('组合编码') + 1) expect(columnLabels.indexOf('运营负责人')).toBe(columnLabels.indexOf('组合编码') + 1)
expect(screen.queryByRole('button', { name: '导出明细' })).not.toBeInTheDocument() expect(screen.queryByRole('button', { name: '导出明细' })).not.toBeInTheDocument()

View File

@ -29,6 +29,8 @@ type Props = {
numeric?: boolean numeric?: boolean
hint?: string hint?: string
sortScope?: 'page' | 'all' sortScope?: 'page' | 'all'
/** 单行表头传 0;双行表头(含分组行)默认沿用 CSS 的 30px */
stickyTop?: number
onToggleMenu: () => void onToggleMenu: () => void
onCloseMenu: () => void onCloseMenu: () => void
onSort: (direction: 'asc' | 'desc') => void onSort: (direction: 'asc' | 'desc') => void
@ -52,6 +54,7 @@ export function LimitTableHeaderCell({
numeric, numeric,
hint, hint,
sortScope = 'page', sortScope = 'page',
stickyTop,
onToggleMenu, onToggleMenu,
onCloseMenu, onCloseMenu,
onSort, onSort,
@ -135,6 +138,7 @@ export function LimitTableHeaderCell({
return ( return (
<th <th
scope="col" scope="col"
style={stickyTop === undefined ? undefined : { top: stickyTop }}
className={[ className={[
styles.headTh, styles.headTh,
numeric ? styles.headThNumeric : '', numeric ? styles.headThNumeric : '',