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 ? (
+
+ ) : ;
return (
-
+
);
@@ -133,18 +143,21 @@ const Index: FunctionComponent = (props) => {
opts = {
...opts,
render: (__: any, record: any) => {
- const downsizingItems: MenuProps["items"] = [
- {
- key: "DeleteTodoList",
- label: i18n["删除待办"],
- onClick: () => handleSalaryFileOperate("DEL-SUSPEND-TO-DO", record, [record?.id])
- }
- ];
+ const downsizingItems = (
+
+ );
return (
-
+
);
@@ -155,21 +168,23 @@ const Index: FunctionComponent = (props) => {
opts = {
...opts,
render: (__: any, record: any) => {
- let stopItems: MenuProps["items"] = [
- {
- key: "CancelSuspension",
- label: i18n["删除档案"],
- onClick: () => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id])
- }
- ];
- !showDelSalaryFileBtn && (stopItems = _.dropRight(stopItems));
+ const stopItems = showDelSalaryFileBtn ? (
+
+ ) : null;
return (
{
!_.isEmpty(stopItems) &&
-
+
}
diff --git a/src/pages/welfareArchiveTable/index.tsx b/src/pages/welfareArchiveTable/index.tsx
index 50c09f9..7f675dd 100644
--- a/src/pages/welfareArchiveTable/index.tsx
+++ b/src/pages/welfareArchiveTable/index.tsx
@@ -9,8 +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 type { MenuProps } from "antd";
-import { Button, Dropdown, Space, Table } from "antd";
+import { Button, Dropdown, Menu, Space, Table } from "antd";
import { MoreOutlined } from "@ant-design/icons";
interface OwnProps {
@@ -94,22 +93,18 @@ const Index: FunctionComponent = (props) => {
opts = {
...opts,
render: (__: any, record: any) => {
- const items: MenuProps["items"] = [
- {
- key: "DeleteFiles",
- label: i18n["删除档案"],
- onClick: () => handleWelfareOperate("DEL-ARCHIVE", record)
- },
- {
- key: "DeleteTodoList",
- label: i18n["删除待办"],
- onClick: () => handleWelfareOperate("DEL-TO-DO", record, { runStatus: "4" })
- }
- ];
+ const items = (
+
+ );
return (
-
+
);
@@ -128,18 +123,21 @@ const Index: FunctionComponent = (props) => {
opts = {
...opts,
render: (__: any, record: any) => {
- const downsizingItems: MenuProps["items"] = [
- {
- key: "DeleteTodoList",
- label: i18n["删除待办"],
- onClick: () => handleWelfareOperate("DEL-TO-DO-STAY", record, { runStatus: "3" })
- }
- ];
+ const downsizingItems = (
+
+ );
return (
-
+
);
@@ -150,18 +148,21 @@ const Index: FunctionComponent = (props) => {
opts = {
...opts,
render: (__: any, record: any) => {
- const stopItems: MenuProps["items"] = [
- {
- key: "CancelSuspension",
- label: i18n["取消停缴"],
- onClick: () => handleWelfareOperate("CANCEL-STOP", record)
- }
- ];
+ const stopItems = (
+
+ );
return (
-
+
);