liting2017 6 years ago
parent
commit
c8da98f312

+ 1 - 1
js/component/administration/achievement/achievementDetaiel.jsx

@@ -57,7 +57,7 @@ const DemandDetail = Form.create()(React.createClass({
 					isUrgent:thisData.isUrgent,
 					status:thisData.status,
 					isHot:thisData.isHot,
-                    pictureUrl: thisData.firstPicture ? splitUrl(thisData.firstPicture, ',', globalConfig.avatarHost + '/upload') : []
+                    pictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
         }).always(function () {

+ 3 - 3
js/component/administration/business/businessProject.jsx

@@ -762,7 +762,7 @@ const BusinessProject=Form.create()(React.createClass({
 								<FormItem className="half-item"
 									labelCol={{ span: 8 }}
 									wrapperCol={{ span: 10 }}
-									label="业务项目图标" >
+									label="业务项目图标(大)" >
 									<PicturesWall
 										pictureSign="business_project_min_picture"
 										fileList={this.getOrgCodeUrl}
@@ -770,9 +770,9 @@ const BusinessProject=Form.create()(React.createClass({
 										<p>图片建议:图片要清晰。(35*35)</p>
 								</FormItem>
 								<FormItem className="half-item"
-									labelCol={{ span: 4 }}
+									labelCol={{ span: 8 }}
 									wrapperCol={{ span: 12 }}
-									label="业务项目图标" > 
+									label="业务项目图标(小)" > 
 									<PicturesWall
 										pictureSign="business_project_max_picture"
 										fileList={this.getCompanyLogoUrl}

+ 0 - 2
js/component/administration/news/newDetails.jsx

@@ -54,10 +54,8 @@ const NewDetail = Form.create()(React.createClass({
                     pages.map(item=>{
                         page.push(item.publishPage)
                     })
-                    console.log(page)
                     let eleDiv = document.createElement('div');
                     eleDiv.innerHTML=thisData.content;
-                    console.log(eleDiv);
                     document.querySelector('.txt').append(eleDiv);
                 this.setState({
                     id:thisData.id,

+ 15 - 14
js/component/administration/news/newForm.jsx

@@ -83,7 +83,8 @@ const NewDetailForm = Form.create()(React.createClass({
             videoFileList: [],
 			pictureUrl: [],
 			tags:[],
-			edit:{}
+			edit:{},
+			edits:{}
         };
     },
     loadData(id) {
@@ -118,7 +119,7 @@ const NewDetailForm = Form.create()(React.createClass({
 					Province:provice,
 					publishPages:publishPagesArr,
 					auditStatus:thisData.auditStatus,
-					edit:{content:thisData.content},
+					edit:thisData.content,
                     pictureUrl: thisData.titleImg ? splitUrl(thisData.titleImg, ',', globalConfig.avatarHost + '/upload') : []
                 });
             }.bind(this),
@@ -134,7 +135,7 @@ const NewDetailForm = Form.create()(React.createClass({
     handleSubmit(e,index) {
 		e.preventDefault();
         this.props.form.validateFields((err, values) => {
-			if((this.state.edit).content==undefined||!(this.state.edit).content||(this.state.edit).content=='<p><br></p>'){
+			if((this.state.edit)==undefined||!this.state.edit||(this.state.edit)=='<p><br></p>'){
 				message.warning('请填写政策正文');
 				return false;
 			}
@@ -165,7 +166,7 @@ const NewDetailForm = Form.create()(React.createClass({
 						title: values.title,
                         author: values.author,
                         titleImg: thePictureUrl,
-						content:this.state.edit.content,
+						content:this.state.edit,
 						hot:values.hot,
 						source:values.source,
 						sourceUrl:values.sourceUrl,
@@ -199,8 +200,9 @@ const NewDetailForm = Form.create()(React.createClass({
         if (this.props.data.id) {
             this.loadData(this.props.data.id);
         } else {
+			this.state.visible=true;
 			this.state.data = {};
-			this.state.edit={};
+			this.state.edit='<p><br></p>';
 			this.state.pictureUrl = [];
 			this.setState({
 				publishPages:['web_index','app_policy_index']
@@ -214,8 +216,9 @@ const NewDetailForm = Form.create()(React.createClass({
             if (nextProps.data.id) {
                 this.loadData(nextProps.data.id);
             } else {
+				this.state.visible=true;
 				this.state.data = {};
-				this.state.edit={};
+				this.state.edit='<p><br></p>';
 				this.state.pictureUrl = [];
 				this.state.theData={};
 				this.setState({
@@ -233,7 +236,6 @@ const NewDetailForm = Form.create()(React.createClass({
             labelCol: { span: 6 },
             wrapperCol: { span: 12 },
 		};
-		
         return (
 			<div className='login'>
 			<Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} id="demand-form">
@@ -300,19 +302,18 @@ const NewDetailForm = Form.create()(React.createClass({
 					</div>
 					<div className="clearfix">
 						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label={<span><i style={{color:"red",fontSize:14}}> * </i>新闻正文</span>}>
-							<Editors textContent={this.state.edit.content}
+							<Editors textContent={this.state.edit}
 								uploadUrl={'/api/user/demand/uploadPicture'}
 								uploadSign={'demand_picture'}
-								handleRichText={(value) => { this.state.edit.content = value; }}
+								handleRichText={(value) => { this.state.edit = value;  }}
 								visible={this.state.visible} />
 						</FormItem>
 					</div>
-					
-					{theData.createTime&&<div className="clearfix">
+					<div className="clearfix">
 						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="是否发布">
 							<span>{theData.releaseStatus?'已发布':'未发布'}</span>
 						</FormItem>
-					</div>}
+					</div>
 					<div className="clearfix">
 						<FormItem className="full-item" 
 							labelCol={{ span: 3 }}
@@ -334,9 +335,9 @@ const NewDetailForm = Form.create()(React.createClass({
 					</div>
 					<div className="clearfix">
 						<FormItem wrapperCol={{ span: 12, offset: 3 }}>
-						{this.props.data&&!this.props.data.id&&<Button className="set-submit" type="primary" htmlType="submit">
+						    <Button className="set-submit" type="primary" htmlType="submit">
 								保存草稿
-							</Button>}
+							</Button>
 							<Button
 								className="set-submit"
 								type="ghost"

+ 3 - 3
js/component/administration/policy/policyForm.jsx

@@ -63,7 +63,7 @@ const PicturesWall = React.createClass({
 					onPreview={this.handlePreview}
 					onChange={this.handleChange}
 				>
-					{fileList.length >= 3 ? null : uploadButton}
+					{fileList.length >= 2 ? null : uploadButton}
 				</Upload>
 				<Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
 					<img alt="example" style={{ width: '100%' }} src={previewImage} />
@@ -336,9 +336,9 @@ const NewDetailForm = Form.create()(React.createClass({
 					</div>
 					<div className="clearfix">
 						<FormItem wrapperCol={{ span: 12, offset: 3 }}>
-						{this.props.data&&!this.props.data.id&&<Button className="set-submit" type="primary" htmlType="submit">
+							<Button className="set-submit" type="primary" htmlType="submit">
 								保存草稿
-							</Button>}
+							</Button>
 							<Button
 								className="set-submit"
 								type="ghost"

+ 1 - 7
js/component/richTextEditors.jsx

@@ -58,14 +58,8 @@ const Editors = React.createClass({
         RichTextUploadSign = this.props.uploadSign;
     },
     componentWillReceiveProps(nextProps) {
-        if (this.state.theBool && nextProps.textContent) {
-            this.state.value = nextProps.textContent;
-            this.state.theBool = false;
-        }
-        if (this.props.visible && !nextProps.visible) {
             this.state.theBool = true;
-            this.state.value = '';
-        }
+            this.state.value = nextProps.textContent;
     },
     render() {
         const modules = {