AddOrEditModal.js 642 Bytes
Newer Older
王绍森's avatar
王绍森 committed
1 2
import React from 'react';
import { Modal } from 'antd';
3
import { RenderFormByContent } from '../RenderForm';
王绍森's avatar
王绍森 committed
4

5 6 7 8 9 10 11 12 13 14 15
const CreateForm = (props) => {
	const {
		modalVisible,
		handleAdd,
		isAdd,
		handleModalVisible,
		content,
		form,
		templateCode,
		confirmLoading,
	} = props;
王绍森's avatar
王绍森 committed
16

17 18 19 20 21 22 23 24 25 26 27 28 29
	return (
		<Modal
			width="1000px"
			maskClosable={false}
			destroyOnClose
			title={isAdd ? '新增' : '编辑'}
			visible={modalVisible}
			onOk={handleAdd}
			onCancel={handleModalVisible}
			confirmLoading={confirmLoading}>
			<RenderFormByContent form={form} content={content} templateCode={templateCode} />
		</Modal>
	);
王绍森's avatar
王绍森 committed
30 31 32
};

export default CreateForm;