泛微薪资核算iframe表格

feature/V2-系统多语言
黎永顺 2 years ago
parent 4fb8eaad28
commit 26b786444f

@ -38,7 +38,7 @@ const AntdTable: FC<ITableProps> = (props) => {
}, []); }, []);
const getPCDataList = (params: any = {}) => { const getPCDataList = (params: any = {}) => {
let { type, listType, hasOperate = true, ...extraParams } = params; let { type, listType, hasOperate = true, i18n: newI18n, ...extraParams } = params;
setLoading({ query: true }); setLoading({ query: true });
setTab(type); setTab(type);
setUsertab(listType); setUsertab(listType);
@ -49,7 +49,7 @@ const AntdTable: FC<ITableProps> = (props) => {
if (type === "PC") { if (type === "PC") {
if (listType === "SA") { if (listType === "SA") {
const { columns = [], list = [], total, pageSize: size, pageNum } = dataCopy; const { columns = [], list = [], total, pageSize: size, pageNum } = dataCopy;
setColumns(getUserListColumns(columns)); setColumns(getUserListColumns(columns, newI18n));
setDataSource(list); setDataSource(list);
setPageParams({ ...pageParams, total, size, pageNum }); setPageParams({ ...pageParams, total, size, pageNum });
} else if (listType === "MA") { } else if (listType === "MA") {
@ -61,7 +61,7 @@ const AntdTable: FC<ITableProps> = (props) => {
} else { } else {
const { columns = [], pageInfo = {} } = dataCopy; const { columns = [], pageInfo = {} } = dataCopy;
const { list = [], total, pageSize: size, pageNum } = pageInfo; const { list = [], total, pageSize: size, pageNum } = pageInfo;
setColumns(getColumns(columns, hasOperate)); setColumns(getColumns(columns, hasOperate, newI18n));
setDataSource(list); setDataSource(list);
setPageParams({ ...pageParams, total, size, pageNum }); setPageParams({ ...pageParams, total, size, pageNum });
const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" }); const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" });
@ -81,10 +81,10 @@ const AntdTable: FC<ITableProps> = (props) => {
} }
}); });
}; };
const getUserListColumns = (acctemployeeListColumns: any) => { const getUserListColumns = (acctemployeeListColumns: any, newI18n:any) => {
let tmpColumns = [...acctemployeeListColumns, { let tmpColumns = [...acctemployeeListColumns, {
key: "cz", key: "cz",
title: i18n["操作"], title: newI18n["操作"],
render: (text: string, record: any) => { render: (text: string, record: any) => {
return ( return (
<Button type="link" style={{ padding: "0" }} <Button type="link" style={{ padding: "0" }}
@ -98,7 +98,7 @@ const AntdTable: FC<ITableProps> = (props) => {
); );
}} }}
> >
{i18n["删除"]} {newI18n["删除"]}
</Button> </Button>
); );
} }
@ -130,7 +130,7 @@ const AntdTable: FC<ITableProps> = (props) => {
return tmpColumns; return tmpColumns;
}; };
//薪资核算页面列表 //薪资核算页面列表
const getColumns = (column: any, hasOperate: boolean = true) => { const getColumns = (column: any, hasOperate: boolean = true, newI18n: any) => {
let tmpColumns = [...column]; let tmpColumns = [...column];
tmpColumns = tmpColumns.filter(item => item.hide == "FALSE").map((item, index) => { tmpColumns = tmpColumns.filter(item => item.hide == "FALSE").map((item, index) => {
let result = { ...item }; let result = { ...item };
@ -148,7 +148,7 @@ const AntdTable: FC<ITableProps> = (props) => {
item.lockStatus && <span className={styles.titleIcon}> item.lockStatus && <span className={styles.titleIcon}>
{ {
item.lockStatus === "UNLOCK" && <LockOutlined item.lockStatus === "UNLOCK" && <LockOutlined
title={i18n["点击锁定所有解锁的项目值"]} title={newI18n["点击锁定所有解锁的项目值"]}
onClick={() => { onClick={() => {
window.parent.postMessage( window.parent.postMessage(
{ {
@ -162,7 +162,7 @@ const AntdTable: FC<ITableProps> = (props) => {
} }
{ {
item.lockStatus !== "UNLOCK" && <UnlockOutlined item.lockStatus !== "UNLOCK" && <UnlockOutlined
title={i18n["点击解锁所有锁定的项目值"]} title={newI18n["点击解锁所有锁定的项目值"]}
onClick={() => { onClick={() => {
window.parent.postMessage( window.parent.postMessage(
{ {
@ -197,7 +197,7 @@ const AntdTable: FC<ITableProps> = (props) => {
return <span className={styles.contentSpan}> return <span className={styles.contentSpan}>
<span title={text} className={styles.contentTitle}>{text}</span> <span title={text} className={styles.contentTitle}>{text}</span>
{ {
result.lockStatus === "LOCK" ? <LockOutlined title={i18n["锁定的项目值"]}/> : null result.lockStatus === "LOCK" ? <LockOutlined title={newI18n["锁定的项目值"]}/> : null
} }
</span>; </span>;
}; };
@ -220,7 +220,7 @@ const AntdTable: FC<ITableProps> = (props) => {
{ {
child.lockStatus === "UNLOCK" && child.lockStatus === "UNLOCK" &&
<LockOutlined <LockOutlined
title={i18n["点击锁定所有解锁的项目值"]} title={newI18n["点击锁定所有解锁的项目值"]}
onClick={() => { onClick={() => {
window.parent.postMessage( window.parent.postMessage(
{ {
@ -235,7 +235,7 @@ const AntdTable: FC<ITableProps> = (props) => {
{ {
child.lockStatus !== "UNLOCK" && child.lockStatus !== "UNLOCK" &&
<UnlockOutlined <UnlockOutlined
title={i18n["点击解锁所有锁定的项目值"]} title={newI18n["点击解锁所有锁定的项目值"]}
onClick={() => { onClick={() => {
window.parent.postMessage( window.parent.postMessage(
{ {
@ -257,7 +257,7 @@ const AntdTable: FC<ITableProps> = (props) => {
return <span className={styles.contentSpan}> return <span className={styles.contentSpan}>
<span title={text} className={styles.contentTitle}>{text}</span> <span title={text} className={styles.contentTitle}>{text}</span>
{ {
child.lockStatus === "LOCK" ? <LockOutlined title={i18n["锁定的项目值"]}/> : null child.lockStatus === "LOCK" ? <LockOutlined title={newI18n["锁定的项目值"]}/> : null
} }
</span>; </span>;
}; };
@ -274,7 +274,7 @@ const AntdTable: FC<ITableProps> = (props) => {
return result; return result;
}); });
hasOperate && tmpColumns.push({ hasOperate && tmpColumns.push({
title: i18n["操作"], title: newI18n["操作"],
key: "cz", key: "cz",
width: "100px", width: "100px",
fixed: "right", fixed: "right",
@ -287,7 +287,7 @@ const AntdTable: FC<ITableProps> = (props) => {
}, },
"*" "*"
); );
}}>{i18n["编辑"]}</Button>; }}>{newI18n["编辑"]}</Button>;
} }
}); });
return tmpColumns; return tmpColumns;
@ -298,7 +298,7 @@ const AntdTable: FC<ITableProps> = (props) => {
if (!_.isEmpty(data)) { if (!_.isEmpty(data)) {
const { selectedRowKeys, i18n, ...extraData } = data; const { selectedRowKeys, i18n, ...extraData } = data;
setI18n(i18n); setI18n(i18n);
getPCDataList({ ...extraData, ...pageParams }); getPCDataList({ ...extraData, ...pageParams, i18n });
if (selectedRowKeys) setSelected(selectedRowKeys); if (selectedRowKeys) setSelected(selectedRowKeys);
} }
}; };

Loading…
Cancel
Save