(false);
+
+ useEffect(() => {
+ window.parent.postMessage({ type: "init" }, "*");
+ window.addEventListener("message", receiveMessageFromIndex, false);
+ return () => {
+ window.removeEventListener("message", receiveMessageFromIndex, false);
+ };
+ }, []);
+ const receiveMessageFromIndex = (event: any) => {
+ const data: any = exceptStr(event.data);
+ if (!_.isEmpty(data)) {
+ const { columns, dataSource, countResult, showSum, pageInfo } = data;
+ const { current: pageNum, pageSize: size, total } = pageInfo;
+ setDataSource(dataSource);
+ setColumns(_.map(columns, item => {
+ if (item.dataIndex === "salarySob") {
+ return {
+ ...item,
+ render: (text: string, r: { acctTimes?: number }) => {
+ return
+ {text}
+ {`第${r?.acctTimes}次`}
+
;
+ }
+ };
+ }
+ return { ...item };
+ }));
+ setShowSumrow(showSum);
+ setSumRow(countResult);
+ setPageInfo({ pageNum, size, total });
+ }
+ };
+ const sizeChange = (pageobj: IPage) => {
+ };
+ const onChange = (pageobj: IPage) => {
+ setPageInfo({ ...pageInfo, ...pageobj });
+ window.parent.postMessage(
+ {
+ type: "turn",
+ payload: { id: "PAGEINFO", params: { ...pageInfo, ...pageobj } }
+ },
+ "*"
+ );
+ };
+ return {
+ if (!showSumrow) return;
+ let totalColumns: any[] = [];
+ _.forEach(columns, it => {
+ if (!it.children) {
+ totalColumns.push(it);
+ } else {
+ totalColumns = [...totalColumns, ...it.children];
+ }
+ });
+ return (
+
+
+ {
+ _.map([...totalColumns], (item, index) => {
+ if (index === 0) {
+ return 总计;
+ }
+ return
+ {!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}
+ ;
+ })
+ }
+
+
+ );
+ }}
+ />;
+};
+
+export default CommonTable;
diff --git a/src/pages/payrollFilesTable/index.tsx b/src/pages/payrollFilesTable/index.tsx
new file mode 100644
index 0000000..d362798
--- /dev/null
+++ b/src/pages/payrollFilesTable/index.tsx
@@ -0,0 +1,249 @@
+import React, { FC, useEffect, useState } from "react";
+import { Button, Dropdown, Menu, Space, Spin, Table, Typography } from "antd";
+import { DownOutlined } from "@ant-design/icons";
+import { exceptStr, paginationFun } from "@/utils/common";
+import styles from "@/pages/atdTable/components/index.less";
+import { defaultPage, IPage } from "@/common/types";
+import cs from "classnames";
+
+const { Text } = Typography;
+const payrollFilesTable: FC = (props) => {
+ const [columns, setColumns] = useState>([]);
+ const [sumRow, setSumRow] = useState({});
+ const [pageInfo, setPageInfo] = useState(defaultPage);
+ const [dataSource, setDataSource] = useState>([]);
+ const [showSumrow, setShowSumrow] = useState(false);
+ const [selected, setSelected] = useState>([]);
+
+ useEffect(() => {
+ window.parent.postMessage({ type: "init" }, "*");
+ window.addEventListener("message", receiveMessageFromIndex, false);
+ return () => {
+ window.removeEventListener("message", receiveMessageFromIndex, false);
+ };
+ }, []);
+ const receiveMessageFromIndex = (event: any) => {
+ const data: any = exceptStr(event.data);
+ if (!_.isEmpty(data)) {
+ const {
+ columns,
+ dataSource,
+ countResult,
+ showSum,
+ pageInfo,
+ showOperateBtn,
+ selectedKey,
+ selectedRowKeys
+ } = data;
+ const { current: pageNum, pageSize: size, total } = pageInfo;
+ setDataSource(dataSource);
+ setColumns(_.map(columns, item => {
+ if (item.dataIndex === "operate") {
+ return {
+ ...item,
+ render: (text: string, r: { id?: string }) => {
+ let dom = null;
+ if (!showOperateBtn) {
+ dom = ;
+ } else {
+ if (selectedKey === "pending") {
+ dom =
+
+
+
+
+
+
+
+
+
+ }
+ >
+ 更多
+
+ ;
+ } else if (selectedKey === "fixed") {
+ dom = ;
+ } else if (selectedKey === "suspend") {
+ dom =
+
+
+
+
+
+
+
+
+
+ }
+ >
+ 更多
+
+ ;
+ } else {
+ dom =
+
+
+ ;
+ }
+ }
+ return dom;
+ }
+ };
+ }
+ return { ...item };
+ }));
+ setShowSumrow(showSum);
+ setSumRow(_.isEmpty(countResult) ? { [new Date().getTime()]: new Date().getTime() } : countResult);
+ setPageInfo({ pageNum, size, total });
+ setSelected(selectedRowKeys);
+ }
+ };
+ const handleMenuClick = (event: any, id?: string) => {
+ window.parent.postMessage(
+ {
+ type: "turn",
+ payload: { id: "MOREOPT", params: { id, event } }
+ },
+ "*"
+ );
+ };
+ const sizeChange = (pageobj: IPage) => {
+ };
+ const onChange = (pageobj: IPage) => {
+ setPageInfo({ ...pageInfo, ...pageobj });
+ window.parent.postMessage(
+ {
+ type: "turn",
+ payload: { id: "PAGEINFO", params: { ...pageInfo, ...pageobj } }
+ },
+ "*"
+ );
+ };
+
+ const rowSelection = {
+ selectedRowKeys: selected,
+ onChange: (selectedRowKeys: Array) => {
+ setSelected(selectedRowKeys);
+ window.parent.postMessage(
+ {
+ type: "turn",
+ payload: { id: "ROWSELECTION", params: { selectedRowKeys } }
+ },
+ "*"
+ );
+ }
+ };
+ return {
+ if (!showSumrow) return;
+ let totalColumns: any[] = [];
+ _.forEach(columns, it => {
+ if (!it.children) {
+ totalColumns.push(it);
+ } else {
+ totalColumns = [...totalColumns, ...it.children];
+ }
+ });
+ return (
+
+
+ {
+ sumRow.loading ? :
+ _.map([...totalColumns], (item, index) => {
+ if (index === 0) {
+ return 总计;
+ }
+ return
+ {!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}
+ ;
+ })
+ }
+
+
+ );
+ }}
+ />;
+};
+
+export default payrollFilesTable;
diff --git a/src/pages/reportTable/index.tsx b/src/pages/reportTable/index.tsx
index 12800fe..3559119 100644
--- a/src/pages/reportTable/index.tsx
+++ b/src/pages/reportTable/index.tsx
@@ -4,7 +4,7 @@ import { exceptStr } from "@/utils/common";
import styles from "@/pages/atdTable/components/index.less";
const { Text } = Typography;
-const PreviewTable: FC = (props) => {
+const ReportTable: FC = (props) => {
const [columns, setColumns] = useState>([]);
const [sumRow, setSumRow] = useState>({});
const [dataSource, setDataSource] = useState>([]);
@@ -67,4 +67,4 @@ const PreviewTable: FC = (props) => {
/>;
};
-export default PreviewTable;
+export default ReportTable;
diff --git a/src/pages/standingbookTable/index.tsx b/src/pages/standingbookTable/index.tsx
index 8309ad3..d1605d2 100644
--- a/src/pages/standingbookTable/index.tsx
+++ b/src/pages/standingbookTable/index.tsx
@@ -23,7 +23,6 @@ const StandingbookTable: FC = (props) => {
}, []);
const receiveMessageFromIndex = async (event: any) => {
const data: any = exceptStr(event.data);
- console.log("antd4", data);
if (!_.isEmpty(data)) {
const {
columns, dataSource, pageInfo, showOperates, selectedRowKeys,
From 5fddf15870b2e2f161c07ff6617ff18a5f7a42ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 26 May 2023 15:36:17 +0800
Subject: [PATCH 06/13] =?UTF-8?q?=E6=B3=9B=E5=BE=AE=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97iframe=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/atdTable/components/index.less | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/pages/atdTable/components/index.less b/src/pages/atdTable/components/index.less
index fd705a0..065aef4 100644
--- a/src/pages/atdTable/components/index.less
+++ b/src/pages/atdTable/components/index.less
@@ -56,6 +56,27 @@
}
}
+ .customSpan {
+ display: flex;
+ align-items: center;
+ width: 100%;
+ justify-content: space-between;
+
+ span.title {
+ flex: 1;
+ margin-right: 4px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ :global {
+ .ant-tag {
+ margin-right: 0;
+ }
+ }
+ }
+
:global {
.ant-btn-link {
font-size: 12px;
From c289b0eb117b4a01d8d793e414136af879cc707e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 26 May 2023 16:38:12 +0800
Subject: [PATCH 07/13] =?UTF-8?q?=E6=B3=9B=E5=BE=AE=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97iframe=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/atdTable/components/antdTable.tsx | 30 ++++++++++-----------
src/pages/atdTable/components/index.less | 24 ++++++++++++++++-
src/pages/payrollFilesTable/index.tsx | 2 ++
3 files changed, 40 insertions(+), 16 deletions(-)
diff --git a/src/pages/atdTable/components/antdTable.tsx b/src/pages/atdTable/components/antdTable.tsx
index 8eb8de7..2d94f5c 100644
--- a/src/pages/atdTable/components/antdTable.tsx
+++ b/src/pages/atdTable/components/antdTable.tsx
@@ -1,7 +1,7 @@
import React, { FC, useEffect, useState } from "react";
import { exceptStr, paginationFun } from "@/utils/common";
import { defaultPage, ILoading, IPage } from "@/common/types/page";
-import { message, Spin, Table, Typography } from "antd";
+import { Button, message, Spin, Table, Typography } from "antd";
import { LockOutlined, UnlockOutlined } from "@ant-design/icons";
import API from "@/api";
import styles from "./index.less";
@@ -66,7 +66,7 @@ const AntdTable: FC = (props) => {
const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" });
setShowSumrow(confCode.data.status && confCode.data.data === "1");
if (confCode.data.status && confCode.data.data === "1") {
- const sumRowlist: any = await API.CalculateService.getAcctresultsum({...extraParams["queryParams"]});
+ const sumRowlist: any = await API.CalculateService.getAcctresultsum({ ...extraParams["queryParams"] });
if (sumRowlist.data.status && !_.isEmpty(sumRowlist.data.data.sumRow)) {
setSumRow(sumRowlist.data.data.sumRow);
}
@@ -86,19 +86,19 @@ const AntdTable: FC = (props) => {
title: "操作",
render: (text: string, record: any) => {
return (
- {
- window.parent.postMessage(
- {
- type: "PC",
- data: { id: "DELETE", data: record }
- },
- "*"
- );
- }}
+
+
);
}
}];
@@ -278,7 +278,7 @@ const AntdTable: FC = (props) => {
width: "100px",
fixed: "right",
render: (text: string, record: any) => {
- return {
+ return ;
+ }}>编辑;
}
});
return tmpColumns;
diff --git a/src/pages/atdTable/components/index.less b/src/pages/atdTable/components/index.less
index 065aef4..01aed87 100644
--- a/src/pages/atdTable/components/index.less
+++ b/src/pages/atdTable/components/index.less
@@ -78,8 +78,17 @@
}
:global {
- .ant-btn-link {
+ .ant-btn-link, .ant-dropdown-trigger {
font-size: 12px;
+ color: #333;
+ }
+
+ .ant-btn-link:hover {
+ color: #00a9ff;
+
+ span {
+ text-decoration: underline;
+ }
}
.ant-table-tbody > tr.ant-table-row:hover > td {
@@ -156,6 +165,19 @@
.moreIconWrapper {
:global {
+ .ant-btn-link {
+ font-size: 12px;
+ color: #333;
+ }
+
+ .ant-btn-link:hover {
+ color: #00a9ff;
+
+ span {
+ text-decoration: underline;
+ }
+ }
+
.ant-popover-inner {
min-width: 106px
}
diff --git a/src/pages/payrollFilesTable/index.tsx b/src/pages/payrollFilesTable/index.tsx
index d362798..4afa0a9 100644
--- a/src/pages/payrollFilesTable/index.tsx
+++ b/src/pages/payrollFilesTable/index.tsx
@@ -70,6 +70,7 @@ const payrollFilesTable: FC = (props) => {
编辑
@@ -113,6 +114,7 @@ const payrollFilesTable: FC = (props) => {
编辑
From d8aa0397412f34b16ede441370257a0b80703257 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Tue, 30 May 2023 09:51:04 +0800
Subject: [PATCH 08/13] =?UTF-8?q?=E6=B3=9B=E5=BE=AE=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97iframe=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/atdTable/components/antdTable.tsx | 2 +-
src/pages/commonTable/index.tsx | 2 +-
src/pages/payrollFilesTable/index.tsx | 5 +++--
src/pages/standingbookTable/index.tsx | 2 +-
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/pages/atdTable/components/antdTable.tsx b/src/pages/atdTable/components/antdTable.tsx
index 2d94f5c..9c542f6 100644
--- a/src/pages/atdTable/components/antdTable.tsx
+++ b/src/pages/atdTable/components/antdTable.tsx
@@ -361,7 +361,7 @@ const AntdTable: FC = (props) => {
_.isEmpty(sumRow) ? :
_.map([{}, ...totalColumns], (item, index) => {
if (index === 0) {
- return 总计;
+ return 总计;
}
return
{sumRow[item.dataIndex] || "-"}
diff --git a/src/pages/commonTable/index.tsx b/src/pages/commonTable/index.tsx
index 840978f..4acab2b 100644
--- a/src/pages/commonTable/index.tsx
+++ b/src/pages/commonTable/index.tsx
@@ -84,7 +84,7 @@ const CommonTable: FC = (props) => {
{
_.map([...totalColumns], (item, index) => {
if (index === 0) {
- return 总计;
}
return
diff --git a/src/pages/payrollFilesTable/index.tsx b/src/pages/payrollFilesTable/index.tsx
index 4afa0a9..d47ac2c 100644
--- a/src/pages/payrollFilesTable/index.tsx
+++ b/src/pages/payrollFilesTable/index.tsx
@@ -189,6 +189,7 @@ const payrollFilesTable: FC = (props) => {
};
const rowSelection = {
+ columnWidth: 50,
selectedRowKeys: selected,
onChange: (selectedRowKeys: Array) => {
setSelected(selectedRowKeys);
@@ -231,9 +232,9 @@ const payrollFilesTable: FC = (props) => {
{
sumRow.loading ? :
- _.map([...totalColumns], (item, index) => {
+ _.map([{},...totalColumns], (item, index) => {
if (index === 0) {
- return 总计;
}
return
diff --git a/src/pages/standingbookTable/index.tsx b/src/pages/standingbookTable/index.tsx
index d1605d2..595872b 100644
--- a/src/pages/standingbookTable/index.tsx
+++ b/src/pages/standingbookTable/index.tsx
@@ -138,7 +138,7 @@ const StandingbookTable: FC = (props) => {
_.isEmpty(sumRow) ? :
_.map(columns, (item, index) => {
if (index === 0) {
- return 总计;
}
return
From bbf2a4ebdbd0845c6bd41266f945f4aacdc194ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Tue, 30 May 2023 17:06:33 +0800
Subject: [PATCH 09/13] =?UTF-8?q?=E6=B3=9B=E5=BE=AE=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97iframe=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/atdTable/components/index.less | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/pages/atdTable/components/index.less b/src/pages/atdTable/components/index.less
index 01aed87..928ff6c 100644
--- a/src/pages/atdTable/components/index.less
+++ b/src/pages/atdTable/components/index.less
@@ -117,6 +117,15 @@
}
}
+ .ant-pagination-item-active {
+ background: var(--ant-primary-color);
+ border: none;
+
+ & > a {
+ color: #FFF;
+ }
+ }
+
.ant-pagination-options {
.ant-select {
font-size: 12px;
From cc3a671f7c4aa1248eb5f84177668458c2bf0fc9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Thu, 1 Jun 2023 13:36:29 +0800
Subject: [PATCH 10/13] =?UTF-8?q?=E6=B3=9B=E5=BE=AE=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97iframe=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/standingbookTable/index.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/pages/standingbookTable/index.tsx b/src/pages/standingbookTable/index.tsx
index 595872b..56275fb 100644
--- a/src/pages/standingbookTable/index.tsx
+++ b/src/pages/standingbookTable/index.tsx
@@ -106,6 +106,7 @@ const StandingbookTable: FC = (props) => {
};
const rowSelection = {
selectedRowKeys: selected,
+ columnWidth: 80,
onChange: (selectedRowKeys: Array) => {
setSelected(selectedRowKeys);
window.parent.postMessage(
@@ -136,9 +137,9 @@ const StandingbookTable: FC = (props) => {
{
_.isEmpty(sumRow) ? :
- _.map(columns, (item, index) => {
+ _.map([{}, ...columns], (item, index) => {
if (index === 0) {
- return 总计;
}
return
From f9723da384574ce63092b99c3c03b7d553831f2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Thu, 8 Jun 2023 14:55:22 +0800
Subject: [PATCH 11/13] =?UTF-8?q?=E6=B3=9B=E5=BE=AE=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97iframe=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/reportTable/index.tsx | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/pages/reportTable/index.tsx b/src/pages/reportTable/index.tsx
index 3559119..fd3859c 100644
--- a/src/pages/reportTable/index.tsx
+++ b/src/pages/reportTable/index.tsx
@@ -1,5 +1,5 @@
import React, { FC, useEffect, useState } from "react";
-import { Table, Typography } from "antd";
+import { Button, Table, Typography } from "antd";
import { exceptStr } from "@/utils/common";
import styles from "@/pages/atdTable/components/index.less";
@@ -22,9 +22,29 @@ const ReportTable: FC = (props) => {
if (!_.isEmpty(data)) {
const { columns, dataSource, countResult, showSum } = data;
setDataSource(dataSource);
- setColumns(columns);
setShowSumrow(showSum);
setSumRow(countResult);
+ setColumns(_.map(columns, item => {
+ return {
+ ...item,
+ children: _.map(item.children, child => {
+ return {
+ ...child,
+ render: (text: string, record: any) => {
+ return ;
+ }
+ };
+ })
+ };
+ }));
}
};
return
Date: Mon, 19 Jun 2023 13:57:09 +0800
Subject: [PATCH 12/13] =?UTF-8?q?=E6=B3=9B=E5=BE=AE=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97iframe=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 4eae9e3..0824865 100644
--- a/package.json
+++ b/package.json
@@ -57,7 +57,6 @@
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@umijs/plugin-access": "2.4.2",
- "umi-plugin-authorize": "^2.8.12",
"@umijs/plugin-dva": "^0.13.0",
"@umijs/plugin-initial-state": "^2.4.0",
"@umijs/plugin-locale": "^0.15.0",
@@ -70,6 +69,7 @@
"prettier": "^2.2.0",
"typescript": "^4.3.5",
"umi": "^3.5.20",
+ "umi-plugin-authorize": "^2.8.12",
"yorkie": "^2.0.0"
}
}
From 81c648f5ab126383a39dff1e42617ed2b569124c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Tue, 20 Jun 2023 16:47:34 +0800
Subject: [PATCH 13/13] =?UTF-8?q?=E6=B3=9B=E5=BE=AE=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97iframe=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/payrollFilesTable/index.tsx | 9 +++++----
src/utils/common.js | 13 +++++++++++--
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/pages/payrollFilesTable/index.tsx b/src/pages/payrollFilesTable/index.tsx
index d47ac2c..dd02c76 100644
--- a/src/pages/payrollFilesTable/index.tsx
+++ b/src/pages/payrollFilesTable/index.tsx
@@ -1,7 +1,7 @@
import React, { FC, useEffect, useState } from "react";
import { Button, Dropdown, Menu, Space, Spin, Table, Typography } from "antd";
import { DownOutlined } from "@ant-design/icons";
-import { exceptStr, paginationFun } from "@/utils/common";
+import { convertColumns, exceptStr, paginationFun } from "@/utils/common";
import styles from "@/pages/atdTable/components/index.less";
import { defaultPage, IPage } from "@/common/types";
import cs from "classnames";
@@ -158,7 +158,7 @@ const payrollFilesTable: FC = (props) => {
}
};
}
- return { ...item };
+ return _.omitBy({ ...item }, item => !item);
}));
setShowSumrow(showSum);
setSumRow(_.isEmpty(countResult) ? { [new Date().getTime()]: new Date().getTime() } : countResult);
@@ -202,13 +202,14 @@ const payrollFilesTable: FC = (props) => {
);
}
};
+
return {
{
sumRow.loading ? :
- _.map([{},...totalColumns], (item, index) => {
+ _.map([{}, ...totalColumns], (item, index) => {
if (index === 0) {
return 总计;
diff --git a/src/utils/common.js b/src/utils/common.js
index 13c0b0e..be7dc7c 100644
--- a/src/utils/common.js
+++ b/src/utils/common.js
@@ -49,6 +49,15 @@ export const getPicSuffix = () => {
return config.get("picSuffix");
};
+/**
+ * 数组中某项移至数组末尾
+ * @returns {array}
+ */
+export const convertColumns = (array, fromIndex, toIndex) => {
+ array.splice(toIndex, 1, array.splice(fromIndex, 1)[0]);
+ return array;
+};
+
/**
* 判断是否为JSON字符串
* @returns {string}
@@ -76,8 +85,8 @@ export const paginationFun = (tableListPageObj, sizeChange, onChange) => {
onChange({
pageNum: page,
size,
- total,
+ total
});
- },
+ }
};
};