app-base-web
Version:
web development common base package.
85 lines (83 loc) • 3.46 kB
JavaScript
import React from 'react';
import { Table, Form, Row, Col, DatePicker, Button, Input, message } from 'antd';
import UtilDate from '../../../library/util-date';
import UtilDic from '../../../library/util-dic';
import File from '../../../library/file';
import api from '../../../library/util-axios';
// 信息管理-资讯发布
const title = "资讯发布";
const url = "IssueNews/";
export default class FormView extends React.Component {
constructor(props) {
super(props);
this.state = {
...props.values
};
}
componentDidMount() {
let me = this;
api.get(url + "getModel?id=" + this.state.id, {}, function (rs) {
me.setState({
...rs.data
})
});
}
render() {
return (
<Form className="form-view">
<div className="form-title">
<i>{title} - 详情</i>
<span><Button className="btn-edit" onClick={(e) => { this.props.onEdit(this.state) }}><i className="iconfont icon-edit"></i>编辑</Button></span>
</div>
<div className="form-content" style={{ height: this.props.height }}>
<Row>
<Col xs={12}><label>发布状态</label><span>{UtilDic.json("app", "发布状态")[this.state.state]}</span></Col>
</Row>
<Row>
<Col xs={12}><label>类型</label><span>{UtilDic.json("system", "newsType")[this.state.type]}</span></Col>
<Col xs={12}><label>子类型</label><span>{this.state.subType}</span></Col>
</Row>
<Row>
<Col xs={24}><label>标题</label><span dangerouslySetInnerHTML={{ __html: this.state.title }}></span></Col>
</Row>
<Row>
<Col xs={24}><label>封面Url</label><span><File fileList={this.state.coverUrl} hide="true" /></span></Col>
</Row>
<Row>
<Col xs={24}><label>摘要</label><span>{this.state.summary}</span></Col>
</Row>
<Row>
<Col xs={24}><label>内容</label>
<div dangerouslySetInnerHTML={{ __html: this.state.content }} ></div>
</Col>
</Row>
<Row>
<Col xs={12}><label>新闻时间</label><span>{UtilDate.getDate(this.state.newsTime)}</span></Col>
<Col xs={12}><label>责任编辑</label><span>{this.state.editor}</span></Col>
</Row>
<Row>
<Col xs={12}><label>来源</label><span>{this.state.source}</span></Col>
<Col xs={12}><label>标志</label><span>{this.state.mark}</span></Col>
</Row>
<Row>
<Col xs={24}><label>附件列表</label><span><File fileList={this.state.files} hide="true" /></span></Col>
</Row>
<Row>
<Col xs={24}><label>网址</label><span>{this.state.url}</span></Col>
</Row>
<Row>
<Col xs={12}><label>收藏数</label><span>{this.state.cntFavorite}</span></Col>
<Col xs={12}><label>分享数</label><span>{this.state.cntShare}</span></Col>
</Row>
<Row>
<Col xs={12}><label>点击数</label><span>{this.state.cntClick}</span></Col>
<Col xs={12}><label>评论数</label><span>{this.state.cntComment}</span></Col>
</Row>
</div>
<div className="form-toolbar">
<Button className="btn-return" onClick={this.props.onReturn}><i className="iconfont icon-return"></i>返回</Button>
</div>
</Form>
);
}
}