master
This commit is contained in:
parent
fe86dd2cd6
commit
f9f95f25df
|
|
@ -61,7 +61,7 @@ const calcFixedTotal: FunctionComponent<Props> = (props) => {
|
||||||
return <Table.Summary.Cell index={index + 1} key={index + 1} align={_.head(columns)?.align || "left"}>
|
return <Table.Summary.Cell index={index + 1} key={index + 1} align={_.head(columns)?.align || "left"}>
|
||||||
{
|
{
|
||||||
loading ? <Spin spinning={loading} size="small"></Spin> :
|
loading ? <Spin spinning={loading} size="small"></Spin> :
|
||||||
<Text type="danger">{sumRow[item.dataIndex] || "-"}</Text>
|
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||||
}
|
}
|
||||||
</Table.Summary.Cell>;
|
</Table.Summary.Cell>;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ const index: FunctionComponent<Props> = (props) => {
|
||||||
const {
|
const {
|
||||||
columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {},
|
columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {},
|
||||||
showTotalCell = false, sumRowlistUrl = "", payload = {}, calcDetail,
|
showTotalCell = false, sumRowlistUrl = "", payload = {}, calcDetail,
|
||||||
fixed = true, tableScrollHeight, sumRow
|
fixed = true, tableScrollHeight, sumRow, optWidth
|
||||||
} = data;
|
} = data;
|
||||||
setSumRowlistUrl(sumRowlistUrl);
|
setSumRowlistUrl(sumRowlistUrl);
|
||||||
setShowTotalCell(showTotalCell);
|
setShowTotalCell(showTotalCell);
|
||||||
|
|
@ -64,7 +64,7 @@ const index: FunctionComponent<Props> = (props) => {
|
||||||
setSelectedRowKeys(selectedRowKeys);
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
setTableScrollHeight(tableScrollHeight);
|
setTableScrollHeight(tableScrollHeight);
|
||||||
setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes }))), {
|
setColumns([...convertColumns(_.map(columns, o => ({ ...o, i18n: i18nRes }))), {
|
||||||
title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: 220,
|
title: i18nRes["操作"], dataIndex: "operate", fixed: "right", width: optWidth || 120,
|
||||||
render: (__, record) => (<Space>
|
render: (__, record) => (<Space>
|
||||||
<Button type="link" onClick={() => handleEdit(record?.id)}>{i18nRes["编辑"]}</Button>
|
<Button type="link" onClick={() => handleEdit(record?.id)}>{i18nRes["编辑"]}</Button>
|
||||||
<Button type="link"
|
<Button type="link"
|
||||||
|
|
|
||||||
|
|
@ -295,6 +295,22 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
} else if (type === "variableSalary") {
|
||||||
|
return [..._.map(initialState, g => {
|
||||||
|
return { ...g, ellipsis: true, fixed: false, width: 150 };
|
||||||
|
}), {
|
||||||
|
dataIndex: "operate", title: i18n?.["操作"], width: 185, fixed: "right",
|
||||||
|
render: (__: string, record: any) => {
|
||||||
|
return (
|
||||||
|
<Space>
|
||||||
|
<Button type="link"
|
||||||
|
onClick={() => postMessageToParent("VIEW", record)}>{i18n?.["查看详情"]}</Button>
|
||||||
|
<Button type="link"
|
||||||
|
onClick={() => postMessageToParent("DEL", record)}>{i18n?.["删除"]}</Button>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
return initialState;
|
return initialState;
|
||||||
}, [initialState, type, i18n, extraParams]);
|
}, [initialState, type, i18n, extraParams]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue