From 533e6518476265543ef35044591b34e75cfcc903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 22 Jan 2024 13:49:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=8E=E7=89=88=E6=9C=AC=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/reportTable/index.tsx | 24 ++++++++ src/pages/salaryFileTable/index.tsx | 79 +++++++++++++++---------- src/pages/welfareArchiveTable/index.tsx | 63 ++++++++++---------- 3 files changed, 103 insertions(+), 63 deletions(-) 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) && - + - + - + - +