feature/核算表格双击编辑
lys 8 months ago
parent 30501b5fe7
commit 3f9a65840c

@ -15,6 +15,7 @@ export type extraType = {
rowKey: string; rowKey: string;
showTotalCell: boolean; showTotalCell: boolean;
isSpecial: boolean; isSpecial: boolean;
showRowSelection: boolean;
}; };
const UnitTable: FC = (props) => { const UnitTable: FC = (props) => {
const [unitTableType, setUnitTableType] = useState<string>(""); const [unitTableType, setUnitTableType] = useState<string>("");
@ -48,7 +49,8 @@ const UnitTable: FC = (props) => {
rowKey, rowKey,
showTotalCell = false, showTotalCell = false,
sumDataSource = {}, sumDataSource = {},
isSpecial = false isSpecial = false,
showRowSelection = true
} = data; } = data;
setI18n(i18n); setI18n(i18n);
setColumns(columns); setColumns(columns);
@ -63,6 +65,7 @@ const UnitTable: FC = (props) => {
rowKey, rowKey,
showTotalCell, showTotalCell,
isSpecial, isSpecial,
showRowSelection,
selectedRowKeys: [...(extraParams.selectedRowKeys as string[] | number[]), ...rowKeys] selectedRowKeys: [...(extraParams.selectedRowKeys as string[] | number[]), ...rowKeys]
}); });
} }
@ -99,7 +102,7 @@ const UnitTable: FC = (props) => {
columns={renderCols(columns, unitTableType, i18n, extraParams)} columns={renderCols(columns, unitTableType, i18n, extraParams)}
scroll={{ x: 1200, y: `calc(100vh - ${extraParams?.scrollHeight || 109}px)` }} scroll={{ x: 1200, y: `calc(100vh - ${extraParams?.scrollHeight || 109}px)` }}
bordered={_.some(columns, (k) => k.children)} bordered={_.some(columns, (k) => k.children)}
rowSelection={!_.isNil(extraParams?.selectedRowKeys) ? rowSelection : undefined} rowSelection={extraParams?.showRowSelection ? rowSelection : undefined}
pagination={!_.isNil(pageInfo) ? { ...paginationAction(pageInfo, i18n, onChange), size: "default" } : false} pagination={!_.isNil(pageInfo) ? { ...paginationAction(pageInfo, i18n, onChange), size: "default" } : false}
summary={() => summary={() =>
!extraParams.showTotalCell ? ( !extraParams.showTotalCell ? (

Loading…
Cancel
Save