From f049d7763c066101b30ac397f8b105f2b7637f44 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 24 Jul 2019 15:40:08 +0800 Subject: [PATCH] addSuc --- .../src/modules/user/account/AccountBasicEdit.js | 11 ++++++++++- .../src/modules/user/modal/ApplyForAddOrgModal.js | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 8af24022d..13741fd5b 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -273,6 +273,14 @@ class AccountBasic extends Component { } } + addOrgSuccess = (name) => { + const schoolList = this.state.schoolList.slice(0) + schoolList.push({ id: schoolList.length + 2000, name: name}) + this.setState({ schoolList }) + this.props.form.setFieldsValue({ + name: name + }) + } showApplyForAddOrgModal = () => { this.applyForAddOrgForm.setVisible(true) @@ -309,7 +317,8 @@ class AccountBasic extends Component { return (
this.applyForAddOrgForm = form} schoolName={school} - {...propsWithoutForm}> + {...propsWithoutForm} addOrgSuccess={this.addOrgSuccess} + > this.applyForAddChildOrgForm = form} > diff --git a/public/react/src/modules/user/modal/ApplyForAddOrgModal.js b/public/react/src/modules/user/modal/ApplyForAddOrgModal.js index 95cfa9105..72ae542c6 100644 --- a/public/react/src/modules/user/modal/ApplyForAddOrgModal.js +++ b/public/react/src/modules/user/modal/ApplyForAddOrgModal.js @@ -48,6 +48,7 @@ class ApplyForAddOrgModal extends Component{ }).then((result)=>{ if(result){ this.props.showNotification("新增学校/单位成功!"); + this.props.addOrgSuccess(values.schoolName) this.setVisible(false); } }).catch((error)=>{