Merge branch 'master' into feature/2.9.42310.01-薪资项目拓扑图

release/2.19.1.2503.01-业务线个税
lys 7 months ago
commit 4ff9bda282

@ -0,0 +1,9 @@
import * as React from "react";
import { useEffect } from "react";
export default ({ children }: any) => {
useEffect(() => {
return () => {};
}, []);
return <div>{children}</div>;
};

@ -7,9 +7,10 @@ import { Provider } from "mobx-react";
import zhCN from "antd/lib/locale/zh_CN"; import zhCN from "antd/lib/locale/zh_CN";
import { HTML5Backend } from "react-dnd-html5-backend"; import { HTML5Backend } from "react-dnd-html5-backend";
import { connect, IRouteComponentProps, useModel } from "umi"; import { connect, IRouteComponentProps, useModel } from "umi";
import BaseLayout from "./BaseLayout"; // import BaseLayout from "./BaseLayout";
import BlankLayout from "./BlankLayout"; import BlankLayout from "./BlankLayout";
import UserLayout from "./UserLayout"; // import UserLayout from "./UserLayout";
import PageEmptyLayout from "./PageEmptyLayout";
import { IRouterProps, RouterContext } from "./RouterContext"; import { IRouterProps, RouterContext } from "./RouterContext";
import { layoutConfig } from "@/layouts/config"; import { layoutConfig } from "@/layouts/config";
import stores from "@/store"; import stores from "@/store";
@ -64,18 +65,18 @@ const Layout = ({ children, location, route, history, match }: IRouteComponentPr
if (type) { if (type) {
switch (type) { switch (type) {
case "user": // case "user":
layout = <UserLayout {...props} />; // layout = <UserLayout {...props} />;
break; // break;
case "blank": case "blank":
layout = <BlankLayout {...props} />; layout = <BlankLayout {...props} />;
break; break;
default: default:
layout = <BaseLayout {...props} />; layout = <PageEmptyLayout {...props} />;
break; break;
} }
} else { } else {
layout = <BaseLayout {...props} />; layout = <PageEmptyLayout {...props} />;
} }
} }

@ -86,6 +86,32 @@ const index: FunctionComponent<Props> = (props) => {
<Button type="link" onClick={() => handleEdit(record?.id)}> <Button type="link" onClick={() => handleEdit(record?.id)}>
{i18nRes["编辑"]} {i18nRes["编辑"]}
</Button> </Button>
{optWidth && (
<>
<Button
type="link"
onClick={() =>
handleLockEmp({
lockStatus: "LOCK",
acctEmpIds: [record?.id]
})
}
>
{i18nRes["锁定"]}
</Button>
<Button
type="link"
onClick={() =>
handleLockEmp({
lockStatus: "UNLOCK",
acctEmpIds: [record?.id]
})
}
>
{i18nRes["解锁"]}
</Button>
</>
)}
{record?.lockTime && <Text>{record?.lockTime}</Text>} {record?.lockTime && <Text>{record?.lockTime}</Text>}
</Space> </Space>
) )
@ -106,7 +132,7 @@ const index: FunctionComponent<Props> = (props) => {
i18n: item.i18n, i18n: item.i18n,
onCell: (record: any) => ({ onCell: (record: any) => ({
onContextMenu: (e: any) => { onContextMenu: (e: any) => {
record.lockItems && e.preventDefault(); !item.calcDetail && e.preventDefault();
} }
}), }),
render: (text: string, record: any) => { render: (text: string, record: any) => {
@ -135,7 +161,7 @@ const index: FunctionComponent<Props> = (props) => {
} }
]; ];
return ( return (
<Dropdown menu={{ items: record.lockItems ? items : [] }} trigger={["contextMenu"]} overlayClassName={styles.contextMenu} destroyPopupOnHide> <Dropdown menu={{ items: !item.calcDetail ? items : [] }} trigger={["contextMenu"]} overlayClassName={styles.contextMenu} destroyPopupOnHide>
<span className={styles.contentSpan}> <span className={styles.contentSpan}>
<span title={text} className={styles.contentTitle} style={{ color: `${record?.[item.dataIndex + "_color"]}` }}> <span title={text} className={styles.contentTitle} style={{ color: `${record?.[item.dataIndex + "_color"]}` }}>
{text} {text}

@ -15,6 +15,7 @@ export type extraType = {
rowKey: string; rowKey: string;
showTotalCell: boolean; showTotalCell: boolean;
isSpecial: boolean; isSpecial: boolean;
showRowSelection: boolean;
}; };
const UnitTable: FC = (props) => { const UnitTable: FC = (props) => {
const [unitTableType, setUnitTableType] = useState<string>(""); const [unitTableType, setUnitTableType] = useState<string>("");
@ -48,7 +49,8 @@ const UnitTable: FC = (props) => {
rowKey, rowKey,
showTotalCell = false, showTotalCell = false,
sumDataSource = {}, sumDataSource = {},
isSpecial = false isSpecial = false,
showRowSelection = true
} = data; } = data;
setI18n(i18n); setI18n(i18n);
setColumns(columns); setColumns(columns);
@ -63,6 +65,7 @@ const UnitTable: FC = (props) => {
rowKey, rowKey,
showTotalCell, showTotalCell,
isSpecial, isSpecial,
showRowSelection,
selectedRowKeys: [...(extraParams.selectedRowKeys as string[] | number[]), ...rowKeys] selectedRowKeys: [...(extraParams.selectedRowKeys as string[] | number[]), ...rowKeys]
}); });
} }
@ -99,15 +102,8 @@ const UnitTable: FC = (props) => {
columns={renderCols(columns, unitTableType, i18n, extraParams)} columns={renderCols(columns, unitTableType, i18n, extraParams)}
scroll={{ x: 1200, y: `calc(100vh - ${extraParams?.scrollHeight || 109}px)` }} scroll={{ x: 1200, y: `calc(100vh - ${extraParams?.scrollHeight || 109}px)` }}
bordered={_.some(columns, (k) => k.children)} bordered={_.some(columns, (k) => k.children)}
rowSelection={!_.isNil(extraParams?.selectedRowKeys) ? rowSelection : undefined} rowSelection={extraParams?.showRowSelection ? rowSelection : undefined}
pagination={ pagination={!_.isNil(pageInfo) ? { ...paginationAction(pageInfo, i18n, onChange), size: "default" } : false}
!_.isNil(pageInfo)
? {
...paginationAction(pageInfo, i18n, onChange),
size: "default"
}
: false
}
summary={() => summary={() =>
!extraParams.showTotalCell ? ( !extraParams.showTotalCell ? (
<></> <></>
@ -117,7 +113,7 @@ const UnitTable: FC = (props) => {
<Table.Summary.Cell index={0} align="center"> <Table.Summary.Cell index={0} align="center">
<Text type="danger">{i18n["总计"]}</Text> <Text type="danger">{i18n["总计"]}</Text>
</Table.Summary.Cell> </Table.Summary.Cell>
<CaclFixedTotal columns={!_.isNil(extraParams?.selectedRowKeys) ? columns : columns.slice(1)} dataSourceUrl="" payload={{}} sumRow={sumRow} /> <CaclFixedTotal columns={extraParams?.showRowSelection ? columns : columns.slice(1)} dataSourceUrl="" payload={{}} sumRow={sumRow} />
</Table.Summary.Row> </Table.Summary.Row>
</Table.Summary> </Table.Summary>
) )

@ -69,7 +69,7 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
width: 185, width: 185,
fixed: "right", fixed: "right",
render: (__: string, record: any) => { render: (__: string, record: any) => {
const { billStatus } = record; const { billStatus, customOptAuth } = record;
const items: MenuProps["items"] = [ const items: MenuProps["items"] = [
{ {
key: "DeleteList", key: "DeleteList",
@ -111,9 +111,11 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
<Button type="link" onClick={() => postMessageToParent("CALC", record)}> <Button type="link" onClick={() => postMessageToParent("CALC", record)}>
{i18n?.["核算"]} {i18n?.["核算"]}
</Button> </Button>
<Button type="link" onClick={() => postMessageToParent("FILE", record)}> {(_.isEmpty(customOptAuth) || customOptAuth.FILE) && (
{i18n?.["归档"]} <Button type="link" onClick={() => postMessageToParent("FILE", record)}>
</Button> {i18n?.["归档"]}
</Button>
)}
<Dropdown menu={{ items }} placement="bottomRight"> <Dropdown menu={{ items }} placement="bottomRight">
<Button type="link" icon={<MoreOutlined />} /> <Button type="link" icon={<MoreOutlined />} />
</Dropdown> </Dropdown>
@ -124,9 +126,11 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
<Button type="link" onClick={() => postMessageToParent("VIEW", record)}> <Button type="link" onClick={() => postMessageToParent("VIEW", record)}>
{i18n?.["查看"]} {i18n?.["查看"]}
</Button> </Button>
<Button type="link" onClick={() => postMessageToParent("RECALC", record)}> {(_.isEmpty(customOptAuth) || customOptAuth.RECALC) && (
{i18n?.["重新核算"]} <Button type="link" onClick={() => postMessageToParent("RECALC", record)}>
</Button> {i18n?.["重新核算"]}
</Button>
)}
<Dropdown <Dropdown
menu={{ menu={{
items: [ items: [

Loading…
Cancel
Save