From 3e648171683162a75e98bc85ea705686cac5d214 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Fri, 19 Jul 2019 15:18:58 +0800
Subject: [PATCH] city
---
.../react/src/common/components/form/City.js | 13 +++++--
.../modules/user/account/AccountBasicEdit.js | 35 ++++++++++---------
.../modules/user/modal/ApplyForAddOrgModal.js | 12 ++++---
3 files changed, 37 insertions(+), 23 deletions(-)
diff --git a/public/react/src/common/components/form/City.js b/public/react/src/common/components/form/City.js
index dea65877b..b397c8b59 100644
--- a/public/react/src/common/components/form/City.js
+++ b/public/react/src/common/components/form/City.js
@@ -1719,6 +1719,10 @@ const options = [{
label: '其他'
}],
}];
+
+function filter(inputValue, path) {
+ return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
+}
class City extends Component{
constructor(props){
super(props);
@@ -1739,11 +1743,16 @@ class City extends Component{
}
}
render(){
- const { defaultValue } = this.props
+ const { defaultValue, matchInputWidth, className, popupClassName } = this.props
const { value } = this.state
+ // 这里用请选择所在省市的话,会触发chrome的地址选择
return(
-
)
}
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index 2362437fb..182730170 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -110,11 +110,7 @@ class AccountBasic extends Component {
this.props.form.validateFieldsAndScroll((err, values) => {
console.log(values);
let {basicInfo}=this.props;
- // TODO 为什么modal里的form影响到这里的了
- if (err) {
- delete err.depart
- }
- if(!err || Object.keys(err).length == 0){
+ if(!err ){
let url=`/users/accounts/${basicInfo.id}.json`
axios.put((url),{
nickname:values.nickname,
@@ -202,16 +198,18 @@ class AccountBasic extends Component {
}
//搜索部门
searchDepartment=(e)=>{
- this.props.form.setFieldsValue({
- org2:e
- })
- let arr = this.state.departments.filter(function(item){
- return item.name.indexOf(e) > -1
- })
- this.setState({
- filterDepartments:arr,
- departmentsName:e
- })
+ if (e) {
+ this.props.form.setFieldsValue({
+ org2:e
+ })
+ let arr = this.state.departments.filter(function(item){
+ return item.name.indexOf(e) > -1
+ })
+ this.setState({
+ filterDepartments:arr,
+ departmentsName:e
+ })
+ }
}
// 选择部门、学院
@@ -306,12 +304,15 @@ class AccountBasic extends Component {
const { getFieldDecorator } = this.props.form;
let{basicInfo}=this.props
+ // form合并了
+ const propsWithoutForm = Object.assign({}, this.props)
+ delete propsWithoutForm.form
return (
this.applyForAddOrgForm = form} schoolName={school}
- {...this.props}>
+ {...propsWithoutForm}>
this.applyForAddChildOrgForm = form} >
+ {...propsWithoutForm} wrappedComponentRef={(form) => this.applyForAddChildOrgForm = form} >
+
)}