import React, { Component } from 'react'; import { Form, Modal, Alert } from 'antd'; import './index.less'; import Select from '@src/components/Select'; import QuestionNoList from '../QuestionNoList'; class Association extends Component { constructor(props) { super(props); this.state = { ids: this.props.ids, nos: this.props.nos, show: !!props.modal, loading: false, err: '' }; this.questionNos = []; } onConfirm() { this.props.form.validateFields((err, fieldsValue) => { if (err) { return; } if (this.props.onConfirm && this.props.modal) { this.setState({ loading: true }); this.props .onConfirm(fieldsValue) .then(() => { this.setState({ loading: false }); this.onCancel(); }) .catch(e => { this.setState({ loading: false, err: e.message }); }); } else { this.onCancel(); } }); } onCancel() { if (this.props.modal) this.setState({ show: false }); if (this.props.onCancel) this.props.onCancel(); } renderForm() { const { getFieldDecorator, setFieldsValue } = this.props.form; const { field = 'questionNoIds' } = this.props; return
{getFieldDecorator(field)(