import * as React from 'react' import './index.less' import { Modal, Form, Input } from 'antd' import { FormInstance } from 'antd/lib/form' interface IProps { onOk?: () => void } interface IState { visible: boolean modelData: any } export default class ${className} extends React.Component { private formRef = React.createRef() constructor(props: IProps) { super(props) this.state = { visible: false, modelData: null, } } public showModel() { this.setState({ visible: true, }) } private handleCancel = () => { this.setState({ visible: false, }) } private handleOk = async () => { if (await this.formRef.current?.validateFields()) { const values = this.formRef.current?.getFieldsValue() // this.setState({ // visible: false, // }) this.props.onOk && this.props.onOk() } } public render() { const { modelData } = this.state return (
) } }