低版本浏览器适配
This commit is contained in:
parent
0f97ae555b
commit
533e651847
|
|
@ -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 (
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
{
|
||||
_.map(totalColumns, (item, index) => {
|
||||
return <Table.Summary.Cell index={index} key={index} align="center">
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
);
|
||||
}}
|
||||
/>;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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> = (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 ? (
|
||||
<Menu>
|
||||
<Menu.Item key="DeleteTodoList">
|
||||
<span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleSalaryFileOperate("DEL-PENDITNG-TO-DO", [record?.id])}>
|
||||
{i18n["删除待办"]}
|
||||
</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
) : <Menu>
|
||||
<Menu.Item key="DeleteTodoList">
|
||||
<span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleSalaryFileOperate("DEL-PENDITNG-TO-DO", [record?.id])}>
|
||||
{i18n["删除待办"]}
|
||||
</span>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="DeleteFiles">
|
||||
<span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleSalaryFileOperate("DEL-SALARY-FILES", [record?.id])}>
|
||||
{i18n["删除档案"]}
|
||||
</span>
|
||||
</Menu.Item>
|
||||
</Menu>;
|
||||
return (<Space>
|
||||
<Button type="link" onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate("ADD-TO-SALARYPAYMENT", record, [record?.id])}>{i18n["设为发薪人员"]}</Button>
|
||||
<Dropdown menu={{ items }} placement="bottomRight">
|
||||
<Dropdown overlay={items} placement="bottomRight">
|
||||
<Button type="link" icon={<MoreOutlined/>}/>
|
||||
</Dropdown>
|
||||
</Space>);
|
||||
|
|
@ -133,18 +143,21 @@ const Index: FunctionComponent<Props> = (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 = (
|
||||
<Menu>
|
||||
<Menu.Item key="DeleteTodoList">
|
||||
<span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleSalaryFileOperate("DEL-SUSPEND-TO-DO", record, [record?.id])}>
|
||||
{i18n["删除待办"]}
|
||||
</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
return (<Space>
|
||||
<Button type="link" onClick={() => handleSalaryFileOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate("SALARY-SUSPENSION", record, [record?.id])}>{i18n["停薪"]}</Button>
|
||||
<Dropdown menu={{ items: downsizingItems }} placement="bottomRight">
|
||||
<Dropdown overlay={downsizingItems} placement="bottomRight">
|
||||
<Button type="link" icon={<MoreOutlined/>}/>
|
||||
</Dropdown>
|
||||
</Space>);
|
||||
|
|
@ -155,21 +168,23 @@ const Index: FunctionComponent<Props> = (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 ? (
|
||||
<Menu>
|
||||
<Menu.Item key="CancelSuspension">
|
||||
<span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleSalaryFileOperate("DEL-SALARY-FILES", record, [record?.id])}>
|
||||
{i18n["删除档案"]}
|
||||
</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
) : null;
|
||||
return (<Space>
|
||||
<Button type="link" onClick={() => handleSalaryFileOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||
<Button type="link"
|
||||
onClick={() => handleSalaryFileOperate("CANCEL-SALARY-SUSPENSION", record, [record?.id])}>{i18n["取消停薪"]}</Button>
|
||||
{
|
||||
!_.isEmpty(stopItems) &&
|
||||
<Dropdown menu={{ items: stopItems }} placement="bottomRight">
|
||||
<Dropdown overlay={stopItems} placement="bottomRight">
|
||||
<Button type="link" icon={<MoreOutlined/>}/>
|
||||
</Dropdown>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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> = (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 = (
|
||||
<Menu>
|
||||
<Menu.Item key="DeleteFiles"><span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleWelfareOperate("DEL-ARCHIVE", record)}>{i18n["删除档案"]}</span></Menu.Item>
|
||||
<Menu.Item key="DeleteTodoList"><span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleWelfareOperate("DEL-TO-DO", record, { runStatus: "4" })}>{i18n["删除待办"]}</span></Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
return (<Space>
|
||||
<Button type="link" onClick={() => handleWelfareOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||
<Button type="link" onClick={() => handleWelfareOperate("ADD-TO-PAY", record)}>{i18n["增员"]}</Button>
|
||||
<Dropdown menu={{ items }} placement="bottomRight">
|
||||
<Dropdown overlay={items} placement="bottomRight">
|
||||
<Button type="link" icon={<MoreOutlined/>}/>
|
||||
</Dropdown>
|
||||
</Space>);
|
||||
|
|
@ -128,18 +123,21 @@ const Index: FunctionComponent<Props> = (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 = (
|
||||
<Menu>
|
||||
<Menu.Item key="DeleteTodoList">
|
||||
<span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleWelfareOperate("DEL-TO-DO-STAY", record, { runStatus: "3" })}>
|
||||
{i18n["删除待办"]}
|
||||
</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
return (<Space>
|
||||
<Button type="link" onClick={() => handleWelfareOperate("EDIT", record)}>{i18n["编辑"]}</Button>
|
||||
<Button type="link"
|
||||
onClick={() => handleWelfareOperate("STAY-DEL-TO-STOP", record)}>{i18n["减员"]}</Button>
|
||||
<Dropdown menu={{ items: downsizingItems }} placement="bottomRight">
|
||||
<Dropdown overlay={downsizingItems} placement="bottomRight">
|
||||
<Button type="link" icon={<MoreOutlined/>}/>
|
||||
</Dropdown>
|
||||
</Space>);
|
||||
|
|
@ -150,18 +148,21 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
opts = {
|
||||
...opts,
|
||||
render: (__: any, record: any) => {
|
||||
const stopItems: MenuProps["items"] = [
|
||||
{
|
||||
key: "CancelSuspension",
|
||||
label: i18n["取消停缴"],
|
||||
onClick: () => handleWelfareOperate("CANCEL-STOP", record)
|
||||
}
|
||||
];
|
||||
const stopItems = (
|
||||
<Menu>
|
||||
<Menu.Item key="CancelSuspension">
|
||||
<span style={{ width: "100%", height: "100%" }}
|
||||
onClick={(e) => handleWelfareOperate("CANCEL-STOP", record)}>
|
||||
{i18n["取消停缴"]}
|
||||
</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
return (<Space>
|
||||
<Button type="link" onClick={() => handleWelfareOperate("VIEW", record)}>{i18n["查看"]}</Button>
|
||||
<Button type="link"
|
||||
onClick={() => handleWelfareOperate("DEL-ARCHIVE", record)}>{i18n["删除档案"]}</Button>
|
||||
<Dropdown menu={{ items: stopItems }} placement="bottomRight">
|
||||
<Dropdown overlay={stopItems} placement="bottomRight">
|
||||
<Button type="link" icon={<MoreOutlined/>}/>
|
||||
</Dropdown>
|
||||
</Space>);
|
||||
|
|
|
|||
Loading…
Reference in New Issue