|
@@ -1,44 +1,17 @@
|
|
|
import React, { PureComponent, Fragment } from 'react';
|
|
|
import { connect } from 'react-redux';
|
|
|
import { Input, Cascader } from 'antd';
|
|
|
+import { actionCreators } from './store';
|
|
|
|
|
|
-
|
|
|
-const options = [
|
|
|
- {
|
|
|
- value: 'zhejiang',
|
|
|
- label: '浙江',
|
|
|
- children: [{
|
|
|
- value: 'hangzhou',
|
|
|
- label: '杭州',
|
|
|
- children: [{
|
|
|
- value: 'xihu',
|
|
|
- label: '西湖',
|
|
|
- }],
|
|
|
- }],
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'jiangsu',
|
|
|
- label: '江苏',
|
|
|
- children: [{
|
|
|
- value: 'nanjing',
|
|
|
- label: '南京',
|
|
|
- children: [{
|
|
|
- value: 'zhonghuamen',
|
|
|
- label: '中华门',
|
|
|
- }],
|
|
|
- }],
|
|
|
- }
|
|
|
-];
|
|
|
+import options from './districtOptions.json';
|
|
|
|
|
|
class company extends PureComponent {
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
render() {
|
|
|
- const { companyDetail } = this.props;
|
|
|
+ const { companyDetail,natureOptions,handleModifyCompany } = this.props;
|
|
|
let companyDetail2 = companyDetail.toJS();
|
|
|
-
|
|
|
+ let natureOptions2 = natureOptions.toJS();
|
|
|
+
|
|
|
return (
|
|
|
<Fragment>
|
|
|
|
|
@@ -78,10 +51,18 @@ class company extends PureComponent {
|
|
|
<div className="cldform-item">
|
|
|
<div className="cldform-label">公司全称</div>
|
|
|
<div className="cldform-control">
|
|
|
- <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)}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -89,7 +70,8 @@ class company extends PureComponent {
|
|
|
<div className="cldform-item cldform-item-wauto">
|
|
|
<div className="cldform-label">公司地区</div>
|
|
|
<div className="cldform-control">
|
|
|
- <Cascader options={options} defaultValue={['zhejiang', 'hangzhou', 'xihu']} placeholder="公司地区" />
|
|
|
+ {/* {["19","292","3066"]} */}
|
|
|
+ <Cascader options={options} value={companyDetail2.district} style={{ width: '100%' }} placeholder="公司地区" />
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
@@ -97,7 +79,7 @@ class company extends PureComponent {
|
|
|
<div className="cldform-item cldform-item-wauto">
|
|
|
<div className="cldform-label">公司性质</div>
|
|
|
<div className="cldform-control">
|
|
|
- <Cascader options={options} placeholder="公司性质" />
|
|
|
+ <Cascader options={natureOptions2} value={[companyDetail2.nature]} placeholder="公司性质" style={{ width: '100%' }} />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="cldform-line"></div>
|
|
@@ -171,14 +153,27 @@ class company extends PureComponent {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+let delaySwitch = null;//延迟检索开关
|
|
|
+
|
|
|
const mapStateToProps = (state) => {
|
|
|
return {
|
|
|
companyDetail: state.getIn(['popups', 'companyDetail']),
|
|
|
+ natureOptions: state.getIn(['popups', 'natureOptions']),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const mapDispathToProps = (dispatch) => {
|
|
|
- return {}
|
|
|
+ return {
|
|
|
+ handleModifyCompany(name, e) {
|
|
|
+ let value=e.target.value;
|
|
|
+ if (delaySwitch != null) {
|
|
|
+ clearTimeout(delaySwitch);
|
|
|
+ }
|
|
|
+ delaySwitch = setTimeout(() => {
|
|
|
+ dispatch(actionCreators.modifyCompany(name, value));
|
|
|
+ }, 350);
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispathToProps)(company);
|