master
lys 4 months ago
parent 7a74b371a1
commit c8dabd2918

@ -61,7 +61,7 @@ const calcFixedTotal: FunctionComponent<Props> = (props) => {
return <Table.Summary.Cell index={index + 1} key={index + 1} align={_.head(columns)?.align || "left"}> return <Table.Summary.Cell index={index + 1} key={index + 1} align={_.head(columns)?.align || "left"}>
{ {
loading ? <Spin spinning={loading} size="small"></Spin> : loading ? <Spin spinning={loading} size="small"></Spin> :
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text> <Text type="danger">{(sumRow && !_.isNil(sumRow[item.dataIndex])) ? sumRow[item.dataIndex] : "-"}</Text>
} }
</Table.Summary.Cell>; </Table.Summary.Cell>;
}) })

@ -239,9 +239,9 @@ const index: FunctionComponent<Props> = (props) => {
}); });
}; };
const rowSelection = { const rowSelection = {
columnWidth: 60, columnWidth: 50,
columnTitle: isDetailTable && !showTotalCell ? "序号" : "", columnTitle: isDetailTable ? "序号" : "",
renderCell: (value: boolean, record: any, index: number, originNode: React.ReactNode) => (isDetailTable && !showTotalCell ? <span>{index + 1}</span> : originNode), renderCell: (value: boolean, record: any, index: number, originNode: React.ReactNode) => (isDetailTable ? <span>{index + 1}</span> : originNode),
selectedRowKeys, selectedRowKeys,
preserveSelectedRowKeys: true, preserveSelectedRowKeys: true,
onChange: (rowKeys: React.Key[]) => { onChange: (rowKeys: React.Key[]) => {

Loading…
Cancel
Save