You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
2 years ago
|
/*
|
||
|
* Author: 黎永顺
|
||
|
* name: 自定义薪资核算表格标题
|
||
|
* Description:
|
||
|
* Date: 2023/9/15
|
||
|
*/
|
||
|
import React, { FunctionComponent } from "react";
|
||
|
import classnames from "classnames";
|
||
|
import Icon from "@/lib/CustomIcon";
|
||
|
import styles from "@/pages/atdTable/components/index.less";
|
||
|
|
||
|
interface OwnProps {
|
||
|
dataIndex?: string;
|
||
|
title?: string;
|
||
|
lockStatus?: string;
|
||
|
onHandleFormulatd?: any;
|
||
|
i18n?: any;
|
||
|
}
|
||
|
|
||
|
type Props = OwnProps;
|
||
|
|
||
|
const customTableTitle: FunctionComponent<Props> = (props) => {
|
||
|
const { dataIndex, title, lockStatus, onHandleFormulatd, i18n = {} } = props;
|
||
|
|
||
|
const handleToggleSalaryItemVal = (salaryItemId: string, type: string) => {
|
||
|
window.parent.postMessage(
|
||
|
{
|
||
|
type: "turn",
|
||
|
payload: { id: "LOCKING", params: { lockType: type, salaryItemId } }
|
||
|
},
|
||
|
"*"
|
||
|
);
|
||
|
};
|
||
|
return (
|
||
|
// th-width-lock
|
||
|
<div className={classnames(styles["expand-th"])}>
|
||
|
<div className={styles["title-text"]} title={title} onClick={() => onHandleFormulatd(dataIndex)}>{title}</div>
|
||
|
{
|
||
|
!!lockStatus &&
|
||
|
<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")}/>
|
||
|
</div>
|
||
|
}
|
||
|
</div>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default customTableTitle;
|