liting2017 6 years ago
parent
commit
1a6e055b52

+ 24 - 2
js/component/account/achievement/achievementDetails.jsx

@@ -19,6 +19,7 @@ const DemandDetail = Form.create()(React.createClass({
             loading: false,
             auditStatus: 0,
             textFileList: [],
+            pictureUrlMax:[],
             videoFileList: [],
             pictureUrl: [],
         };
@@ -52,7 +53,8 @@ const DemandDetail = Form.create()(React.createClass({
                     publishPagesArr:publishPagesArr,
                     data: thisData,
                     auditStatus:thisData.auditStatus,
-                    pictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                    pictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
+                    pictureUrlMax: thisData.pictureUrlMax ? splitUrl(thisData.pictureUrlMax, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
         }).always(function () {
@@ -137,6 +139,7 @@ const DemandDetail = Form.create()(React.createClass({
             } else {
 				this.state.data = {};
                 this.state.pictureUrl = [];
+                this.state.pictureUrlMax = [];
             };
             this.props.form.resetFields();
         };
@@ -197,7 +200,7 @@ const DemandDetail = Form.create()(React.createClass({
                             <span>{getTransaction(theData.transferMode)}</span>
 						</FormItem>
 					</div>
-					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果文件(图)">
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果(图)">
                         <div className="clearfix">
                                 <Upload className="demandDetailShow-upload"
                                     listType="picture-card"
@@ -216,6 +219,25 @@ const DemandDetail = Form.create()(React.createClass({
                                 </Modal>
                             </div> 
 					</FormItem>
+                    <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果(大图)">
+                        <div className="clearfix">
+                                <Upload className="demandDetailShow-upload"
+                                    listType="picture-card"
+                                    fileList={this.state.pictureUrlMax}                               
+                                    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 className="clearfix">
 						<FormItem className="half-item" {...formItemLayout} label="精品成果">
                             <span>{theData.boutique?'精品':'非精品'}</span>

+ 28 - 4
js/component/account/achievement/achievementForm.jsx

@@ -158,6 +158,7 @@ const DemandDetailForm = Form.create()(React.createClass({
             textFileList: [],
             videoFileList: [],
 			pictureUrl: [],
+			pictureUrlMax:[],
 			tags:[]
         };
     },
@@ -187,8 +188,10 @@ const DemandDetailForm = Form.create()(React.createClass({
 					data: thisData,
 					publishPages:thisData.publishPages.length?thisData.publishPages:['app_achievement_list','web_achievement_list'],
 					auditStatus:thisData.auditStatus,
-                    pictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
-                });
+					pictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
+					pictureUrlMax: thisData.pictureUrlMax ? splitUrl(thisData.pictureUrlMax, ',', globalConfig.avatarHost + '/upload') : []
+					
+				});
             }.bind(this),
         }).always(function () {
             this.setState({
@@ -216,6 +219,16 @@ const DemandDetailForm = Form.create()(React.createClass({
                 });
                 thePictureUrl = picArr.join(",");
 			};
+			let thePictureUrlMax = [];
+            if (this.state.pictureUrl.length) {
+                let picArr = [];
+                this.state.pictureUrlMax.map(function (item) {
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
+                });
+                thePictureUrlMax = picArr.join(",");
+			};
 			if(!this.state.tags.length){
 				message.warning('请填写关键词.')
 				return false;
@@ -236,7 +249,8 @@ const DemandDetailForm = Form.create()(React.createClass({
                         fieldB: values.industryCategory ? values.industryCategory[1] : undefined,
                         dataCategory: values.dataCategory,
                         category: values.category,
-                        technicalPictureUrl: thePictureUrl,
+						technicalPictureUrl: thePictureUrl,
+						pictureUrlMax: thePictureUrlMax,
 						introduction:values.introduction,
 						keyword: this.state.tags ? this.state.tags.join(",") : [],
 						keywords: this.state.tags,
@@ -313,6 +327,7 @@ const DemandDetailForm = Form.create()(React.createClass({
             } else {
 				this.state.data = {};
 				this.state.pictureUrl = [];
+				this.state.pictureUrlMax=[];
 				this.state.tags = [];
 				this.setState({
 					publishPages:['app_achievement_list','web_achievement_list']
@@ -456,7 +471,7 @@ const DemandDetailForm = Form.create()(React.createClass({
 						</FormItem>
 					</div>
 					<div className="clearfix">
-						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果文件(图)">
+						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果(图)">
 							<PicturesWall
 								fileList={this.getPictureUrl}
 								pictureUrl={this.state.pictureUrl}
@@ -465,6 +480,15 @@ const DemandDetailForm = Form.create()(React.createClass({
 						</FormItem>
 					</div>
 					<div className="clearfix">
+						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果(大图)">
+							<PicturesWall
+								fileList={(e)=>{this.setState({pictureUrlMax:e})}}
+								pictureUrl={this.state.pictureUrlMax}
+								visible={this.props.visible}
+							/>
+						</FormItem>
+					</div>
+					<div className="clearfix">
 						<FormItem className="half-item" {...formItemLayout} label="精品成果">
 							{getFieldDecorator('boutique', {
 								initialValue: theData.boutique 

+ 23 - 2
js/component/account/demand/demandDetaiel.jsx

@@ -20,6 +20,7 @@ const DemandDetail = Form.create()(React.createClass({
             loading: false,
             auditStatus: 0,
             textFileList: [],
+            pictureUrlMax:[],
             videoFileList: [],
             pictureUrl: [],
         };
@@ -56,7 +57,8 @@ const DemandDetail = Form.create()(React.createClass({
 					isHot:thisData.isHot,
 					isUrgent:thisData.isUrgent,
 					status:thisData.status,
-					isHot:thisData.isHot,
+                    isHot:thisData.isHot,
+                    pictureUrlMax: thisData.pictureUrlMax ? splitUrl(thisData.pictureUrlMax, ',', globalConfig.avatarHost + '/upload') : [],
                     pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
@@ -219,7 +221,7 @@ const DemandDetail = Form.create()(React.createClass({
                             </span>
 						</FormItem>
 					</div>
-					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求文件(图)">
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求(图)">
                         <div className="clearfix">
                                 <Upload className="demandDetailShow-upload"
                                     listType="picture-card"
@@ -238,6 +240,25 @@ const DemandDetail = Form.create()(React.createClass({
                                 </Modal>
                             </div> 
 					</FormItem>
+                    <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求(大图)">
+                        <div className="clearfix">
+                                <Upload className="demandDetailShow-upload"
+                                    listType="picture-card"
+                                    fileList={this.state.pictureUrlMax}                               
+                                    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>
 						<FormItem className="half-item" {...formItemLayout} label="发布状态">
 							<span>{getReleaseStateList(theData.auditStatus)}</span>

+ 24 - 5
js/component/account/demand/demandForm.jsx

@@ -160,7 +160,8 @@ const DemandDetailForm = Form.create()(React.createClass({
             loading: false,
             auditStatus: 0,
             textFileList: [],
-            videoFileList: [],
+			videoFileList: [],
+			pictureUrlMax:[],
 			pictureUrl: [],
 			tags:[]
         };
@@ -199,7 +200,8 @@ const DemandDetailForm = Form.create()(React.createClass({
 					isUrgent:thisData.isUrgent,
 					status:thisData.status,
 					isHot:thisData.isHot,
-                    pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+					pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
+					pictureUrlMax: thisData.pictureUrlMax ? splitUrl(thisData.pictureUrlMax, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
         }).always(function () {
@@ -228,6 +230,16 @@ const DemandDetailForm = Form.create()(React.createClass({
                 });
                 thePictureUrl = picArr.join(",");
 			};
+			let thePictureUrlMax = [];
+            if (this.state.pictureUrlMax.length) {
+                let picArr = [];
+                this.state.pictureUrlMax.map(function (item) {
+                    if ( item.response && item.response.data && item.response.data.length ){
+                        picArr.push(item.response.data);
+                    }
+                });
+                thePictureUrlMax = picArr.join(",");
+			};
 			if(!this.state.tags.length){
 				message.warning('请填写关键词.')
 				return false;
@@ -248,7 +260,8 @@ const DemandDetailForm = Form.create()(React.createClass({
                         industryCategoryB: values.industryCategory ? values.industryCategory[1] : undefined,
                         demandType: values.demandType,
                         problemDes: values.problemDes,
-                        pictureUrl: thePictureUrl,
+						pictureUrl: thePictureUrl,
+						pictureUrlMax: thePictureUrlMax,
 						crowdCost:values.crowdCost,
 						keyword: this.state.tags ? this.state.tags.join(",") : [],
 						keywords: this.state.tags,
@@ -458,14 +471,20 @@ const DemandDetailForm = Form.create()(React.createClass({
 							</Radio.Group>
 						</FormItem>
 					</div>
-					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求文件(图)">
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求(图)">
 						<PicturesWall
-							uid={theData.employerId}
 							fileList={this.getPictureUrl}
 							pictureUrl={this.state.pictureUrl}
 							visible={this.props.visible}
 						/>
 					</FormItem>
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求(大图)">
+						<PicturesWall
+							fileList={(e)=>{this.setState({pictureUrlMax:e})}}
+							pictureUrl={this.state.pictureUrlMax}
+							visible={this.props.visible}
+						/>
+					</FormItem>
 					<div className="clearfix">
 						<FormItem className="full-item" 
 							labelCol={{ span: 3 }}

+ 24 - 2
js/component/administration/achievement/achievementDetaiel.jsx

@@ -23,6 +23,7 @@ const DemandDetail = Form.create()(React.createClass({
             textFileList: [],
             videoFileList: [],
             pictureUrl: [],
+            pictureUrlMax:[]
         };
     },
     loadData(id) {
@@ -57,7 +58,8 @@ const DemandDetail = Form.create()(React.createClass({
 					isUrgent:thisData.isUrgent,
 					status:thisData.status,
 					isHot:thisData.isHot,
-                    pictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
+                    pictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
+                    pictureUrlMax: thisData.pictureUrlMax ? splitUrl(thisData.pictureUrlMax, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
         }).always(function () {
@@ -138,6 +140,7 @@ const DemandDetail = Form.create()(React.createClass({
             } else {
 				this.state.data = {};
                 this.state.pictureUrl = [];
+                this.state.pictureUrlMax=[];
             };
             this.props.form.resetFields();
         };
@@ -198,7 +201,7 @@ const DemandDetail = Form.create()(React.createClass({
                             <span>{getTransaction(theData.transferMode)}</span>
 						</FormItem>
 					</div>
-					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果文件(图)">
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果(图)">
                         <div className="clearfix">
                                 <Upload className="demandDetailShow-upload"
                                     listType="picture-card"
@@ -217,6 +220,25 @@ const DemandDetail = Form.create()(React.createClass({
                                 </Modal>
                             </div> 
 					</FormItem>
+                    <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="成果(大图)">
+                        <div className="clearfix">
+                                <Upload className="demandDetailShow-upload"
+                                    listType="picture-card"
+                                    fileList={this.state.pictureUrlMax}                               
+                                    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 className="clearfix">
 						<FormItem className="half-item" {...formItemLayout} label="精品成果">
                             <span>{theData.boutique?'精品':'非精品'}</span>

+ 1 - 4
js/component/administration/banner/bannerDes.jsx

@@ -25,7 +25,6 @@ class DemandDesc extends React.Component {
 	}
 	componentWillReceiveProps(nextProps) {
 		this.state.visible = nextProps.showDesc;
-
 	}
 	render() {
 		let data = this.props.data || {releaseStatus:0};
@@ -37,17 +36,15 @@ class DemandDesc extends React.Component {
 					onOk={this.handOk.bind(this)}
 					onCancel={this.handleCancel.bind(this)}
 					width="600px"
-					title='需求详情'
+					title={data.id?'修改轮播图':'新建轮播图'}
 					footer=""
 					className="admin-desc-content"
 				>
 					<div>
 						<div>
 							<BannerForm
-							    examineState={this.props.examineState}
 								closeDesc={this.handleCancel.bind(this)}
 								data={this.props.data}
-								demandTypeOption={this.props.demandTypeOption}
 								visible={this.state.visible}
 								handOk={this.handOk.bind(this)}
 							/>

+ 0 - 2
js/component/administration/banner/bannerForm.jsx

@@ -116,7 +116,6 @@ class BannerForm extends React.Component {
         this.props.form.validateFields((err, values) => {
             //url转化
             let thePictureUrl = [];
-            console.log(this.state.imgUrl)
             if (this.state.imgUrl.length) {
                 let picArr = [];
                 this.state.imgUrl.map(function (item) {
@@ -208,7 +207,6 @@ class BannerForm extends React.Component {
                         <div className="clearfix">
                             <FormItem {...formItemLayout} label="跳转地址">
                                 {getFieldDecorator('forwardUrl', {
-                                    rules: [ { required: true, message: '此项为必填项!' } ],
                                     initialValue: theData.forwardUrl
                                 })(<Input placeholder="请输入跳转地址"/>)}
                             </FormItem>

+ 24 - 2
js/component/administration/demand/demandDetaiel.jsx

@@ -23,6 +23,7 @@ const DemandDetail = Form.create()(React.createClass({
             textFileList: [],
             videoFileList: [],
             pictureUrl: [],
+            pictureUrlMax: [],
         };
     },
     loadData(id) {
@@ -62,7 +63,8 @@ const DemandDetail = Form.create()(React.createClass({
 					isHot:thisData.isHot,
 					isUrgent:thisData.isUrgent,
 					status:thisData.status,
-					isHot:thisData.isHot,
+                    isHot:thisData.isHot,
+                    pictureUrlMax: thisData.pictureUrlMax ? splitUrl(thisData.pictureUrlMax, ',', globalConfig.avatarHost + '/upload') : [],
                     pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
@@ -149,6 +151,7 @@ const DemandDetail = Form.create()(React.createClass({
 				this.state.hotDemand=undefined;
 				this.state.solve=undefined;
                 this.state.pictureUrl = [];
+                this.state.pictureUrlMax=[]
             };
             this.props.form.resetFields();
         };
@@ -233,7 +236,7 @@ const DemandDetail = Form.create()(React.createClass({
 							{this.state.ProvinceCity}
 						</FormItem>  
 					</div> */}
-					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求文件(图)">
+					<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求(图)">
                         <div className="clearfix">
                                 <Upload className="demandDetailShow-upload"
                                     listType="picture-card"
@@ -252,6 +255,25 @@ const DemandDetail = Form.create()(React.createClass({
                                 </Modal>
                             </div> 
 					</FormItem>
+                    <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="需求(大图)">
+                        <div className="clearfix">
+                                <Upload className="demandDetailShow-upload"
+                                    listType="picture-card"
+                                    fileList={this.state.pictureUrlMax}                               
+                                    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>
 						<FormItem className="half-item" {...formItemLayout} label="发布状态">
 							<span>{getReleaseStateList(theData.auditStatus)}</span>

+ 1 - 1
package.json

@@ -12,7 +12,7 @@
     "buildtest": "node bin/clean.js && webpack --progress --colors --env.deploy test",
     "buildstage": "node bin/clean.js && webpack --progress --colors --env.deploy stage",
     "pro": "node bin/clean.js && webpack --progress --colors --env.deploy prod",
-    "dev": "webpack-dev-server --port 80 --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
+    "dev": "webpack-dev-server --port 8088 --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
   },
   "repository": {
     "type": "git",

+ 1 - 1
webpack-dll.config.js

@@ -10,7 +10,7 @@ let theme = {
   '@link-color': '#58a3ff'
 };
 module.exports = (function () {
-	let staticHost = 'http://192.168.0.188';    
+	let staticHost = 'http://192.168.0.188:8088';    
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';

+ 2 - 2
webpack.config.js

@@ -115,7 +115,7 @@ module.exports = (function () {
         }));
     }
 
-    let staticHost = 'http://192.168.0.188';    
+    let staticHost = 'http://192.168.0.188:8088';    
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';
@@ -151,7 +151,7 @@ module.exports = (function () {
         devServer: {
             disableHostCheck: true,
             host: '192.168.0.188',
-            port: 80,
+            port: 8088,
             allowedHosts: ['127.0.0.1','192.168.0.20'],
             headers: {
                 "Access-Control-Allow-Origin": "*"

+ 6 - 6
webpack/entry.config.js

@@ -10,28 +10,28 @@ module.exports = {
     'admin/index': './js/admin/index.js',
   },
   watch: {
-    'user/index': ['webpack-dev-server/client?http://192.168.0.188', // WebpackDevServer host and port
+    'user/index': ['webpack-dev-server/client?http://192.168.0.188:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/index.js'
     ],
-    'user/login': ['webpack-dev-server/client?http://192.168.0.188', // WebpackDevServer host and port
+    'user/login': ['webpack-dev-server/client?http://192.168.0.188:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/login.js'
     ],
-    'user/signIn': ['webpack-dev-server/client?http://192.168.0.188', // WebpackDevServer host and port
+    'user/signIn': ['webpack-dev-server/client?http://192.168.0.188:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/signIn.js'
     ],
-    'user/account/index': ['webpack-dev-server/client?http://192.168.0.188', // WebpackDevServer host and port
+    'user/account/index': ['webpack-dev-server/client?http://192.168.0.188:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/index.js'
     ],
     //admin
-    'admin/login': ['webpack-dev-server/client?http://192.168.0.188', // WebpackDevServer host and port
+    'admin/login': ['webpack-dev-server/client?http://192.168.0.188:8088', // WebpackDevServer host and port
     'webpack/hot/only-dev-server',
     './js/user/adminLogin.js'
     ],
-    'admin/index': ['webpack-dev-server/client?http://192.168.0.188', // WebpackDevServer host and port
+    'admin/index': ['webpack-dev-server/client?http://192.168.0.188:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/index.js'
     ]