|
@@ -77,7 +77,10 @@ const SubContent = React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
- type: 0,
|
|
|
+ type: 1,
|
|
|
+ fieldFirstOption: [],
|
|
|
+ fieldSecondOption: [],
|
|
|
+ fieldThirdOption: [],
|
|
|
pagination: {
|
|
|
pageNo: 1,
|
|
|
pageSize: 12,
|
|
@@ -88,9 +91,12 @@ const SubContent = React.createClass({
|
|
|
},
|
|
|
componentWillMount() {
|
|
|
let theFieldArr = [], theProvinceArr = [];
|
|
|
+ theFieldArr.push(
|
|
|
+ <Radio.Button key={999} value={999}>不限</Radio.Button>
|
|
|
+ );
|
|
|
techFieldList.map((item) => {
|
|
|
theFieldArr.push(
|
|
|
- <Select.Option key={item.value}>{item.label}</Select.Option>
|
|
|
+ <Radio.Button value={item.value} key={item.value}>{item.label}</Radio.Button>
|
|
|
)
|
|
|
});
|
|
|
provinceList.map((item) => {
|
|
@@ -110,47 +116,57 @@ const SubContent = React.createClass({
|
|
|
},
|
|
|
fieldFirstChange(e) {
|
|
|
let theArr = [];
|
|
|
- techFieldList.map((item) => {
|
|
|
- if (item.value == e) {
|
|
|
- item.children.map((children) => {
|
|
|
- theArr.push(
|
|
|
- <Select.Option key={children.value}>{children.label}</Select.Option>
|
|
|
- )
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- this.state.firstField = e;
|
|
|
- this.state.secondField = undefined;
|
|
|
- this.state.thirdField = undefined;
|
|
|
+ if (e.target.value !== 999) {
|
|
|
+ theArr.push(
|
|
|
+ <Radio.Button key={999} value={999}>不限</Radio.Button>
|
|
|
+ );
|
|
|
+ techFieldList.map((item) => {
|
|
|
+ if (item.value == e.target.value) {
|
|
|
+ item.children.map((children) => {
|
|
|
+ theArr.push(
|
|
|
+ <Radio.Button value={children.value} key={children.value}>{children.label}</Radio.Button>
|
|
|
+ )
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.state.firstField = e.target.value;
|
|
|
+ } else {
|
|
|
+ this.state.firstField = null;
|
|
|
+ };
|
|
|
+ this.state.secondField = null;
|
|
|
+ this.state.thirdField = null;
|
|
|
this.setState({
|
|
|
fieldSecondOption: theArr,
|
|
|
- firstField: e,
|
|
|
- secondField: undefined,
|
|
|
- thirdField: undefined
|
|
|
+ fieldThirdOption: []
|
|
|
});
|
|
|
this.loadData();
|
|
|
},
|
|
|
fieldSecondChange(e) {
|
|
|
let theArr = [], _me = this;
|
|
|
- techFieldList.map((item) => {
|
|
|
- if (item.value == _me.state.firstField) {
|
|
|
- item.children.map((children) => {
|
|
|
- if (children.value == e) {
|
|
|
- children.children.map((third) => {
|
|
|
- theArr.push(
|
|
|
- <Select.Option key={third.value}>{third.label}</Select.Option>
|
|
|
- )
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- this.state.secondField = e;
|
|
|
- this.state.thirdField = undefined;
|
|
|
+ if (e.target.value !== 999) {
|
|
|
+ theArr.push(
|
|
|
+ <Radio.Button key={999} value={999}>不限</Radio.Button>
|
|
|
+ );
|
|
|
+ techFieldList.map((item) => {
|
|
|
+ if (item.value == _me.state.firstField) {
|
|
|
+ item.children.map((children) => {
|
|
|
+ if (children.value == e.target.value) {
|
|
|
+ children.children.map((third) => {
|
|
|
+ theArr.push(
|
|
|
+ <Radio.Button value={third.value} key={third.value}>{third.label}</Radio.Button>
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.state.secondField = e.target.value;
|
|
|
+ } else {
|
|
|
+ this.state.secondField = null;
|
|
|
+ this.state.thirdField = null;
|
|
|
+ };
|
|
|
this.setState({
|
|
|
- fieldThirdOption: theArr,
|
|
|
- secondField: e,
|
|
|
- thirdField: undefined
|
|
|
+ fieldThirdOption: theArr
|
|
|
});
|
|
|
this.loadData();
|
|
|
},
|
|
@@ -208,156 +224,73 @@ const SubContent = React.createClass({
|
|
|
const _me = this;
|
|
|
return (
|
|
|
<div className="portal-body">
|
|
|
- <div className="portal-nav clearfix">
|
|
|
- <div className="nav-logoBox">
|
|
|
- <img onClick={() => { window.open(globalConfig.context + '/portal/index.html') }} src={logoImg} alt="" />
|
|
|
- </div>
|
|
|
- <ul className="nav-list clearfix">
|
|
|
- <li className={this.props.searchType == 'achievement' ? 'active' : ''}><a href={"/portal/search/achievement.html"}>科技成果</a></li>
|
|
|
- <li className={this.props.searchType == 'demand' ? 'active' : ''}><a href={"/portal/search/demand.html"}>科技需求</a></li>
|
|
|
- <li className={this.props.searchType == 'subscriber' ? 'active' : ''}><a href={"/portal/search/subscriber.html"}>伙伴/行家</a></li>
|
|
|
- </ul>
|
|
|
- <div className="nav-search">
|
|
|
- <Input onChange={(e) => { this.state.searchName = e.target.value; }} />
|
|
|
- <Button onClick={() => { this.loadData() }}>
|
|
|
- <img src={searchImg} alt="" />
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<div className="portal-content clearfix" >
|
|
|
<Row className="search-criteria">
|
|
|
<Col className="search-title" span={2}>
|
|
|
<span>行业分类</span>
|
|
|
</Col>
|
|
|
<Col className="search-select" span={22}>
|
|
|
- <Select style={{ width: 160, marginRight: '10px', marginBottom: '10px' }}
|
|
|
- value={this.state.firstField}
|
|
|
- placeholder="请选择行业一级分类"
|
|
|
- notFoundContent="未获取到行业分类"
|
|
|
- showSearch
|
|
|
- filterOption={companySearch}
|
|
|
- onChange={this.fieldFirstChange}>
|
|
|
+ <Radio.Group defaultValue={999} onChange={this.fieldFirstChange}>
|
|
|
{this.state.fieldFirstOption}
|
|
|
- </Select>
|
|
|
- <Select style={{ width: 200, marginRight: '10px', marginBottom: '10px' }}
|
|
|
- value={this.state.secondField}
|
|
|
- placeholder="请选择行业二级分类"
|
|
|
- notFoundContent="未获取到行业分类"
|
|
|
- showSearch
|
|
|
- filterOption={companySearch}
|
|
|
- onChange={this.fieldSecondChange}>
|
|
|
- {this.state.fieldSecondOption}
|
|
|
- </Select>
|
|
|
- <Select style={{ width: 240, marginRight: '10px', marginBottom: '10px' }}
|
|
|
- value={this.state.thirdField}
|
|
|
- placeholder="请选择行业三级分类"
|
|
|
- notFoundContent="未获取到行业分类"
|
|
|
- showSearch
|
|
|
- filterOption={companySearch}
|
|
|
- onChange={(e) => {
|
|
|
- this.state.thirdField = e;
|
|
|
- this.setState({ thirdField: e });
|
|
|
- this.loadData();
|
|
|
- }}>
|
|
|
- {this.state.fieldThirdOption}
|
|
|
- </Select>
|
|
|
- <Button type="ghost" style={{ marginLeft: '20px' }}
|
|
|
- onClick={() => {
|
|
|
- this.setState({
|
|
|
- firstField: undefined,
|
|
|
- secondField: undefined,
|
|
|
- thirdField: undefined
|
|
|
- });
|
|
|
- this.state.firstField = undefined;
|
|
|
- this.state.secondField = undefined;
|
|
|
- this.state.thirdField = undefined;
|
|
|
- this.loadData();
|
|
|
- }}>不限</Button>
|
|
|
+ </Radio.Group>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
- <Row className="search-criteria">
|
|
|
+ {this.state.fieldSecondOption.length > 1 ? <Row className="search-criteria">
|
|
|
<Col className="search-title" span={2}>
|
|
|
- <span>地区</span>
|
|
|
+ <span>行业二级分类</span>
|
|
|
</Col>
|
|
|
<Col className="search-select" span={22}>
|
|
|
- <Select style={{ width: 100, marginRight: '10px', marginBottom: '10px' }}
|
|
|
- value={this.state.province}
|
|
|
- placeholder="请选择省份"
|
|
|
- notFoundContent="未获取到省份列表"
|
|
|
- showSearch
|
|
|
- filterOption={companySearch}
|
|
|
- onChange={this.provinceChange}>
|
|
|
- {this.state.provinceOption}
|
|
|
- </Select>
|
|
|
- <Select style={{ width: 160, marginRight: '10px', marginBottom: '10px' }}
|
|
|
- value={this.state.city}
|
|
|
- placeholder="请选择城市"
|
|
|
- notFoundContent="未获取到城市列表"
|
|
|
- showSearch
|
|
|
- filterOption={companySearch}
|
|
|
- onChange={this.cityChange}>
|
|
|
- {this.state.cityOption}
|
|
|
- </Select>
|
|
|
- <Select style={{ width: 160, marginRight: '10px', marginBottom: '10px' }}
|
|
|
- value={this.state.area}
|
|
|
- placeholder="请选择行政区"
|
|
|
- notFoundContent="未获取到行政区列表"
|
|
|
- showSearch
|
|
|
- filterOption={companySearch}
|
|
|
- onChange={(e) => {
|
|
|
- this.state.area = e;
|
|
|
- this.setState({ area: e });
|
|
|
- this.loadData();
|
|
|
- }}>
|
|
|
- {this.state.areaOption}
|
|
|
- </Select>
|
|
|
- <Button type="ghost" style={{ marginLeft: '20px' }}
|
|
|
- onClick={() => {
|
|
|
- this.setState({
|
|
|
- province: undefined,
|
|
|
- city: undefined,
|
|
|
- area: undefined
|
|
|
- });
|
|
|
- this.state.province = undefined;
|
|
|
- this.state.city = undefined;
|
|
|
- this.state.area = undefined;
|
|
|
- this.loadData();
|
|
|
- }}>不限</Button>
|
|
|
+ <Radio.Group defaultValue={999} onChange={this.fieldSecondChange}>
|
|
|
+ {this.state.fieldSecondOption}
|
|
|
+ </Radio.Group>
|
|
|
</Col>
|
|
|
- </Row>
|
|
|
- <Row className="search-criteria">
|
|
|
+ </Row> : <div></div>}
|
|
|
+ {this.state.fieldThirdOption.length > 1 ? <Row className="search-criteria">
|
|
|
<Col className="search-title" span={2}>
|
|
|
- <span>用户类型</span>
|
|
|
+ <span>行业三级分类</span>
|
|
|
</Col>
|
|
|
- <Col className="search-select" span={6}>
|
|
|
- <Radio.Group defaultValue={0} onChange={(e) => {
|
|
|
- this.setState({
|
|
|
- type: e.target.value
|
|
|
- });
|
|
|
- this.state.type = e.target.value;
|
|
|
- this.loadData();
|
|
|
+ <Col className="search-select" span={22}>
|
|
|
+ <Radio.Group defaultValue={999} onChange={(e) => {
|
|
|
+ if (e.target.value !== 999) {
|
|
|
+ this.state.thirdField = e.target.value;
|
|
|
+ } else {
|
|
|
+ this.state.thirdField = null;
|
|
|
+ }
|
|
|
+ this.loadData()
|
|
|
}}>
|
|
|
- <Radio.Button value={0}>个人</Radio.Button>
|
|
|
- <Radio.Button value={1}>组织</Radio.Button>
|
|
|
+ {this.state.fieldThirdOption}
|
|
|
</Radio.Group>
|
|
|
</Col>
|
|
|
+ </Row> : <div></div>}
|
|
|
+ <Row className="search-criteria">
|
|
|
+ <Col className="search-title" span={2}>
|
|
|
+ <span>行家名称</span>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <div className="nav-search" style={{ float: 'none', marginBottom: '10px' }}>
|
|
|
+ <Input onChange={(e) => { this.state.searchName = e.target.value; }} />
|
|
|
+ <Button onClick={() => { this.loadData() }}>
|
|
|
+ <img src={searchImg} alt="" />
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </Col>
|
|
|
</Row>
|
|
|
<Spin spinning={this.state.loading}>
|
|
|
<ul className="clearfix">
|
|
|
{this.state.dataSource.map((item, i) => {
|
|
|
return <li key={i} className="user-detail" onClick={() => { _me.tableRowClick(item); }}>
|
|
|
<div className="logo">
|
|
|
- <img src={(item.personPortraitUrl || item.logoUrl) ?
|
|
|
- (globalConfig.avatarHost + "/upload" + (_me.state.type == 0 ? item.personPortraitUrl : item.logoUrl))
|
|
|
+ <img src={item.personPortraitUrl ?
|
|
|
+ (globalConfig.avatarHost + "/upload" + item.personPortraitUrl)
|
|
|
: avatarImg} alt="头像" />
|
|
|
</div>
|
|
|
<div className="name">
|
|
|
- {_me.state.type == 0 ? item.username : item.unitName}
|
|
|
+ {item.username}
|
|
|
</div>
|
|
|
<div className="province">
|
|
|
<span style={{ letterSpacing: '32px' }}>地</span>
|
|
|
<span>区: </span>
|
|
|
- <span className="address"> {getProvince(item.province)}</span>
|
|
|
+ <span className="text-address"> {getProvince(item.province)}</span>
|
|
|
</div>
|
|
|
<div className="text">
|
|
|
<span style={{ letterSpacing: '32px' }}>需</span>
|
|
@@ -386,4 +319,56 @@ const SubContent = React.createClass({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-export default SubContent;
|
|
|
+export default SubContent;
|
|
|
+
|
|
|
+
|
|
|
+ // <Row className="search-criteria">
|
|
|
+ // <Col className="search-title" span={2}>
|
|
|
+ // <span>地区</span>
|
|
|
+ // </Col>
|
|
|
+ // <Col className="search-select" span={22}>
|
|
|
+ // <Select style={{ width: 100, marginRight: '10px', marginBottom: '10px' }}
|
|
|
+ // value={this.state.province}
|
|
|
+ // placeholder="请选择省份"
|
|
|
+ // notFoundContent="未获取到省份列表"
|
|
|
+ // showSearch
|
|
|
+ // filterOption={companySearch}
|
|
|
+ // onChange={this.provinceChange}>
|
|
|
+ // {this.state.provinceOption}
|
|
|
+ // </Select>
|
|
|
+ // <Select style={{ width: 160, marginRight: '10px', marginBottom: '10px' }}
|
|
|
+ // value={this.state.city}
|
|
|
+ // placeholder="请选择城市"
|
|
|
+ // notFoundContent="未获取到城市列表"
|
|
|
+ // showSearch
|
|
|
+ // filterOption={companySearch}
|
|
|
+ // onChange={this.cityChange}>
|
|
|
+ // {this.state.cityOption}
|
|
|
+ // </Select>
|
|
|
+ // <Select style={{ width: 160, marginRight: '10px', marginBottom: '10px' }}
|
|
|
+ // value={this.state.area}
|
|
|
+ // placeholder="请选择行政区"
|
|
|
+ // notFoundContent="未获取到行政区列表"
|
|
|
+ // showSearch
|
|
|
+ // filterOption={companySearch}
|
|
|
+ // onChange={(e) => {
|
|
|
+ // this.state.area = e;
|
|
|
+ // this.setState({ area: e });
|
|
|
+ // this.loadData();
|
|
|
+ // }}>
|
|
|
+ // {this.state.areaOption}
|
|
|
+ // </Select>
|
|
|
+ // <Button type="ghost" style={{ marginLeft: '20px' }}
|
|
|
+ // onClick={() => {
|
|
|
+ // this.setState({
|
|
|
+ // province: undefined,
|
|
|
+ // city: undefined,
|
|
|
+ // area: undefined
|
|
|
+ // });
|
|
|
+ // this.state.province = undefined;
|
|
|
+ // this.state.city = undefined;
|
|
|
+ // this.state.area = undefined;
|
|
|
+ // this.loadData();
|
|
|
+ // }}>不限</Button>
|
|
|
+ // </Col>
|
|
|
+ // </Row>
|