forgeplus-react/src/modules/modals/Modals.js

66 lines
2.4 KiB
JavaScript
Raw Normal View History

2020-03-16 14:12:11 +08:00
import React, { Component } from 'react';
2020-04-28 17:23:34 +08:00
import { Spin, Icon, Modal } from 'antd';
2020-03-16 14:12:11 +08:00
class Modals extends Component {
constructor(props) {
super(props);
this.state = {
2020-04-28 17:23:34 +08:00
funmodalsType: false,
istype: false
2020-03-16 14:12:11 +08:00
}
}
2020-04-28 17:23:34 +08:00
render() {
2020-03-16 14:12:11 +08:00
const antIcons = <Icon type="loading" style={{ fontSize: 24 }} spin />
2020-04-28 17:23:34 +08:00
return (
<Modal
className={this.props.className}
keyboard={false}
title="提示"
visible={this.props.modalsType === undefined ? false : this.props.modalsType}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
{this.props.modalsType === true ? <style>
{
`
2020-03-16 14:12:11 +08:00
body{
2020-04-28 17:23:34 +08:00
width: calc(100%) !important;
2020-03-16 14:12:11 +08:00
}
.ant-modal-body {
padding: 20px 40px;
}
.color848282{
color:#848282;
}
2020-04-28 17:23:34 +08:00
.task-btn{
color: #fff !important;
2020-03-16 14:12:11 +08:00
}
2020-04-28 17:23:34 +08:00
`
}
</style> : ""}
<Spin indicator={antIcons} spinning={this.props.antIcon === undefined ? false : this.props.antIcon} >
<div className="task-popup-content">
<p className="task-popup-text-center font-16">{this.props.modalsTopval}</p>
{this.props.modalsMidval === undefined ? "" : <p className={this.props.modalstyles ? "task-popup-text-center font-16 mt5 color848282" : "task-popup-text-center font-16 mt5"}>{this.props.modalsMidval}</p>}
<p className={this.props.modalstyles ? "task-popup-text-center font-16 mt5 color848282" : "task-popup-text-center font-16 mt5"}
>{this.props.modalsBottomval}</p>
{this.props.loadtype === true ?
<div className="clearfix edu-txt-center mt20">
<a className="task-btn task-btn-orange pop_close" onClick={this.props.modalSave}>知道啦</a>
</div>
:
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.modalCancel}>{this.props.cancelText || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={this.props.modalSave}>{this.props.okText || '确定'}</a>
2020-03-16 14:12:11 +08:00
</div>
2020-04-28 17:23:34 +08:00
}
</div>
</Spin>
</Modal>
2020-03-16 14:12:11 +08:00
)
}
}
export default Modals;