diff --git a/.gitignore b/.gitignore index bdba67fc..aa3fce58 100755 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ yarn-error.log .idea yarn.lock package-lock.json +*bak jsconfig.json diff --git a/src/routes/List/TableList.js b/src/routes/List/TableList.js index 2cc07775..54577f02 100644 --- a/src/routes/List/TableList.js +++ b/src/routes/List/TableList.js @@ -10,6 +10,36 @@ const FormItem = Form.Item; const { Option } = Select; const getValue = obj => Object.keys(obj).map(key => obj[key]).join(','); +const CreateForm = Form.create()((props) => { + const { modalVisible, addInputValue, parent, form } = props; + const okHandle = () => { + form.validateFields((err/* , fieldsValue */) => { + if (err) return; + parent.handleAdd(); + }); + }; + return ( + parent.handleModalVisible()} + > + + {form.getFieldDecorator('desc', { + rules: [{ required: true, message: 'Please input some description...' }], + })( + + )} + + + ); +}); + @connect(({ rule, loading }) => ({ rule, loading: loading.models.rule, @@ -279,6 +309,12 @@ export default class TableList extends PureComponent { ); + const parentMethods = { + handleAdd: this.handleAdd, + handleModalVisible: this.handleModalVisible, + handleAddInput: this.handleAddInput, + }; + return ( @@ -312,20 +348,11 @@ export default class TableList extends PureComponent { /> - this.handleModalVisible()} - > - - - - + ); }