Merge branch 'master' into custom/鲁控数字-薪资核算列表页面批量编辑
# Conflicts: # src/pages/calcTable/index.tsx
This commit is contained in:
commit
5af8fc24a3
|
|
@ -17,12 +17,13 @@ interface OwnProps {
|
|||
onHandleFormulatd?: any;
|
||||
i18n?: any;
|
||||
pattern?: number;
|
||||
calcDetail?: boolean; //查看详情页面
|
||||
}
|
||||
|
||||
type Props = OwnProps;
|
||||
|
||||
const customTableTitle: FunctionComponent<Props> = (props) => {
|
||||
const { dataIndex, title, lockStatus, onHandleFormulatd, i18n = {}, pattern, dataType } = props;
|
||||
const { dataIndex, title, lockStatus, onHandleFormulatd, i18n = {}, pattern, dataType, calcDetail } = props;
|
||||
|
||||
const handleToggleSalaryItemVal = (salaryItemId: string, type: string, updateParams: any = {}) => {
|
||||
window.parent.postMessage(
|
||||
|
|
@ -38,7 +39,7 @@ const customTableTitle: FunctionComponent<Props> = (props) => {
|
|||
<div className={classnames(styles["expand-th"])}>
|
||||
<div className={styles["title-text"]} title={title} onClick={() => onHandleFormulatd(dataIndex)}>{title}</div>
|
||||
{
|
||||
!!lockStatus &&
|
||||
!!lockStatus && !calcDetail &&
|
||||
<div className={styles["toogle-lock-tool"]}>
|
||||
<Icon type="icon-piliangsuoding" title={i18n["点击锁定所有解锁的项目值"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "LOCK")}/>
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
const [pageInfo, setPageInfo] = useState<Partial<PaginationData>>({});
|
||||
const [i18n, setI18n] = useState<any>({});
|
||||
const [showTotalCell, setShowTotalCell] = useState<boolean>(false);
|
||||
const [isDetailTable, setIsDetailTable] = useState<boolean>(false);
|
||||
const [sumRowlistUrl, setSumRowlistUrl] = useState<string>("");
|
||||
const [payload, setPayload] = useState<string>("");
|
||||
const [form] = Form.useForm();
|
||||
|
|
@ -63,10 +64,11 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
if (!_.isEmpty(data)) {
|
||||
const {
|
||||
columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {},
|
||||
showTotalCell = false, sumRowlistUrl = "", payload = {}
|
||||
showTotalCell = false, sumRowlistUrl = "", payload = {}, calcDetail
|
||||
} = data;
|
||||
setSumRowlistUrl(sumRowlistUrl);
|
||||
setShowTotalCell(showTotalCell);
|
||||
setIsDetailTable(calcDetail);
|
||||
setI18n(i18nRes);
|
||||
setPayload(payload);
|
||||
setPageInfo(pageInfo);
|
||||
|
|
@ -203,9 +205,10 @@ const Index: FunctionComponent<Props> = (props) => {
|
|||
};
|
||||
return (<Form form={form} component={false}><Table
|
||||
rowKey="id" size="small" bordered className={styles.tableWrapper}
|
||||
columns={columns} dataSource={dataSource} rowSelection={rowSelection}
|
||||
dataSource={dataSource} rowSelection={rowSelection}
|
||||
scroll={{ x: 1200, y: `calc(100vh - ${!showTotalCell ? 165 : 200}px)` }}
|
||||
footer={() => <CalcExplainFooter i18n={i18n}/>} components={components}
|
||||
columns={!isDetailTable ? columns : _.filter(columns, o => o.dataIndex !== "operate")}
|
||||
footer={() => !isDetailTable ? <CalcExplainFooter i18n={i18n}/> : null} components={components}
|
||||
pagination={{
|
||||
...paginationFun(pageInfo, sizeChange, onChange, i18n),
|
||||
size: "default"
|
||||
|
|
|
|||
Loading…
Reference in New Issue