|
|
|
@ -35,6 +35,7 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
const [tableScrollHeight, setTableScrollHeight] = useState<Number>(0);
|
|
|
|
|
const [payload, setPayload] = useState<string>("");
|
|
|
|
|
const [fixed, setFixed] = useState<fixedProps>(true);
|
|
|
|
|
const [sumRow, setSumRow] = useState<Partial<{}>>({});//总计行数据
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
window.parent.postMessage({ type: "init" }, "*");
|
|
|
|
@ -49,7 +50,7 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
const {
|
|
|
|
|
columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {},
|
|
|
|
|
showTotalCell = false, sumRowlistUrl = "", payload = {}, calcDetail,
|
|
|
|
|
fixed = true, tableScrollHeight
|
|
|
|
|
fixed = true, tableScrollHeight, sumRow
|
|
|
|
|
} = data;
|
|
|
|
|
setSumRowlistUrl(sumRowlistUrl);
|
|
|
|
|
setShowTotalCell(showTotalCell);
|
|
|
|
@ -57,6 +58,7 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
setI18n(i18nRes);
|
|
|
|
|
setPayload(payload);
|
|
|
|
|
setFixed(fixed);
|
|
|
|
|
setSumRow(sumRow);
|
|
|
|
|
setPageInfo(pageInfo);
|
|
|
|
|
setDataSource(dataSource);
|
|
|
|
|
setSelectedRowKeys(selectedRowKeys);
|
|
|
|
@ -140,16 +142,16 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
scroll={{ x: 1200, y: `calc(100vh - ${tableScrollHeight || (!showTotalCell ? 165 : 200)}px)` }}
|
|
|
|
|
columns={!isDetailTable ? columns : _.filter(columns, o => o.dataIndex !== "operate")}
|
|
|
|
|
footer={() => !isDetailTable ? <CalcExplainFooter i18n={i18n}/> : null}
|
|
|
|
|
pagination={{
|
|
|
|
|
pagination={!_.isNil(pageInfo) ? {
|
|
|
|
|
...paginationFun(pageInfo, sizeChange, onChange, i18n),
|
|
|
|
|
size: "default"
|
|
|
|
|
}}
|
|
|
|
|
} : false}
|
|
|
|
|
summary={() => (
|
|
|
|
|
!showTotalCell ? <></> :
|
|
|
|
|
<Table.Summary fixed={fixed}>
|
|
|
|
|
<Table.Summary.Row>
|
|
|
|
|
<Table.Summary.Cell index={0} align="center"><Text type="danger">{i18n["总计"]}</Text></Table.Summary.Cell>
|
|
|
|
|
<CaclFixedTotal columns={columns} dataSourceUrl={sumRowlistUrl} payload={payload}/>
|
|
|
|
|
<CaclFixedTotal columns={columns} dataSourceUrl={sumRowlistUrl} payload={payload} sumRow={sumRow}/>
|
|
|
|
|
</Table.Summary.Row>
|
|
|
|
|
</Table.Summary>
|
|
|
|
|
)}
|
|
|
|
|