liting2017 il y a 6 ans
Parent
commit
e7c9906a8b

+ 1 - 5
js/component/administration/product/proDetails.jsx

@@ -154,10 +154,6 @@ const NewDetail = Form.create()(React.createClass({
                         <FormItem className="half-item" {...formItemLayout} label="标题">
 							<span>{theData.title}</span>
 						</FormItem>
-                       
-						<FormItem className="half-item" {...formItemLayout} label="新闻来源">
-							<span>{theData.source}</span>
-						</FormItem>
                         <FormItem className="half-item" {...formItemLayout} label="产品类型">
 							<span>{getProductType(theData.category)}</span>
 						</FormItem>
@@ -193,7 +189,7 @@ const NewDetail = Form.create()(React.createClass({
                         <FormItem className="half-item" {...formItemLayout} label="发布时间">
                             <span>{theData.releaseTime?(new Date(theData.releaseTime)).toLocaleString():''}</span>
                         </FormItem>
-                        <FormItem className="half-item" {...formItemLayout} label="是否置顶">
+                        <FormItem className="half-item" {...formItemLayout} label="是否热门">
 							<span>{theData.top=='1'?'是':'否'}</span>
 						</FormItem>
                         <FormItem className="half-item" {...formItemLayout} label="是否推荐">

+ 17 - 25
js/component/administration/product/proForm.jsx

@@ -67,10 +67,10 @@ const NewDetailForm = Form.create()(React.createClass({
     handleSubmit(e,index) {
 		e.preventDefault();
         this.props.form.validateFields((err, values) => {
-			if (!this.state.pictureUrl.length) {
-				message.warning('请上传专栏图片!');
-				return false;
-			};
+			// if (!this.state.pictureUrl.length) {
+			// 	message.warning('请上传专栏图片!');
+			// 	return false;
+			// };
 			if((this.state.edit)==undefined||!this.state.edit||(this.state.edit)=='<p><br></p>'){
 				message.warning('请填写专栏正文');
 				return false;
@@ -92,7 +92,6 @@ const NewDetailForm = Form.create()(React.createClass({
 						category:values.category,
 						recommend:values.recommend,
 						top:values.top,
-						source:values.source,
 						status:index,
 						keyword: this.state.tags ? this.state.tags.join(",") : '',
                         summary: values.summary,
@@ -179,12 +178,6 @@ const NewDetailForm = Form.create()(React.createClass({
                     			</Select>
 							)}
 						</FormItem>
-						<FormItem className="half-item" {...formItemLayout} label="专栏来源">
-							{getFieldDecorator('source', {
-								rules: [ { required: true, message: '此项为必填项!' } ],
-								initialValue: theData.source
-							})(<Input placeholder="请输入来源" maxLength={45} />)}
-						</FormItem>
 					</div>
 					<div className="clearfix">
 						<FormItem  labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="关键字">
@@ -197,10 +190,7 @@ const NewDetailForm = Form.create()(React.createClass({
 						</FormItem>
 					</div>
 					<div className="clearfix">
-						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label={<span>
-														<strong style={{ color: '#f00' }}> * </strong>
-														<span>专栏图片</span>
-													</span>}>
+						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="专栏图片">
 							<Crop 
 								getAllImg={(e)=>{this.setState({pictureUrl:e})}}
 								number = {1} 
@@ -234,7 +224,7 @@ const NewDetailForm = Form.create()(React.createClass({
 						</FormItem>
 					</div>
 					<div  className="clearfix">
-						<FormItem className="half-item" {...formItemLayout} label="置顶">
+						<FormItem className="half-item" {...formItemLayout} label="热门">
 							{getFieldDecorator('top', {
 								initialValue: theData.top
 							})(
@@ -254,15 +244,17 @@ const NewDetailForm = Form.create()(React.createClass({
 								</Radio.Group>
 							)}
 						</FormItem>
-						<FormItem className="half-item" {...formItemLayout} label="阅读量">
-							<span>{theData.readNumber||0}</span>
-						</FormItem>
-                        <FormItem className="half-item" {...formItemLayout} label="评论量">
-                            <span>{theData.commentNumber||0}</span>
-                        </FormItem>
-                        <FormItem className="half-item" {...formItemLayout} label="点赞量">
-                            <span>{theData.starNumber||0}</span>
-                        </FormItem>
+						{this.props.data.id&&<div className="clearfix">
+							<FormItem className="half-item" {...formItemLayout} label="阅读量">
+								<span>{theData.readNumber||0}</span>
+							</FormItem>
+							<FormItem className="half-item" {...formItemLayout} label="评论量">
+								<span>{theData.commentNumber||0}</span>
+							</FormItem>
+							<FormItem className="half-item" {...formItemLayout} label="点赞量">
+								<span>{theData.starNumber||0}</span>
+							</FormItem>
+						</div>}
 					</div>
 					<div className="clearfix">
 						<FormItem wrapperCol={{ span: 12, offset: 3 }}>

+ 3 - 6
js/component/administration/product/proList.jsx

@@ -45,7 +45,6 @@ const DemandList = React.createClass({
                             title: thisdata.title,
                             category:thisdata.category,
                             status: thisdata.status,
-                            source:thisdata.source,
                             releaseTime:thisdata.releaseTime?(new Date(thisdata.releaseTime)).toLocaleString():''
                         });
                     };
@@ -92,6 +91,9 @@ const DemandList = React.createClass({
                     title: '专栏名称',
                     dataIndex: 'title',
                     key: 'title',
+                    render:text=>{
+                        return text&&text.length>30?text.substr(0,30)+'...':text
+                    }
                 }, 
                 {
                     title: '产品类型',
@@ -106,11 +108,6 @@ const DemandList = React.createClass({
                     render: text => { return getProStatus(text) }
                 },
                 {
-                    title: '来源',
-                    dataIndex: 'source',
-                    key: 'source'
-                },
-                {
                     title: '发布时间',
                     dataIndex: 'releaseTime',
                     key: 'releaseTime'