liting2017 7 years ago
parent
commit
1348892ebf

+ 10 - 1
js/component/dataDic.js

@@ -813,5 +813,14 @@ module.exports = {
             key: "是"
         }
     ],
-    
+    //是否首页展示
+    hot:[
+        {
+            value: "0",
+            key: "否"
+        }, {
+            value: "1",
+            key: "是"
+        }
+    ],
 };

+ 26 - 4
js/component/manageCenter/achievement/techAchievement.jsx

@@ -6,7 +6,7 @@ import moment from 'moment';
 import './techAchievement.less';
 import TechAchievementDesc from './techAchievementDesc.jsx';
 import { achievementCategoryList, techAuditStatusList } from '../../dataDic.js';
-import { beforeUploadFile, companySearch, getAchievementCategory, getSearchUrl, getTechAuditStatus ,getboutique} from '../../tools.js';
+import { beforeUploadFile, companySearch, getAchievementCategory, getSearchUrl, getTechAuditStatus ,getboutique,gethot} from '../../tools.js';
 import BatchImport from './batchImport';
 
 const AchievementList = React.createClass({
@@ -34,7 +34,8 @@ const AchievementList = React.createClass({
                 releaseDateEndDate: this.state.releaseDate[1],
                 releaseStatus: this.state.releaseStatus ? Number(this.state.releaseStatus) : undefined, //是否发布(0--未发布,1--已发布)
                 auditStatus: this.state.auditStatus,
-                boutique:this.state.boutique
+                boutique:this.state.boutique,
+                hot:this.state.hot
             },
             success: function (data) {
                 let theArr = [];
@@ -61,7 +62,8 @@ const AchievementList = React.createClass({
                             releaseDate: thisdata.releaseDate,
                             releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
                             auditStatus: thisdata.auditStatus,
-                            boutique: thisdata.boutique
+                            boutique: thisdata.boutique,
+                            hot: thisdata.hot
                         });
                     };
                     this.state.pagination.current = data.data.pageNo;
@@ -133,6 +135,12 @@ const AchievementList = React.createClass({
                     key: 'boutique',
                     render: text => { return getboutique(text) }
                 },
+                 {
+                    title: '首页展示',
+                    dataIndex: 'hot',
+                    key: 'hot',
+                    render: text => { return gethot(text) }
+                },
                 {
                     title: '发布时间',
                     dataIndex: 'releaseDateFormattedDate',
@@ -249,7 +257,9 @@ const AchievementList = React.createClass({
         this.state.auditStatus = undefined;
         this.state.searchName = undefined;
         this.state.releaseDate = [];
-        this.loadData();
+        this.state.boutique = '';
+        this.state.hot='' ;
+        this.loadData();       
     },
     searchSwitch() {
         this.setState({
@@ -326,6 +336,18 @@ const AchievementList = React.createClass({
                         onClick={this.delectRow}>删除<Icon type="minus" /></Button>
                     <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
                     <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
+                    	<Radio.Group value={this.state.boutique} onChange={(e) => {
+		                    this.setState({ boutique: e.target.value })
+		                    }}>
+		                        <Radio value={1}>精品</Radio>
+		                        <Radio value={0}>非精品</Radio>
+		                </Radio.Group>
+		                <Radio.Group value={this.state.hot} onChange={(e) => {
+		                    this.setState({ hot: e.target.value })
+		                    }}>
+		                        <Radio value={1}>首页展示</Radio>
+		                        <Radio value={0}>首页不展示</Radio>
+		                </Radio.Group>
                         <Select placeholder="选择类型" style={{ width: 160 }}
                             value={this.state.category}
                             onChange={(e) => { this.setState({ category: e }) }}>

+ 30 - 1
js/component/manageCenter/achievement/techAchievement.less

@@ -28,7 +28,36 @@
         }
     }
 }
-
+.avatar-uploader,
+.avatar-uploader-trigger,
+.avatar {
+    width: 150px;
+    height: 150px;
+}
+.modal-box-title{float: left;}
+.modal-box-detail{margin-left: 10px;vertical-align: top;float: left;margin-top: 0px;width: 160px!important;}
+.avatar-uploader-trigger {
+    display: table-cell;
+    vertical-align: middle;
+    font-size: 28px;
+    color: #999;
+}
+.avatar-uploader {
+    display: block;
+    padding: 1px;
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    img {
+        position: absolute;
+        top: -1px;
+        left: -1px;
+        height: 150px;
+    } //
+    float: left;
+    margin-right: 20px;
+}
 .patent-addNew {
     float: right;
     margin-left: 20px;

+ 83 - 30
js/component/manageCenter/achievement/techAchievementDesc.jsx

@@ -5,8 +5,9 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { maturityList, innovationList, transferModeList } from '../../dataDic';
 import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
-import { beforeUploadFile, splitUrl, companySearch, getTransferMode, getAchievementCategory, getTechAuditStatus, getDemandType, getMaturity, getInnovation } from '../../tools.js';
+import { beforeUploadFile, splitUrl, companySearch, getTransferMode, getAchievementCategory, getTechAuditStatus, getDemandType, getMaturity, getInnovation,beforeUpload, getBase64 } from '../../tools.js';
 import throttle from '../../throttle.js';
+
 const KeyWordTagGroup = React.createClass({
     getInitialState() {
         return {
@@ -139,7 +140,8 @@ const AchievementDetailShow = Form.create()(React.createClass({
             data: {},
             tags: [],
             technicalPictureUrl: [],
-            maturityPictureUrl: [],
+            coverImg: [],
+            maturityPictureUrl: [],           
             textFileList: [],
             techPlanFileList: [],
             businessPlanFileList: []
@@ -169,9 +171,11 @@ const AchievementDetailShow = Form.create()(React.createClass({
                     data: thisData,
                     orgDisplay: thisData.ownerType,
                     switchValue: Boolean(!thisData.ownerId),
+                    radios:thisData.hot==='1'?true:false,
                     tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
                     technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
-                    maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                    coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : [],
+                    maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],                  
                 });
                 if (thisData.ownerId) {
                     this.getContactsList(thisData.ownerId);
@@ -384,12 +388,12 @@ const AchievementDetailShow = Form.create()(React.createClass({
                             {...formItemLayout}
                             label="类型" >
                             <span>{getAchievementCategory(theData.category)}</span>
-                        </FormItem>
+                        </FormItem>                       
                         <FormItem className="half-item"
                             {...formItemLayout}
-                            label="军民融合" >
+                            label="精品成果" >
                             {(() => {
-                                switch (theData.jmrhFlag) {
+                                switch (theData.boutique) {
                                     case "0":
                                         return <span>否</span>;
                                     case "1":
@@ -399,9 +403,9 @@ const AchievementDetailShow = Form.create()(React.createClass({
                         </FormItem>
                         <FormItem className="half-item"
                             {...formItemLayout}
-                            label="精品成果" >
+                            label="首页展示" >
                             {(() => {
-                                switch (theData.boutique) {
+                                switch (theData.hot) {
                                     case "0":
                                         return <span>否</span>;
                                     case "1":
@@ -409,7 +413,29 @@ const AchievementDetailShow = Form.create()(React.createClass({
                                 }
                             })()}
                         </FormItem>
-                    </div>            
+                    </div> 
+                    {this.state.radios==true ?<FormItem
+                        labelCol={{ span: 4 }}
+                        wrapperCol={{ span: 18 }}
+                        label="首页展示图片:" >
+                        <div className="clearfix">
+                            <Upload className="demandDetailShow-upload"
+                                listType="picture-card"
+                                fileList={this.state.coverImg}                               
+                                onPreview={(file) => {
+                                    this.setState({
+                                        previewImage: file.url || file.thumbUrl,
+                                        previewVisible: true,
+                                    });
+                                }} >
+                            </Upload>
+                            <Modal maskClosable={false} footer={null}
+                                visible={this.state.previewVisible}
+                                onCancel={() => { this.setState({ previewVisible: false }) }}>
+                                <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
+                            </Modal>
+                        </div>
+                    </FormItem>:<div></div>}
                     <div className="clearfix">
                         <FormItem className="half-item"
                             {...formItemLayout}
@@ -759,11 +785,13 @@ const AchievementDetailForm = Form.create()(React.createClass({
             auditStatus: 0,
             textFileList: [],
             switchValue: false,
+            radios: false,
             techPlanFileList: [],
             data: {},
             tags: [],
             technicalPictureUrl: [],
-            maturityPictureUrl: [],
+            coverImg: [],
+            maturityPictureUrl: [],            
             businessPlanFileList: [],
             dataSource: [],
         };
@@ -792,10 +820,12 @@ const AchievementDetailForm = Form.create()(React.createClass({
                     data: thisData,
                     orgDisplay: thisData.ownerType,
                     switchValue: Boolean(!thisData.ownerId),
+                    radios: thisData.hot == '1' ? true : false,
                     transferPriceDis: thisData.transferMode == 1 ? true : false,
                     tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
                     technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
-                    maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                    coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : [],
+                    maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],                                      
                 });
                 if (thisData.ownerType == "1" && thisData.ownerId) {
                     this.getContactsList(thisData.ownerId);
@@ -845,6 +875,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
     getTechnicalPictureUrl(e) {
         this.setState({ technicalPictureUrl: e });
     },
+    getcoverImg(e) {
+        this.setState({coverImg: e });
+    },
     handleSearch(e) {
         if (this.props.detailApiUrl.indexOf('org') != -1) {
             $.ajax({
@@ -921,6 +954,14 @@ const AchievementDetailForm = Form.create()(React.createClass({
                 });
                 theTechnicalPictureUrl = picArr.join(",");
             };
+            let thecoverImg = [];
+            if (this.state.coverImg.length) {
+                let picArr = [];
+                this.state.coverImg.map(function (item) {
+                    picArr.push(item.response.data);
+                });
+                thecoverImg = picArr.join(",");
+            };
             let theMaturityPictureUrl = [];
             if (this.state.maturityPictureUrl.length) {
                 let picArr = [];
@@ -949,6 +990,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         summary: values.summary,
                         introduction: values.introduction,
                         technicalPictureUrl: theTechnicalPictureUrl,
+                        coverImg: thecoverImg,
                         fieldA: values.field ? values.field[0] : undefined,
                         fieldB: values.field ? values.field[1] : undefined,
                         maturity: values.maturity,
@@ -982,9 +1024,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         releaseStatus: values.releaseStatus,
                         techPlanUrl: this.state.techPlanUrl,
                         businessPlanUrl: this.state.businessPlanUrl,
-                        auditStatus: this.state.auditStatus,
-                        jmrhFlag: values.jmrhFlag,
-                        boutique: values.boutique,                       
+                        auditStatus: this.state.auditStatus,                       
+                        boutique: values.boutique, 
+                        hot: values.hot,                       
                     }
                 }).done(function (data) {
                     this.state.auditStatus = 0;
@@ -1015,7 +1057,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
             this.state.data = {};
             this.state.tags = [];
             this.state.switchValue = false;
+            this.state.radios = false;
             this.state.technicalPictureUrl = [];
+            this.state.coverImg = [];
             this.state.maturityPictureUrl = [];
             this.state.textFileList = [];
             this.state.techPlanFileList = [];
@@ -1075,12 +1119,12 @@ const AchievementDetailForm = Form.create()(React.createClass({
                                     {this.props.achievementCategoryOption}
                                 </Select>
                                 )}
-                        </FormItem>
-                        <FormItem className="half-item"
+                        </FormItem>                                              
+                         <FormItem className="half-item"
                                 {...formItemLayout}
-                                label="军民融合" >
-                                {getFieldDecorator('jmrhFlag', {
-                                    initialValue: theData.jmrhFlag
+                                label="精品成果" >
+                                {getFieldDecorator('boutique', {
+                                    initialValue: theData.boutique
                                 })(
                                     <Radio.Group>
                                         <Radio value="0">否</Radio>
@@ -1088,22 +1132,29 @@ const AchievementDetailForm = Form.create()(React.createClass({
                                     </Radio.Group>
                                     )}
                         </FormItem>
-                        
-                        
-                         <FormItem className="half-item"
+                        <FormItem className="half-item"
                                 {...formItemLayout}
-                                label="精品成果" >
-                                {getFieldDecorator('boutique', {
-                                    initialValue: theData.boutique
+                                label="首页展示:" >
+                                {getFieldDecorator('hot', {
+                                    initialValue: theData.hot
                                 })(
-                                    <Radio.Group>
+                                    <Radio.Group onChange={(e) => { this.setState({ radios: e.target.value }); }}>
                                         <Radio value="0">否</Radio>
                                         <Radio value="1">是</Radio>
                                     </Radio.Group>
                                     )}
-                        </FormItem>
-                        
-                        
+                        </FormItem>                                           		
+                        {this.state.radios==true ? <FormItem
+	                        labelCol={{ span: 4 }}
+	                        wrapperCol={{ span: 18 }}
+	                        label="首页展示图片:" >
+	                        <PicturesWall
+	                            pictureSign="achievement_cover_picture"
+	                            fileList={this.getcoverImg}	                            
+	                            pictureUrl={this.state.coverImg} />
+	                        <p>图片尺寸建议:220X140(像素)</p>
+	                    </FormItem>:<div></div>}
+	                    
                         <div className="clearfix">
                             <FormItem className="half-item"
                                 {...formItemLayout}
@@ -1665,7 +1716,9 @@ const AchievementDetail = React.createClass({
                             demandType: thisdata.demandType,
                             theName: thisdata.username || thisdata.unitName,
                             releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
-                            validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate
+                            validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate,
+                            coverImg: thisdata.coverImg,
+                            hot: thisdata.hot,
                         });
                     };
                 };

+ 39 - 15
js/component/manageCenter/demand/techDemand.jsx

@@ -6,7 +6,7 @@ import moment from 'moment';
 import './techDemand.less';
 import TechDemandDesc from './techDemandDesc.jsx';
 import { demandTypeList } from '../../dataDic.js';
-import { companySearch, getDemandType, getSearchUrl, beforeUploadFile ,getboutique} from '../../tools.js';
+import { companySearch, getDemandType, getSearchUrl, beforeUploadFile ,getboutique,gethot} from '../../tools.js';
 import BatchImport from './batchImport';
 
 const DemandList = React.createClass({
@@ -37,6 +37,7 @@ const DemandList = React.createClass({
                 releaseDateEndDate: this.state.releaseDate[1],
                 auditStatus: this.state.auditStatus,
                 boutique:this.state.boutique,
+                hot:this.state.hot,
                 employerName: this.state.searchType == 1 ? this.state.searchName : undefined,
                 username: this.state.searchType == 0 && this.props['data-listApiUrl'].indexOf('org') == -1 ? this.state.searchName : undefined,
                 unitName: this.state.searchType == 0 && this.props['data-listApiUrl'].indexOf('user') == -1 ? this.state.searchName : undefined,
@@ -72,7 +73,8 @@ const DemandList = React.createClass({
                             validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate,
                             releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
                             auditStatus: thisdata.auditStatus,
-                            boutique: thisdata.boutique
+                            boutique: thisdata.boutique,
+                            hot: thisdata.hot
                         });
                     };
                     this.state.pagination.current = data.data.pageNo;
@@ -92,7 +94,7 @@ const DemandList = React.createClass({
     getInitialState() {
         return {
             searchMore: true,
-            searchType: 0,
+            searchType: 0,               
             validityPeriodDate: [],
             releaseDate: [],
             selectedRowKeys: [],
@@ -127,6 +129,12 @@ const DemandList = React.createClass({
                     render: text => { return getboutique(text) }
                 },
                 {
+                    title: '首页展示',
+                    dataIndex: 'hot',
+                    key: 'hot',
+                    render: text => { return gethot(text) }
+                },
+                {
                     title: '关键字',
                     dataIndex: 'keyword',
                     key: 'keyword',
@@ -297,7 +305,7 @@ const DemandList = React.createClass({
             this.state.infoSources = undefined;
             this.state.demandType = undefined;
             this.state.searchName = undefined;
-            this.state.searchType = 0;
+            this.state.searchType = 0;            
             this.state.status = undefined;
             this.state.releaseStatus = undefined;
             this.state.auditStatus = undefined;
@@ -367,6 +375,8 @@ const DemandList = React.createClass({
         this.state.demandType = undefined;
         this.state.searchName = undefined;
         this.state.searchType = 0;
+        this.state.boutique = '';
+        this.state.hot='' ;
         this.state.status = undefined;
         this.state.releaseStatus = undefined;
         this.state.auditStatus = undefined;
@@ -441,7 +451,7 @@ const DemandList = React.createClass({
                     }}>
                         <Radio value={0}>认证用户</Radio>
                         <Radio value={1}>非认证用户</Radio>
-                    </Radio.Group>
+                    </Radio.Group>                   
                     <Button type="primary" onClick={this.search}>搜索</Button>
                     <Button onClick={this.reset}>重置</Button>
                     <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
@@ -449,6 +459,18 @@ const DemandList = React.createClass({
                         onClick={this.delectRow}>删除<Icon type="minus" /></Button>
                     <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
                     <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
+                    	<Radio.Group value={this.state.boutique} onChange={(e) => {
+		                    this.setState({ boutique: e.target.value })
+		                    }}>
+		                        <Radio value={1}>精品</Radio>
+		                        <Radio value={0}>非精品</Radio>
+		                </Radio.Group>
+		                <Radio.Group value={this.state.hot} onChange={(e) => {
+		                    this.setState({ hot: e.target.value })
+		                    }}>
+		                        <Radio value={1}>首页展示</Radio>
+		                        <Radio value={0}>首页不展示</Radio>
+		                </Radio.Group>
                         <Select placeholder="选择信息来源" style={{ width: 120 }}
                             value={this.state.infoSources}
                             onChange={(e) => { this.setState({ infoSources: e }) }}>
@@ -485,16 +507,18 @@ const DemandList = React.createClass({
                             <Select.Option value="0" >未发布</Select.Option>
                             <Select.Option value="1" >已发布</Select.Option>
                         </Select>
-                        <span style={{ marginLeft: '10px' }}>有效期限 : </span>
-                        <RangePicker
-                            value={[this.state.validityPeriodDate[0] ? moment(this.state.validityPeriodDate[0]) : null,
-                            this.state.validityPeriodDate[1] ? moment(this.state.validityPeriodDate[1]) : null]}
-                            onChange={(data, dataString) => { this.setState({ validityPeriodDate: dataString }); }} />
-                        <span style={{ marginLeft: '10px' }}>发布时间 : </span>
-                        <RangePicker
-                            value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
-                            this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
-                            onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
+                        <div style={{ marginTop: '10px' }}>
+	                        <span style={{ marginLeft: '10px' }}>有效期限 : </span>
+	                        <RangePicker
+	                            value={[this.state.validityPeriodDate[0] ? moment(this.state.validityPeriodDate[0]) : null,
+	                            this.state.validityPeriodDate[1] ? moment(this.state.validityPeriodDate[1]) : null]}
+	                            onChange={(data, dataString) => { this.setState({ validityPeriodDate: dataString }); }} />
+	                        <span style={{ marginLeft: '10px' }}>发布时间 : </span>
+	                        <RangePicker
+	                            value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
+	                            this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
+	                            onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
+                        </div>
                     </div>
                 </div>
                 <div className="patent-table">

+ 30 - 1
js/component/manageCenter/demand/techDemand.less

@@ -30,7 +30,36 @@
         }
     }
 }
-
+.avatar-uploader,
+.avatar-uploader-trigger,
+.avatar {
+    width: 150px;
+    height: 150px;
+}
+.modal-box-title{float: left;}
+.modal-box-detail{margin-left: 10px;vertical-align: top;float: left;margin-top: 6px;width: 160px!important;}
+.avatar-uploader-trigger {
+    display: table-cell;
+    vertical-align: middle;
+    font-size: 28px;
+    color: #999;
+}
+.avatar-uploader {
+    display: block;
+    padding: 1px;
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    img {
+        position: absolute;
+        top: -1px;
+        left: -1px;
+        height: 150px;
+    } //
+    float: left;
+    margin-right: 20px;
+}
 .patent-addNew {
     float: right;
     margin-left: 20px;

+ 126 - 32
js/component/manageCenter/demand/techDemandDesc.jsx

@@ -6,7 +6,7 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
 import { getTechField } from '../../DicTechFieldList.js';
-import { beforeUploadFile, getTechAuditStatus, splitUrl, companySearch, getDemandType, getAchievementCategory } from '../../tools.js';
+import { beforeUploadFile, getTechAuditStatus, splitUrl, companySearch, getDemandType, getAchievementCategory,beforeUpload, getBase64 } from '../../tools.js';
 import throttle from '../../throttle.js';
 
 const KeyWordTagGroup = React.createClass({
@@ -116,8 +116,8 @@ const PicturesWall = React.createClass({
         return (
             <div className="clearfix">
                 <Upload
-                    action={globalConfig.context + "/api/admin/demand/uploadPicture"}
-                    data={{ 'sign': 'demand_picture', 'uid': this.props.uid }}
+                    action={globalConfig.context + "/api/admin/demand/uploadPicture"}                                      
+                    data={{ 'sign': this.props.pictureSign, 'uid': this.props.uid}}
                     listType="picture-card"
                     fileList={fileList}
                     onPreview={this.handlePreview}
@@ -141,7 +141,8 @@ const DemandDetailShow = Form.create()(React.createClass({
             salesmanObj: {},
             data: {},
             tags: [],
-            pictureUrl: []
+            pictureUrl: [],
+            coverImg: []           
         };
     },
     loadData(id, detailApiUrl) {
@@ -167,8 +168,10 @@ const DemandDetailShow = Form.create()(React.createClass({
                 this.setState({
                     data: thisData,
                     switchValue: Boolean(!thisData.employerId),
+                    radios: thisData.hot == '1' ? true : false,
                     tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
-                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
+                    coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
         }).always(function () {
@@ -360,8 +363,59 @@ const DemandDetailShow = Form.create()(React.createClass({
                             {...formItemLayout}
                             label="需求名称" >
                             <span>{theData.name}</span>
-                        </FormItem>
+                        </FormItem>                       
                     </div>
+                    <div>
+                    <FormItem className="half-item"
+                            {...formItemLayout}
+                            label="精品需求" >
+                            {(() => {
+                                switch (theData.boutique) {
+                                    case "0":
+                                        return <span>否</span>;
+                                    case "1":
+                                        return <span>是</span>;
+                                }
+                            })()}
+                        </FormItem>
+                         <FormItem className="half-item"
+                            {...formItemLayout}
+                            label="首页展示" >
+                            {(() => {
+                                switch (theData.hot) {
+                                    case "0":
+                                        return <span>否</span>;
+                                    case "1":
+                                        return <span>是</span>;
+                                }
+                            })()}
+                        </FormItem>                        
+                     </div>                    
+                     {this.state.radios==true ? <div>
+                    	<FormItem
+	                        labelCol={{ span: 3 }}
+	                        wrapperCol={{ span: 18 }}
+	                        label="首页展示图片:" >
+	                        <div className="clearfix">
+	                            <Upload className="demandDetailShow-upload"
+	                                listType="picture-card"
+	                                fileList={this.state.coverImg}
+	                                onPreview={(file) => {
+	                                    this.setState({
+	                                        previewImage: file.url || file.thumbUrl,
+	                                        previewVisible: true,
+	                                    });
+	                                }} >
+	                                {fileList.length >= 1 ? null : uploadButton}
+	                            </Upload>
+	                            <Modal maskClosable={false} footer={null}
+	                                visible={this.state.previewVisible}
+	                                onCancel={() => { this.setState({ previewVisible: false }) }}>
+	                                <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
+	                            </Modal>
+	                        </div>
+	                   	 </FormItem>
+                    </div> :<div></div>}                
                     {this.state.switchValue ? <div>
                         <FormItem className="half-item"
                             {...formItemLayout}
@@ -596,18 +650,7 @@ const DemandDetailShow = Form.create()(React.createClass({
                                 }
                             })()}
                         </FormItem>
-                        <FormItem className="half-item"
-                            {...formItemLayout}
-                            label="精品需求" >
-                            {(() => {
-                                switch (theData.boutique) {
-                                    case "0":
-                                        return <span>否</span>;
-                                    case "1":
-                                        return <span>是</span>;
-                                }
-                            })()}
-                        </FormItem>
+                       
                         <FormItem className="half-item"
                             {...formItemLayout}
                             label="有效期限" >
@@ -686,12 +729,14 @@ const DemandDetailForm = Form.create()(React.createClass({
             loading: false,
             auditStatus: 0,
             switchValue: false,
+            radios: false,
             textFileList: [],
             videoFileList: [],
             contactsOption: [],
             data: {},
             tags: [],
             pictureUrl: [],
+            coverImg:[],
             dataSource: []
         };
     },
@@ -750,8 +795,10 @@ const DemandDetailForm = Form.create()(React.createClass({
                 this.setState({
                     data: thisData,
                     switchValue: Boolean(!thisData.employerId),
+                    radios: thisData.hot == '1' ? true : false,
                     tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
-                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
+                    coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
         }).always(function () {
@@ -766,6 +813,9 @@ const DemandDetailForm = Form.create()(React.createClass({
     getPictureUrl(e) {
         this.setState({ pictureUrl: e });
     },
+     getcoverImg(e) {
+        this.setState({ coverImg: e });
+    },
     handleSubmit(e) {
         e.preventDefault();
         this.props.form.validateFields((err, values) => {
@@ -783,6 +833,14 @@ const DemandDetailForm = Form.create()(React.createClass({
                 });
                 thePictureUrl = picArr.join(",");
             };
+            let thecoverImg = [];
+            if (this.state.coverImg.length) {
+                let picArr = [];
+                this.state.coverImg.map(function (item) {
+                    picArr.push(item.response.data);
+                });
+                thecoverImg = picArr.join(",");
+            };
             if (!err) {
                 this.setState({
                     loading: true
@@ -806,6 +864,7 @@ const DemandDetailForm = Form.create()(React.createClass({
                         problemDes: values.problemDes,
                         technicalRequirements: values.technicalRequirements,
                         pictureUrl: thePictureUrl,
+                        coverImg: thecoverImg,
                         textFileUrl: this.state.textFileUrl,
                         videoUrl: values.videoUrl,
                         fixedBudget: values.fixedBudget,
@@ -832,6 +891,7 @@ const DemandDetailForm = Form.create()(React.createClass({
                         status: this.state.status,
                         auditStatus: this.state.auditStatus,
                         boutique: values.boutique, 
+                        hot: values.hot,                         
                     }
                 }).done(function (data) {
                     this.state.auditStatus = 0;
@@ -865,7 +925,7 @@ const DemandDetailForm = Form.create()(React.createClass({
                         };
                     } else if (!$.isEmptyObject(data.data)) {
                         data.data.map(function (item) {
-                            theArr.push(item.unitName);
+                            theArr.push(item.unitName,titleImg: thisdata.titleImg);
                             theObj[item.unitName] = item.uid;
                         });
                     };
@@ -918,7 +978,9 @@ const DemandDetailForm = Form.create()(React.createClass({
             this.state.data = {};
             this.state.tags = [];
             this.state.switchValue = false;
+            this.state.radios = false;
             this.state.pictureUrl = [];
+            this.state.coverImg = [];
             this.state.textFileList = [];
             this.state.videoFileList = [];
             this.state.textFileUrl = undefined;
@@ -953,6 +1015,48 @@ const DemandDetailForm = Form.create()(React.createClass({
                                 )}
                         </FormItem>
                     </div>
+                    <div>
+                    	 <FormItem className="half-item"
+                                {...formItemLayout}
+                                label="精品需求" >
+                                {getFieldDecorator('boutique', {
+                                    initialValue: theData.boutique
+                                })(
+                                    <Radio.Group>
+                                        <Radio value="0">否</Radio>
+                                        <Radio value="1">是</Radio>
+                                    </Radio.Group>
+                                    )}
+                        </FormItem>
+                        <FormItem className="half-item"
+                                {...formItemLayout}
+                                label="首页展示:" >
+                                {getFieldDecorator('hot', {
+                                    initialValue: theData.hot
+                                })(
+                                    <Radio.Group onChange={(e) => { this.setState({ radios: e.target.value }); }}>
+                                        <Radio value="0" name='radios'>否</Radio>
+                                        <Radio value="1" name='radios'>是</Radio>
+                                    </Radio.Group>
+                                    )}
+                        </FormItem>                       	                   
+                    </div>
+                    {this.state.radios==true ? <div>
+                    	<FormItem
+	                        labelCol={{ span: 3 }}
+	                        wrapperCol={{ span: 18 }}
+	                        label="首页展示图片:" >
+	                        <PicturesWall
+	                            pictureSign='demand_cover_picture'
+	                            uid={theData.employerId}
+	                            fileList={this.getcoverImg}
+	                            pictureUrl={this.state.coverImg}
+	                            visible={this.props.visible} 	                        
+	                            />
+	                        <span>尺寸为:320x160(像素)</span>
+	                    </FormItem>
+	                    
+                    </div> :<div></div>}
                     <FormItem style={{ marginBottom: '10px' }} labelCol={{ span: 3 }}
                         label="自定义雇主" >
                         <Switch checked={this.state.switchValue} onChange={(e) => { this.setState({ switchValue: e }); }} />
@@ -1132,6 +1236,7 @@ const DemandDetailForm = Form.create()(React.createClass({
                         wrapperCol={{ span: 18 }}
                         label="需求文件(图片)" >
                         <PicturesWall
+                            pictureSign="demand_picture"
                             uid={theData.employerId}
                             fileList={this.getPictureUrl}
                             pictureUrl={this.state.pictureUrl}
@@ -1236,18 +1341,7 @@ const DemandDetailForm = Form.create()(React.createClass({
                                 </Radio.Group>
                                 )}
                         </FormItem>
-                        <FormItem className="half-item"
-                                {...formItemLayout}
-                                label="精品需求" >
-                                {getFieldDecorator('boutique', {
-                                    initialValue: theData.boutique
-                                })(
-                                    <Radio.Group>
-                                        <Radio value="0">否</Radio>
-                                        <Radio value="1">是</Radio>
-                                    </Radio.Group>
-                                    )}
-                        </FormItem>
+                       
                         <FormItem className="half-item"
                             {...formItemLayout}
                             label="有效期限" >

+ 3 - 16
js/component/manageCenter/idea/news/news.jsx

@@ -245,12 +245,9 @@ const News = React.createClass({
                 sourceUrl: this.state.RowData.sourceUrl,
                 summary: this.state.RowData.summary,
                 content: this.state.RowData.content,
-                createTimeFormattedDate: this.state.RowData.createTimeFormattedDate,
-                jmrhFlag: this.state.RowData.jmrhFlag ,   
+                createTimeFormattedDate: this.state.RowData.createTimeFormattedDate,                   
                 provinceId: this.state.RowData.provinceId, 
-            },
-            
-            
+            },                      
             success: function (data) {
                 if (data.error && data.error.length) {
                     message.warning(data.error[0].message);
@@ -492,17 +489,7 @@ const News = React.createClass({
                                             this.setState({ RowData: this.state.RowData});
                                         }} />
                                 </div>
-                            </div>   
-	                            <div className="modal-box news-box">
-		                        <span className="modal-box-title jmrhFlag">军民融合:</span>  	                        
-	                            <Radio.Group value={this.state.RowData.jmrhFlag} onChange={(e) => {
-	                                this.state.RowData.jmrhFlag = e.target.value;
-	                                this.setState({ RowData: this.state.RowData  });
-	                            }} >
-	                                <Radio value={0}>否</Radio>
-	                                <Radio value={1}>是</Radio>
-	                            </Radio.Group> 
-                            </div>
+                            </div>   	                           
                             {this.props.newsType == 2 || this.props.newsType == 3 ? <div className="modal-box news-box">
                                 <span className="modal-box-title">发布在首页</span>
                                 <div className="modal-box-detail">

+ 16 - 1
js/component/tools.js

@@ -29,7 +29,8 @@ import {
     orderStatusList,
     activityForm,
     activityType,
-    boutique
+    boutique,
+    hot
 } from './dataDic.js';
 module.exports = {
     splitUrl: function (string, i, url) {
@@ -625,6 +626,18 @@ module.exports = {
             return theType;
         }
     },
+    //是否展示在首页
+    gethot: function (e) {
+         if (e) {        	
+            let theType = '';
+            hot.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
+    },
     //是否精品
      getboutique: function (e) {
          if (e) {
@@ -637,4 +650,6 @@ module.exports = {
             return theType;
         }
     },
+
+
 }

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.0.44",
+  "version": "1.0.45",
   "description": "",
   "main": "index.js",
   "scripts": {

+ 2 - 2
webpack.config.js

@@ -239,8 +239,8 @@ module.exports = (function () {
             }
         }));
     }
-    let staticHost = 'http://afts.hnzhiming.com';
-    //let staticHost = 'http://127.0.0.1';    
+   //let staticHost = 'http://afts.hnzhiming.com';
+    let staticHost = 'http://127.0.0.1';    
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://afts.hnzhiming.com';