|
@@ -13,11 +13,13 @@ import {
|
|
Checkbox,
|
|
Checkbox,
|
|
Cascader,
|
|
Cascader,
|
|
Row,
|
|
Row,
|
|
- Col
|
|
|
|
|
|
+ Col,
|
|
|
|
+ DatePicker
|
|
} from 'antd';
|
|
} from 'antd';
|
|
import { splitUrl} from '@/tools.js';
|
|
import { splitUrl} from '@/tools.js';
|
|
import {provinceSelect } from '@/NewDicProvinceList';
|
|
import {provinceSelect } from '@/NewDicProvinceList';
|
|
import Editors from '@/richTextEditors';
|
|
import Editors from '@/richTextEditors';
|
|
|
|
+import moment from "moment";
|
|
|
|
|
|
const PicturesWall = React.createClass({
|
|
const PicturesWall = React.createClass({
|
|
getInitialState() {
|
|
getInitialState() {
|
|
@@ -72,7 +74,7 @@ const PicturesWall = React.createClass({
|
|
);
|
|
);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
const NewDetailForm = Form.create()(React.createClass({
|
|
const NewDetailForm = Form.create()(React.createClass({
|
|
getInitialState() {
|
|
getInitialState() {
|
|
return {
|
|
return {
|
|
@@ -115,8 +117,10 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
publishPages:thisData.publishPages?thisData.publishPages:['web_policy_main','app_policy_main'],
|
|
publishPages:thisData.publishPages?thisData.publishPages:['web_policy_main','app_policy_main'],
|
|
auditStatus:thisData.auditStatus,
|
|
auditStatus:thisData.auditStatus,
|
|
edit:{content:thisData.content},
|
|
edit:{content:thisData.content},
|
|
- pictureUrl: thisData.titleImg ? splitUrl(thisData.titleImg, ',', globalConfig.avatarHost + '/upload') : []
|
|
|
|
|
|
+ pictureUrl: thisData.titleImg ? splitUrl(thisData.titleImg, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
|
+ releaseData: thisData.releaseDate,
|
|
});
|
|
});
|
|
|
|
+ console.log(this.state)
|
|
}.bind(this),
|
|
}.bind(this),
|
|
}).always(function () {
|
|
}).always(function () {
|
|
this.setState({
|
|
this.setState({
|
|
@@ -131,6 +135,8 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
this.props.form.validateFields((err, values) => {
|
|
this.props.form.validateFields((err, values) => {
|
|
//url转化
|
|
//url转化
|
|
|
|
+ console.log(values)
|
|
|
|
+ console.log(moment(values.releaseData).format('YYYY-MM-DD'))
|
|
if((this.state.edit).content==undefined||!(this.state.edit).content||(this.state.edit).content=='<p><br></p>'){
|
|
if((this.state.edit).content==undefined||!(this.state.edit).content||(this.state.edit).content=='<p><br></p>'){
|
|
message.warning('请填写政策正文');
|
|
message.warning('请填写政策正文');
|
|
return false;
|
|
return false;
|
|
@@ -169,7 +175,8 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
auditStatus:index,
|
|
auditStatus:index,
|
|
summary: values.summary,
|
|
summary: values.summary,
|
|
province: (values.ProvinceCity)[0],
|
|
province: (values.ProvinceCity)[0],
|
|
- publishPages:publishPages
|
|
|
|
|
|
+ publishPages:publishPages,
|
|
|
|
+ releaseData:moment(values.releaseData).format('YYYY-MM-DD'),
|
|
}
|
|
}
|
|
}).done(function (data) {
|
|
}).done(function (data) {
|
|
this.setState({
|
|
this.setState({
|
|
@@ -225,9 +232,9 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
this.props.form.resetFields();
|
|
this.props.form.resetFields();
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- render() {
|
|
|
|
|
|
+ render() {
|
|
const theData = this.state.data || {};
|
|
const theData = this.state.data || {};
|
|
- const { getFieldDecorator } = this.props.form;
|
|
|
|
|
|
+ const { getFieldDecorator } = this.props.form;
|
|
const FormItem = Form.Item
|
|
const FormItem = Form.Item
|
|
const formItemLayout = {
|
|
const formItemLayout = {
|
|
labelCol: { span: 6 },
|
|
labelCol: { span: 6 },
|
|
@@ -248,7 +255,19 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
initialValue: theData.title
|
|
initialValue: theData.title
|
|
})(<Input placeholder="请输入您的政策政策标题" maxLength={40}/>)}
|
|
})(<Input placeholder="请输入您的政策政策标题" maxLength={40}/>)}
|
|
</FormItem>
|
|
</FormItem>
|
|
|
|
+ <FormItem className="half-item" {...formItemLayout} label="发布日期">
|
|
|
|
+ {getFieldDecorator('releaseData',{
|
|
|
|
+ rules:[{required:true,message:"发布时间不能为空"}],
|
|
|
|
+ initialValue: theData.releaseData
|
|
|
|
+ })(<DatePicker defaultValue={moment()}
|
|
|
|
+ showTime
|
|
|
|
+ format="YYYY-MM-DD" />)}
|
|
|
|
+
|
|
|
|
+ </FormItem>
|
|
|
|
+
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
<FormItem className="half-item" {...formItemLayout} label="热门">
|
|
<FormItem className="half-item" {...formItemLayout} label="热门">
|
|
{getFieldDecorator('hot', {
|
|
{getFieldDecorator('hot', {
|
|
@@ -272,10 +291,10 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
initialValue: theData.sourceUrl
|
|
initialValue: theData.sourceUrl
|
|
})(<Input placeholder="请输入政策来源链接" />)}
|
|
})(<Input placeholder="请输入政策来源链接" />)}
|
|
</FormItem>
|
|
</FormItem>
|
|
- <FormItem className="half-item"
|
|
|
|
|
|
+ <FormItem className="half-item"
|
|
{...formItemLayout}
|
|
{...formItemLayout}
|
|
label="省-市-区"
|
|
label="省-市-区"
|
|
- >
|
|
|
|
|
|
+ >
|
|
{getFieldDecorator('ProvinceCity', {
|
|
{getFieldDecorator('ProvinceCity', {
|
|
rules: [ { required: true, message: '此项为必填项!' } ],
|
|
rules: [ { required: true, message: '此项为必填项!' } ],
|
|
initialValue: this.state.Province
|
|
initialValue: this.state.Province
|
|
@@ -283,7 +302,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
<Cascader options={provinceSelect()} placeholder="选择城市" />
|
|
<Cascader options={provinceSelect()} placeholder="选择城市" />
|
|
)}
|
|
)}
|
|
</FormItem>
|
|
</FormItem>
|
|
-
|
|
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
<FormItem {...formItemLayouts} label="关键字">
|
|
<FormItem {...formItemLayouts} label="关键字">
|
|
@@ -318,14 +337,14 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
visible={this.state.visible} />
|
|
visible={this.state.visible} />
|
|
</FormItem>
|
|
</FormItem>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+
|
|
{theData.createTime&&<div className="clearfix">
|
|
{theData.createTime&&<div className="clearfix">
|
|
<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="是否发布">
|
|
<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="是否发布">
|
|
<span>{theData.releaseStatus?'已发布':'未发布'}</span>
|
|
<span>{theData.releaseStatus?'已发布':'未发布'}</span>
|
|
</FormItem>
|
|
</FormItem>
|
|
</div>}
|
|
</div>}
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
- <FormItem className="full-item"
|
|
|
|
|
|
+ <FormItem className="full-item"
|
|
labelCol={{ span: 3 }}
|
|
labelCol={{ span: 3 }}
|
|
wrapperCol={{ span: 18 }} label="发布位置">
|
|
wrapperCol={{ span: 18 }} label="发布位置">
|
|
{getFieldDecorator('publishPages', {
|
|
{getFieldDecorator('publishPages', {
|
|
@@ -365,7 +384,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
</FormItem>
|
|
</FormItem>
|
|
</div>
|
|
</div>
|
|
</Spin>
|
|
</Spin>
|
|
- </Form>
|
|
|
|
|
|
+ </Form>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|