|
@@ -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,
|
|
|
});
|
|
|
};
|
|
|
};
|