12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- import React from 'react';
- import {
- Spin,
- Form,
- } from 'antd';
- import '../../policy/policy.less';
- const NewDetail = Form.create()(React.createClass({
- getInitialState() {
- return {
- visible: false,
- loading: false,
- };
- },
- cancelFun(){
- this.props.closeDesc(false,false);
- },
-
- componentWillMount() {
- if (this.props.data.id) {
-
- } else {
- this.state.data = {};
- };
- },
- componentWillReceiveProps(nextProps) {
- if (!this.props.visible && nextProps.visible) {
- this.state.textFileList = [];
- this.state.videoFileList = [];
- if (nextProps.data.id) {
-
- } else {
- this.state.data = {};
- };
- this.props.form.resetFields();
- };
- },
- render() {
- const theData = this.props.data || {};
- const FormItem = Form.Item
- const formItemLayout = {
- labelCol: { span:12},
- wrapperCol: { span: 12 },
- };
- return (
- <div className='login'>
- <Form layout="horizontal" id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem className="half-item" {...formItemLayout} label="创建人">
- <span>{theData.admin?theData.admin:'管理员'}</span>
- </FormItem>
- </div>
- <div>
- <FormItem labelCol={{ span: 6 }} wrapperCol={{ span: 14 }} label="标题">
- <span>{theData.title}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem labelCol={{ span:6 }} wrapperCol={{ span: 18 }} label="消息内容">
- <span>{theData.body}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem labelCol={{ span:6 }} wrapperCol={{ span: 14 }} label="推送内容">
- <span>{theData.resourceName}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem labelCol={{ span:6 }} wrapperCol={{ span: 18 }} label="推送时间">
- <span>{theData.releaseDate}</span>
- </FormItem>
- </div>
- </Spin>
- </Form>
- </div>
- )
- }
- }));
- export default NewDetail;
|