|
|
|
@ -29,6 +29,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>("");
|
|
|
|
|
|
|
|
|
@ -44,10 +45,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);
|
|
|
|
@ -128,9 +130,10 @@ const index: FunctionComponent<Props> = (props) => {
|
|
|
|
|
};
|
|
|
|
|
return (<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}/>}
|
|
|
|
|
columns={!isDetailTable ? columns : _.filter(columns, o => o.dataIndex !== "operate")}
|
|
|
|
|
footer={() => !isDetailTable ? <CalcExplainFooter i18n={i18n}/> : null}
|
|
|
|
|
pagination={{
|
|
|
|
|
...paginationFun(pageInfo, sizeChange, onChange, i18n),
|
|
|
|
|
size: "default"
|
|
|
|
|