custom/鲁控数字-薪资核算列表页面批量编辑

custom/鲁控数字-薪资核算列表页面批量编辑
黎永顺 1 year ago
parent ac98e6c3c2
commit 41ff1d3673

@ -83,23 +83,28 @@ const Index: FunctionComponent<Props> = (props) => {
setSelectedRowKeys(selectedRowKeys);
editItemList.current = [];
setTableScrollHeight(tableScrollHeight);
setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes }))), {
setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes })), calcDetail), {
title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: 120,
render: (__, record) => (<Button type="link" onClick={() => handleEdit(record?.id)}>{i18nRes["编辑"]}</Button>)
}]);
}
};
const convertColumns: any = (cols: any[]) => {
const convertColumns: any = (cols: any[], editable: boolean) => {
return _.map(cols, item => {
if (_.isNaN(parseInt(item.dataIndex))) {
return { ...item, editable: false };
} else {
return {
...item, title: <CustomTableTitle {...item} onHandleFormulatd={handleFormulaTd}/>,
children: convertColumns(_.map(item.children, o => ({ ...o, i18n: item.i18n }))),
className: styles["td_odd"], i18n: item.i18n, editable: true,
children: convertColumns(_.map(item.children, o => ({ ...o, i18n: item.i18n })), editable),
className: styles["td_odd"], i18n: item.i18n, editable: !editable,
onCell: (record: any, rowIndex: number) => ({
record, rowIndex, dataIndex: item.dataIndex, title: item.title, editable: true, pattern: item.pattern,
record,
rowIndex,
dataIndex: item.dataIndex,
title: item.title,
editable: !editable,
pattern: item.pattern,
handleSave
}),
render: (text: string) => (

Loading…
Cancel
Save