diff --git a/src/global.less b/src/global.less
index 5711cfd..efe5926 100644
--- a/src/global.less
+++ b/src/global.less
@@ -70,9 +70,9 @@ div,
iframe,
aside,
main {
- scrollbar-color: #ccc transparent;
+ //scrollbar-color: #ccc transparent;
/* 第一个方块颜色,第二个轨道颜色(用于更改火狐浏览器样式) */
- scrollbar-width: thin;
+ //scrollbar-width: thin;
/* 火狐滚动条无法自定义宽度,只能通过此属性使滚动条宽度变细 */
&::-webkit-scrollbar-track {
diff --git a/src/layouts/config.js b/src/layouts/config.js
index f26707a..b58bc96 100644
--- a/src/layouts/config.js
+++ b/src/layouts/config.js
@@ -23,6 +23,7 @@ module.exports = {
"/welfareArchiveTable.*": "blank",
"/salaryFileTable.*": "blank",
"/OCTable.*": "blank",
+ "/unitTable.*": "blank",
"/manage.*": "manage",
"/portal.*": "template",
"/passport/oauth-in": "blank",
diff --git a/src/pages/taxDeclareTable/index.tsx b/src/pages/taxDeclareTable/index.tsx
index 1e4cef7..28d90b0 100644
--- a/src/pages/taxDeclareTable/index.tsx
+++ b/src/pages/taxDeclareTable/index.tsx
@@ -40,7 +40,7 @@ const TaxDeclareTable: FC = (props) => {
render: (_: any, record: any) => (
- {/**/}
+
)
}
diff --git a/src/pages/unitTable/index.less b/src/pages/unitTable/index.less
new file mode 100644
index 0000000..40485fe
--- /dev/null
+++ b/src/pages/unitTable/index.less
@@ -0,0 +1,123 @@
+.multi_fun_table {
+ background: #fff;
+
+ :global {
+ .ant-btn-link {
+ height: inherit !important;
+ }
+
+ .ant-btn-link, .ant-dropdown-trigger {
+ padding: 0;
+ font-size: 12px;
+ color: #333;
+ }
+
+ .ant-btn-link:hover {
+ color: #00a9ff;
+
+ span {
+ text-decoration: underline;
+ }
+ }
+
+ .ant-table-tbody > tr.ant-table-row:hover > td {
+ background: #e9f7ff;
+ }
+
+ .anticon-more {
+ font-size: 16px;
+ cursor: pointer;
+ }
+
+ .ant-spin-container {
+ .ant-pagination {
+ font-size: 12px;
+ align-items: center;
+ margin-right: 8px;
+
+ .ant-pagination-item, .ant-pagination-prev, .ant-pagination-next {
+ min-width: 28px;
+ height: 28px;
+ line-height: 28px;
+ border-radius: 6px;
+
+ & > button {
+ border-radius: 6px;
+ }
+ }
+
+ .ant-pagination-item-active {
+ background: var(--ant-primary-color);
+ border: none;
+
+ & > a {
+ color: #FFF;
+ }
+ }
+
+ .ant-pagination-options {
+ .ant-select {
+ font-size: 12px;
+
+ .ant-select-selector {
+ height: 28px;
+ border-radius: 6px;
+
+ .ant-select-selection-search-input {
+ height: 26px;
+ line-height: 26px;
+ }
+
+ .ant-select-selection-item {
+ line-height: 26px;
+ }
+ }
+
+ .ant-select-item {
+ font-size: 12px;
+ }
+ }
+
+ .ant-pagination-options-quick-jumper {
+ height: 28px;
+ line-height: 28px;
+
+ & > input {
+ border-radius: 6px;
+ height: 28px;
+ }
+ }
+ }
+ }
+ }
+
+ .ant-table-thead > tr > th {
+ background-color: #f7fbfe;
+ }
+
+ th, td {
+ font-size: 12px;
+
+ .ant-form-item {
+ margin-bottom: 0;
+
+ .ant-input-number {
+ width: 100%;
+ }
+ }
+ }
+ }
+}
+
+:global {
+ .ant-dropdown-placement-bottomRight {
+ .ant-dropdown-menu {
+ max-height: inherit !important;
+ }
+ }
+
+ .ant-dropdown-menu-item {
+ font-size: 12px;
+ color: #333;
+ }
+}
diff --git a/src/pages/unitTable/index.tsx b/src/pages/unitTable/index.tsx
new file mode 100644
index 0000000..683f9f1
--- /dev/null
+++ b/src/pages/unitTable/index.tsx
@@ -0,0 +1,60 @@
+import React, { FC, useEffect, useState } from "react";
+import { Table } from "antd";
+import { PaginationData } from "rc-pagination";
+import { exceptStr, paginationAction } from "@/utils/common";
+import { renderCols } from "@/pages/unitTable/renderColsOpts";
+import styles from "./index.less";
+
+const UnitTable: FC = (props) => {
+ const [unitTableType, setUnitTableType] = useState("");
+ const [columns, setColumns] = useState>([]);
+ const [dataSource, setDataSource] = useState>([]);
+ const [pageInfo, setPageInfo] = useState>({});
+ const [i18n, setI18n] = useState({});
+ const [permission, setPermission] = useState(false);
+ const [scrollHeight, setScrollHeight] = useState(undefined);
+
+ 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, pageInfo, scrollHeight, i18n, showOperateBtn, unitTableType } = data;
+ setI18n(i18n);
+ setScrollHeight(scrollHeight);
+ setUnitTableType(unitTableType);
+ setColumns(columns);
+ setDataSource(dataSource);
+ setPageInfo(pageInfo);
+ setPermission(showOperateBtn);
+ }
+ };
+ const onChange = (current: number, pageSize: number) => {
+ setPageInfo((prevState) => {
+ const { pageSize: size } = prevState;
+ window.parent.postMessage(
+ {
+ type: "turn",
+ payload: { id: "PAGEINFO", params: { ...pageInfo, current: size === pageSize ? current : 1, pageSize } }
+ },
+ "*"
+ );
+ return { ...pageInfo, current: size === pageSize ? current : 1, pageSize };
+ });
+ };
+ return ;
+};
+
+export default UnitTable;
diff --git a/src/pages/unitTable/renderColsOpts.tsx b/src/pages/unitTable/renderColsOpts.tsx
new file mode 100644
index 0000000..cd51b8c
--- /dev/null
+++ b/src/pages/unitTable/renderColsOpts.tsx
@@ -0,0 +1,147 @@
+import React from "react";
+import { Button, Dropdown, MenuProps, Space, Typography } from "antd";
+import { MoreOutlined } from "@ant-design/icons";
+
+const { Text } = Typography;
+
+/*
+ * Author: 黎永顺
+ * Description:社保福利台账列表项
+ * Params:
+ * Date: 2024/1/23
+ */
+export function renderCols(initialState: any[], type: string, i18n?: AnyObject, permission?: boolean) {
+ return React.useMemo(() => {
+ if (type === "welfareRecord") {
+ return [..._.map(_.filter(initialState, o => o.dataIndex !== "id"), g => {
+ let col = { ...g, ellipsis: true, fixed: g.dataIndex === "billMonth", width: 180 };
+ switch (g.dataIndex) {
+ case "billMonth":
+ col = {
+ ...col,
+ width: 120,
+ render: (text: string, record: any) => {
+ const { billStatus } = record;
+ return ();
+ }
+ };
+ break;
+ case "billStatus":
+ col = {
+ ...col, width: 100, render: (text: string) => (
+
+ {text === "1" ? i18n?.["已归档"] : i18n?.["未归档"]}
+
+ )
+ };
+ break;
+ case "paymentOrganization":
+ col = { ...col, width: 200 };
+ break;
+ case "socialNum":
+ case "otherNum":
+ case "fundNum":
+ col = { ...col, width: 118 };
+ break;
+ case "remarks":
+ col = { ...col, width: 200 };
+ break;
+ default:
+ col = { ...col };
+ break;
+ }
+ return col;
+ }), {
+ dataIndex: "operate", title: i18n?.["操作"], width: 185, fixed: "right",
+ render: (__: string, record: any) => {
+ const { billStatus } = record;
+ const items: MenuProps["items"] = [
+ {
+ key: "DeleteList",
+ label: i18n?.["删除"],
+ onClick: () => postMessageToParent("DELRC", record)
+ }
+ ];
+ return (
+
+ {
+ !permission ?
+ :
+ <>
+ {
+ billStatus === "0" &&
+ <>
+
+
+
+
+ >
+ }
+ {
+ billStatus === "1" &&
+ <>
+
+
+ >
+ }
+ >
+ }
+
+ );
+ }
+ }];
+ } else if (type === "bonusplan") {
+ return [..._.map(_.filter(initialState, o => o.dataIndex !== "id"), g => {
+ let col = { ...g, ellipsis: true, fixed: g.dataIndex === "billMonth", width: 180 };
+ switch (g.dataIndex) {
+ case "billMonth":
+ col = {
+ ...col,
+ width: 120,
+ render: (text: string, record: any) => {
+ const { billStatus } = record;
+ return ();
+ }
+ };
+ break;
+ case "billStatus":
+ col = {
+ ...col, width: 100, render: (text: string) => (
+
+ {text === "1" ? i18n?.["已归档"] : i18n?.["未归档"]}
+
+ )
+ };
+ break;
+ case "paymentOrganization":
+ col = { ...col, width: 200 };
+ break;
+ case "socialNum":
+ case "otherNum":
+ case "fundNum":
+ col = { ...col, width: 118 };
+ break;
+ case "remarks":
+ col = { ...col, width: 200 };
+ break;
+ default:
+ col = { ...col };
+ break;
+ }
+ return col;
+ })];
+ }
+ return [];
+ }, [initialState, type, i18n, permission]);
+}
+
+const postMessageToParent = (type: string, params: any) => {
+ window.parent.postMessage({ type: "turn", payload: { id: type, params } }, "*");
+};