/* * 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; dataType?: string; onHandleFormulatd?: any; i18n?: any; pattern?: number; } type Props = OwnProps; const customTableTitle: FunctionComponent = (props) => { const { dataIndex, title, lockStatus, onHandleFormulatd, i18n = {}, pattern, dataType } = props; const handleToggleSalaryItemVal = (salaryItemId: string, type: string, updateParams: any = {}) => { window.parent.postMessage( { type: "turn", payload: { id: "LOCKING", params: { lockType: type, salaryItemId, ...updateParams } } }, "*" ); }; return ( // th-width-lock
onHandleFormulatd(dataIndex)}>{title}
{ !!lockStatus &&
handleToggleSalaryItemVal(dataIndex as string, "LOCK")}/> handleToggleSalaryItemVal(dataIndex as string, "UNLOCK")}/> handleToggleSalaryItemVal(dataIndex as string, "BATCHUPDATE", { pattern, salaryItemName: title, dataType })}/>
}
); }; export default customTableTitle;