render() {
const { content } = this.state;
const { modalData, authorsData, executorsData } = this.props;
return (
<div>
<Modal
visible={this.props.visible}
onOk={this.props.onOk}
onCancel={this.props.onCancel}
afterClose={this.closeModal}
>
<div style={{ display: 'flex', marginTop: '2rem' }}>
<Text>{this.intl("resolutions-input-authorName")}</Text>
<Select defaultValue={authorsData ?
authorsData.map(item => item.OwnName) : null} style={{ marginLeft: '1rem', width: '100%' }} >
{authorsData ?
authorsData.map(item => <Option key={
item.id} value={item.OwnName} >{item.OwnName}</Option>) : null}
</Select>
</div>
<div style={{ display: 'flex', marginTop: '1rem' }}>
<Text>{this.intl("resolutions-textarea-content")}</Text>
<TextArea defaultValue={content ? content.Content : null} style={{ marginLeft: '10px' }} />
</div>
<div style={{ display: 'flex', marginTop: '1rem' }}>
<ConfigProvider locale={locale}>
<Text>{this.intl("resolutions-datepicker-dataResolution")}</Text>
<DatePicker defaultValue={modalData ? moment(modalData.dateK_fact, "DD-MM-YYYY").startOf('date') : null} format={"DD-MM-YYYY"} picker="date" style={{ marginLeft: '10px' }} />
</ConfigProvider>
</div>
</Modal>
</div>
);
Родитель
<Button type="primary" onClick={() => this.showModal(selectData)} }>{this.intl("resolutions-showButton-name")}</Button>
<ModalComponent
visible={this.state.visibleModal}
onOk={this.handleOk}
onCancel={this.handleCancel}
onClick={this.handleCancel}
modalData={modalData}
authorsData={authorsData}
executorsData={executorsData} />