diff --git a/src/pages/reportTable/index.tsx b/src/pages/reportTable/index.tsx index c1e3e6b..61f1fef 100644 --- a/src/pages/reportTable/index.tsx +++ b/src/pages/reportTable/index.tsx @@ -59,6 +59,30 @@ const ReportTable: FC = (props) => { bordered size="small" scroll={{ x: 1200, y: `calc(100vh - 109px)` }} + summary={() => { + if (!showSumrow) return; + let totalColumns: any[] = []; + _.forEach(columns, it => { + if (_.isEmpty(it.children)) { + totalColumns.push(it); + } else { + totalColumns = [...totalColumns, ...it.children]; + } + }); + return ( + + + { + _.map(totalColumns, (item, index) => { + return + {!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"} + ; + }) + } + + + ); + }} />; }; diff --git a/src/pages/salaryFileTable/index.tsx b/src/pages/salaryFileTable/index.tsx index 52f96f8..3e0cc16 100644 --- a/src/pages/salaryFileTable/index.tsx +++ b/src/pages/salaryFileTable/index.tsx @@ -9,7 +9,7 @@ import { ColumnType } from "antd/lib/table"; import { PaginationData } from "rc-pagination"; import styles from "@/pages/atdTable/components/index.less"; import { exceptStr, paginationAction } from "@/utils/common"; -import { Button, Dropdown, MenuProps, Space, Table } from "antd"; +import { Button, Dropdown, Menu, Space, Table } from "antd"; import { MoreOutlined } from "@ant-design/icons"; interface OwnProps { @@ -96,24 +96,34 @@ const Index: FunctionComponent = (props) => { opts = { ...opts, render: (__: any, record: any) => { - let items: MenuProps["items"] = [ - { - key: "DeleteTodoList", - label: i18n["删除待办"], - onClick: () => handleSalaryFileOperate("DEL-PENDITNG-TO-DO", record, [record?.id]) - }, - { - key: "DeleteFiles", - label: i18n["删除档案"], - onClick: () => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id]) - } - ]; - !showDelSalaryFileBtn && (items = _.dropRight(items)); + const items = !showDelSalaryFileBtn ? ( + + + handleSalaryFileOperate("DEL-PENDITNG-TO-DO", [record?.id])}> + {i18n["删除待办"]} + + + + ) : + + handleSalaryFileOperate("DEL-PENDITNG-TO-DO", [record?.id])}> + {i18n["删除待办"]} + + + + handleSalaryFileOperate("DEL-SALARY-FILES", [record?.id])}> + {i18n["删除档案"]} + + + ; return ( - + - + { !_.isEmpty(stopItems) && - + - + - + - +