app-base-web
Version:
web development common base package.
46 lines (44 loc) • 1.73 kB
JavaScript
import React from 'react';
import { Form, Row, Col, Button } from 'antd';
import api from '../../../library/util-axios';
// 配置管理-邮箱服务器配置
const title = "邮箱服务器配置";
const url = "CfgEmail/";
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>{this.state.name}</span></Col>
<Col xs={12}><label>邮箱密码</label><span>{this.state.password}</span></Col>
</Row>
<Row>
<Col xs={24}><label>邮箱服务器地址</label><span>{this.state.ip}</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>
);
}
}