|
@@ -5,6 +5,8 @@ import Editors from '../../../richTextEditors'
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
import $ from 'jquery/src/ajax';
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
+import {provinceList} from '../../../NewDicProvinceList';
|
|
|
|
+console.log(provinceList[0].id)
|
|
const Avatar = React.createClass({
|
|
const Avatar = React.createClass({
|
|
getInitialState() {
|
|
getInitialState() {
|
|
return {
|
|
return {
|
|
@@ -44,6 +46,7 @@ const Avatar = React.createClass({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
const News = React.createClass({
|
|
const News = React.createClass({
|
|
|
|
+
|
|
loadData(pageNo, theType) {
|
|
loadData(pageNo, theType) {
|
|
this.setState({
|
|
this.setState({
|
|
loading: true
|
|
loading: true
|
|
@@ -117,17 +120,21 @@ const News = React.createClass({
|
|
data: {
|
|
data: {
|
|
id: this.state.RowData.id //新闻主键ID(数字类型,非字符串)
|
|
id: this.state.RowData.id //新闻主键ID(数字类型,非字符串)
|
|
},
|
|
},
|
|
- success: function (data) {
|
|
|
|
|
|
+ success: function (data) {
|
|
let theObj = {};
|
|
let theObj = {};
|
|
- if (!data.data) {
|
|
|
|
|
|
+ if (!data.data) {
|
|
if (data.error && data.error.length) {
|
|
if (data.error && data.error.length) {
|
|
message.warning(data.error[0].message);
|
|
message.warning(data.error[0].message);
|
|
- };
|
|
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- theObj = data.data;
|
|
|
|
|
|
+ theObj = data.data;
|
|
|
|
+ if(theObj.provinceId==null||theObj.provinceId==''){
|
|
|
|
+ theObj.provinceId=11
|
|
|
|
+ }
|
|
};
|
|
};
|
|
this.setState({
|
|
this.setState({
|
|
RowData: theObj,
|
|
RowData: theObj,
|
|
|
|
+
|
|
});
|
|
});
|
|
}.bind(this),
|
|
}.bind(this),
|
|
}).always(function () {
|
|
}).always(function () {
|
|
@@ -181,6 +188,7 @@ const News = React.createClass({
|
|
width: '50%'
|
|
width: '50%'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
|
|
+ list:provinceList,
|
|
tableData: []
|
|
tableData: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -238,7 +246,8 @@ const News = React.createClass({
|
|
summary: this.state.RowData.summary,
|
|
summary: this.state.RowData.summary,
|
|
content: this.state.RowData.content,
|
|
content: this.state.RowData.content,
|
|
createTimeFormattedDate: this.state.RowData.createTimeFormattedDate,
|
|
createTimeFormattedDate: this.state.RowData.createTimeFormattedDate,
|
|
- jmrhFlag: this.state.RowData.jmrhFlag ,
|
|
|
|
|
|
+ jmrhFlag: this.state.RowData.jmrhFlag ,
|
|
|
|
+ provinceId: this.state.RowData.provinceId,
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -484,15 +493,15 @@ const News = React.createClass({
|
|
}} />
|
|
}} />
|
|
</div>
|
|
</div>
|
|
</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 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">
|
|
{this.props.newsType == 2 || this.props.newsType == 3 ? <div className="modal-box news-box">
|
|
<span className="modal-box-title">发布在首页</span>
|
|
<span className="modal-box-title">发布在首页</span>
|
|
@@ -508,7 +517,20 @@ const News = React.createClass({
|
|
</div> : <div></div>}
|
|
</div> : <div></div>}
|
|
</div>
|
|
</div>
|
|
<div className="modal-box">
|
|
<div className="modal-box">
|
|
- <span className="modal-box-title">新闻内容</span>
|
|
|
|
|
|
+ <span className="modal-box-title">选择省份</span>
|
|
|
|
+ <select value={this.state.RowData.provinceId} onChange={(e) => {
|
|
|
|
+ this.state.RowData.provinceId = e.target.value;
|
|
|
|
+ this.setState({RowData: this.state.RowData});
|
|
|
|
+ }} className="provin">
|
|
|
|
+ {
|
|
|
|
+ this.state.list.map(function(name){
|
|
|
|
+ return (
|
|
|
|
+ <option value={name.id} key={name.id} >{name.name}</option>
|
|
|
|
+ )
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ </select>
|
|
</div>
|
|
</div>
|
|
<Editors textContent={this.state.RowData.content}
|
|
<Editors textContent={this.state.RowData.content}
|
|
uploadUrl={'/api/admin/news/upload'}
|
|
uploadUrl={'/api/admin/news/upload'}
|
|
@@ -525,4 +547,5 @@ const News = React.createClass({
|
|
);
|
|
);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
export default News;
|
|
export default News;
|