|
@@ -1,23 +1,19 @@
|
|
|
import React, { PureComponent, Fragment } from 'react';
|
|
|
import { connect } from 'react-redux';
|
|
|
-import { Input, Cascader,message } from 'antd';
|
|
|
+import { Input, Cascader, message } from 'antd';
|
|
|
import { actionCreators } from './store';
|
|
|
|
|
|
import options from '../popups/districtOptions.json';
|
|
|
|
|
|
-const error = (msg) => {
|
|
|
- message.error({
|
|
|
- content: msg,
|
|
|
- });
|
|
|
- };
|
|
|
+
|
|
|
|
|
|
class company extends PureComponent {
|
|
|
|
|
|
render() {
|
|
|
- const { companyDetail,natureOptions,handleModifyCompany } = this.props;
|
|
|
+ const { companyDetail, natureOptions, handleModifyCompany } = this.props;
|
|
|
let companyDetail2 = companyDetail.toJS();
|
|
|
let natureOptions2 = natureOptions.toJS();
|
|
|
-
|
|
|
+
|
|
|
return (
|
|
|
<Fragment>
|
|
|
|
|
@@ -58,17 +54,18 @@ class company extends PureComponent {
|
|
|
<div className="cldform-label">公司全称</div>
|
|
|
<div className="cldform-control">
|
|
|
|
|
|
- {/* {false ?(<Input id="2"
|
|
|
+ {/* {false ?(<Input id="2"
|
|
|
value={companyDetail2.companyname}
|
|
|
onClick={() => console.log('false')}
|
|
|
onChange={() => console.log('sdf')}
|
|
|
/>):(<div onClick={() => console.log('false')} className="cldform-contarl-box cldform-contarl-textareabox"><span>张三</span></div>)} */}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
<Input id="2"
|
|
|
value={companyDetail2.companyname}
|
|
|
- onChange={(e) => handleModifyCompany('companyname',e,'公司全称')}
|
|
|
+ onChange={(e) => handleModifyCompany({
|
|
|
+ 'field': 'companyname', 'value': e.target.value
|
|
|
+ , 'key': companyDetail2.key, 'title': '公司全称'
|
|
|
+ })}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -76,8 +73,13 @@ class company extends PureComponent {
|
|
|
<div className="cldform-item cldform-item-wauto">
|
|
|
<div className="cldform-label">公司地区</div>
|
|
|
<div className="cldform-control">
|
|
|
- {/* {["19","292","3066"]} */}
|
|
|
- <Cascader options={options} value={companyDetail2.district} style={{ width: '100%' }} placeholder="公司地区" />
|
|
|
+ {/* {["19","292","3066"]} */}
|
|
|
+ <Cascader options={options} value={companyDetail2.district} style={{ width: '100%' }} placeholder="公司地区"
|
|
|
+ onChange={(e, selectedOptions) => handleModifyCompany({
|
|
|
+ 'field': 'district', 'value': e
|
|
|
+ , 'key': companyDetail2.key, 'title': '公司地区', 'lable': selectedOptions
|
|
|
+ })}
|
|
|
+ />
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
@@ -85,15 +87,21 @@ class company extends PureComponent {
|
|
|
<div className="cldform-item cldform-item-wauto">
|
|
|
<div className="cldform-label">公司性质</div>
|
|
|
<div className="cldform-control">
|
|
|
- <Cascader options={natureOptions2} value={[companyDetail2.nature]} placeholder="公司性质" style={{ width: '100%' }} />
|
|
|
+ <Cascader options={natureOptions2} value={[companyDetail2.nature]} placeholder="公司性质" style={{ width: '100%' }}
|
|
|
+ onChange={(e, selectedOptions) => handleModifyCompany({
|
|
|
+ 'field': 'nature', 'value': e
|
|
|
+ , 'key': companyDetail2.key, 'title': '公司性质', 'lable': selectedOptions
|
|
|
+ })}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="cldform-line"></div>
|
|
|
<div className="cldform-item">
|
|
|
<div className="cldform-label">公司地址</div>
|
|
|
<div className="cldform-control">
|
|
|
- <Input id="2"
|
|
|
- value={companyDetail2.address}
|
|
|
+ <Input id="2" value={companyDetail2.address}
|
|
|
+ onChange={(e) => handleModifyCompany({ 'field': 'address', 'value': e.target.value
|
|
|
+ , 'key': companyDetail2.key, 'title': '公司地址' })}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -103,6 +111,8 @@ class company extends PureComponent {
|
|
|
<div className="cldform-control">
|
|
|
<Input id="2"
|
|
|
value={companyDetail2.fax}
|
|
|
+ onChange={(e) => handleModifyCompany({ 'field': 'fax', 'value': e.target.value
|
|
|
+ , 'key': companyDetail2.key, 'title': '公司传真' })}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -111,6 +121,8 @@ class company extends PureComponent {
|
|
|
<div className="cldform-control">
|
|
|
<Input id="2"
|
|
|
value={companyDetail2.webservice}
|
|
|
+ onChange={(e) => handleModifyCompany({ 'field': 'webservice', 'value': e.target.value
|
|
|
+ , 'key': companyDetail2.key, 'title': '网址' })}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -120,6 +132,9 @@ class company extends PureComponent {
|
|
|
<div className="cldform-control">
|
|
|
<Input id="2"
|
|
|
value={companyDetail2.ride}
|
|
|
+
|
|
|
+ onChange={(e) => handleModifyCompany({ 'field': 'ride', 'value': e.target.value
|
|
|
+ , 'key': companyDetail2.key, 'title': '乘车路线' })}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -129,6 +144,8 @@ class company extends PureComponent {
|
|
|
<div className="cldform-control">
|
|
|
<Input id="2"
|
|
|
value={companyDetail2.landmarks}
|
|
|
+ onChange={(e) => handleModifyCompany({ 'field': 'landmarks', 'value': e.target.value
|
|
|
+ , 'key': companyDetail2.key, 'title': '地标建筑' })}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -138,6 +155,8 @@ class company extends PureComponent {
|
|
|
<div className="cldform-control">
|
|
|
<Input id="2"
|
|
|
value={companyDetail2.stay}
|
|
|
+ onChange={(e) => handleModifyCompany({ 'field': 'stay', 'value': e.target.value
|
|
|
+ , 'key': companyDetail2.key, 'title': '参考住宿' })}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -147,6 +166,8 @@ class company extends PureComponent {
|
|
|
<div className="cldform-control">
|
|
|
<Input id="2"
|
|
|
value={companyDetail2.remarks}
|
|
|
+ onChange={(e) => handleModifyCompany({ 'field': 'remarks', 'value': e.target.value
|
|
|
+ , 'key': companyDetail2.key, 'title': '备注' })}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -163,22 +184,22 @@ let delaySwitch = null;//延迟检索开关
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
return {
|
|
|
- companyDetail: state.getIn(['popups', 'companyDetail']),
|
|
|
- natureOptions: state.getIn(['popups', 'natureOptions']),
|
|
|
+ companyDetail: state.getIn(['companyPopups', 'companyDetail']),
|
|
|
+ natureOptions: state.getIn(['companyPopups', 'natureOptions']),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const mapDispathToProps = (dispatch) => {
|
|
|
return {
|
|
|
- handleModifyCompany(name, e,title) {
|
|
|
- let value=e.target.value;
|
|
|
+ handleModifyCompany(parameter) {
|
|
|
+ dispatch(actionCreators.changeInputValue(parameter));
|
|
|
if (delaySwitch != null) {
|
|
|
clearTimeout(delaySwitch);
|
|
|
- }
|
|
|
- delaySwitch = setTimeout(() => {
|
|
|
- dispatch(actionCreators.modifyCompany(name, value,title,error));
|
|
|
- }, 350);
|
|
|
- },
|
|
|
+ }
|
|
|
+ delaySwitch = setTimeout(() => {
|
|
|
+ dispatch(actionCreators.modifyCompany(parameter));
|
|
|
+ }, 800);
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
|