import React from 'react';
import { Modal } from 'antd';
/**
 * 注释：
 * @ByYQL 全局公共组件 消息提示弹框
 * 注：该组件适用于消息提醒
 * Create 2022-2-11
 */

class MessageModal extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      visible: false,//弹框显示状态
      message: ""
    }
  }

  componentDidMount() {
    this.props.onRef(this);
  }

  componentWillUnmount() {

  }

  showModal = (message) => {
    this.setState({
      visible: true,
      message: message
    }, () => {

    });
  };

  close = () => {
    this.setState({
      visible: false,
    });
  };

  render() {
    const { visible } = this.state;
    return (
      <div className="">
        <Modal
          width='600px'
          visible={visible}
          zIndex='9999'
          title={"提示"}
          okText="知道了"
          onCancel={this.close}
          onOk={this.close}>
          {this.state.message}
        </Modal>
      </div>
    )
  }
}

export default MessageModal;