|
|
|
@ -17,21 +17,15 @@ interface OwnProps {
|
|
|
|
|
i18n?: any;
|
|
|
|
|
pattern?: number;
|
|
|
|
|
calcDetail?: boolean; //查看详情页面
|
|
|
|
|
children?: any;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Props = OwnProps;
|
|
|
|
|
|
|
|
|
|
const customTableTitle: FunctionComponent<Props> = (props) => {
|
|
|
|
|
const { dataIndex, title, onHandleFormulatd, i18n = {}, pattern, dataType, calcDetail } = props;
|
|
|
|
|
|
|
|
|
|
const { dataIndex, title, onHandleFormulatd, i18n = {}, pattern, dataType, calcDetail, children } = props;
|
|
|
|
|
const handleToggleSalaryItemVal = (salaryItemId: string, type: string, updateParams: any = {}) => {
|
|
|
|
|
window.parent.postMessage(
|
|
|
|
|
{
|
|
|
|
|
type: "turn",
|
|
|
|
|
payload: { id: "LOCKING", params: { lockType: type, salaryItemId, ...updateParams } }
|
|
|
|
|
},
|
|
|
|
|
"*"
|
|
|
|
|
);
|
|
|
|
|
window.parent.postMessage({ type: "turn", payload: { id: "LOCKING", params: { lockType: type, salaryItemId, ...updateParams } } }, "*");
|
|
|
|
|
};
|
|
|
|
|
return (
|
|
|
|
|
// th-width-lock
|
|
|
|
@ -39,7 +33,7 @@ const customTableTitle: FunctionComponent<Props> = (props) => {
|
|
|
|
|
<div className={styles["title-text"]} title={title} onClick={() => onHandleFormulatd(dataIndex)}>
|
|
|
|
|
{title}
|
|
|
|
|
</div>
|
|
|
|
|
{!calcDetail && (
|
|
|
|
|
{!calcDetail && _.isEmpty(children) && (
|
|
|
|
|
<div className={styles["toogle-lock-tool"]}>
|
|
|
|
|
<Icon type="icon-piliangsuoding" title={i18n["点击锁定所有解锁的项目值"]} onClick={() => handleToggleSalaryItemVal(dataIndex as string, "LOCK")} />
|
|
|
|
|
<Icon type="icon-piliangjiesuo" title={i18n["点击解锁所有锁定的项目值"]} onClick={() => handleToggleSalaryItemVal(dataIndex as string, "UNLOCK")} />
|
|
|
|
|