fix: footable height

This commit is contained in:
Zclhlmgqzc 2020-12-08 13:04:21 +08:00
parent 37787b610c
commit 7d0b1b1701
3 changed files with 41 additions and 35 deletions

View File

@ -25,7 +25,7 @@
&.in {
box-shadow: $Table-fixedLeft-boxShadow;
top: 0;
top: auto;
}
& > .#{$ns}Table-table {
@ -47,7 +47,7 @@
&.in {
box-shadow: $Table-fixedRight-boxShadow;
top: 0;
top: auto;
}
& > .#{$ns}Table-table {

View File

@ -137,39 +137,44 @@ export class TableRow extends React.Component<TableRowProps> {
})}
>
<td className={cx(`Table-foot`)} colSpan={footableColSpan}>
{ignoreFootableContent ? null : (
<table className={cx(`Table-footTable`)}>
<tbody>
{columns.map(column => (
<tr key={column.index}>
{column.label !== false ? (
<th>
{render(
`${regionPrefix}${itemIndex}/${column.index}/tpl`,
column.label
)}
</th>
) : null}
<table className={cx(`Table-footTable`)}>
<tbody>
{ignoreFootableContent
? columns.map(column => (
<tr key={column.index}>
{column.label !== false ? <th></th> : null}
<td></td>
</tr>
))
: columns.map(column => (
<tr key={column.index}>
{column.label !== false ? (
<th>
{render(
`${regionPrefix}${itemIndex}/${column.index}/tpl`,
column.label
)}
</th>
) : null}
{renderCell(
`${regionPrefix}${itemIndex}/${column.index}`,
column,
item,
{
...rest,
width: null,
rowIndex: itemIndex,
colIndex: column.rawIndex,
key: column.index,
onAction: this.handleAction,
onQuickChange: this.handleQuickChange
}
)}
</tr>
))}
</tbody>
</table>
)}
{renderCell(
`${regionPrefix}${itemIndex}/${column.index}`,
column,
item,
{
...rest,
width: null,
rowIndex: itemIndex,
colIndex: column.rawIndex,
key: column.index,
onAction: this.handleAction,
onQuickChange: this.handleQuickChange
}
)}
</tr>
))}
</tbody>
</table>
</td>
</tr>
);

View File

@ -790,8 +790,9 @@ export default class Table extends React.Component<TableProps, object> {
const dom = findDOMNode(this) as HTMLElement;
forEach(
// 折叠 footTable 不需要改变
dom.querySelectorAll(
`.${ns}Table-fixedTop table, .${ns}Table-fixedLeft table, .${ns}Table-fixedRight table`
`.${ns}Table-fixedTop table, .${ns}Table-fixedLeft>table, .${ns}Table-fixedRight>table`
),
(table: HTMLTableElement) => {
let totalWidth = 0;