You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
769 B
TypeScript
36 lines
769 B
TypeScript
11 months ago
|
/*
|
||
|
*
|
||
|
* 合计行
|
||
|
* @Author: 黎永顺
|
||
|
* @Date: 2024/5/24
|
||
|
* @Wechat:
|
||
|
* @Email: 971387674@qq.com
|
||
|
* @description:
|
||
|
*/
|
||
|
import React, { FunctionComponent } from "react";
|
||
|
import { Table, Typography } from "antd";
|
||
|
import { ColumnType } from "antd/lib/table";
|
||
|
|
||
|
const { Text } = Typography;
|
||
|
|
||
|
interface OwnProps {
|
||
|
columns: ColumnType<any>[];
|
||
|
sumRow: any;
|
||
|
}
|
||
|
|
||
|
type Props = OwnProps;
|
||
|
|
||
|
const sumTotal: FunctionComponent<Props> = (props) => {
|
||
|
return (<>
|
||
|
{
|
||
|
_.map(props.columns, (item: any, index) => {
|
||
|
return <Table.Summary.Cell index={index + 1} key={index + 1}>
|
||
|
<Text>{!_.isEmpty(props?.sumRow) ? props?.sumRow[item.dataIndex] : "-"}</Text>
|
||
|
</Table.Summary.Cell>;
|
||
|
})
|
||
|
}
|
||
|
</>);
|
||
|
};
|
||
|
|
||
|
export default sumTotal;
|