添加页面合计

This commit is contained in:
liu
2026-09-16 23:51:57 +08:00
parent 80cbd452e5
commit 751e8a196c
5 changed files with 129 additions and 2 deletions
+17
View File
@@ -245,6 +245,22 @@ const PaymentPage: React.FC = () => {
) : null,
];
/** 列表底部合计行:统计当前页的支付金额 */
const renderListSummary: TableProps<IPayment>['summary'] = (pageData) => {
const totalAmount = pageData.reduce((sum, row) => sum + Number(row.amount ?? 0), 0);
return (
<Table.Summary.Row>
<Table.Summary.Cell index={0} colSpan={2} align="center">
<Text strong>本页合计</Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={2} align="center">
<Text strong type="danger">¥{totalAmount.toFixed(2)}</Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={3} colSpan={6} />
</Table.Summary.Row>
);
};
const tableProps: XinTableProps<IPayment> = {
api: '/recon/payment',
columns,
@@ -253,6 +269,7 @@ const PaymentPage: React.FC = () => {
tableRef,
operateRender,
formProps: false,
summary: renderListSummary,
actionBarRender: (dom) => [dom.search, dom.keywordSearch],
};