/**
 * 徐立
 * 2019年9月19日
 * 事务发起提交多次弹框
 */
import React, {Component} from 'react'
import { getModal } from '@/webPublic/one_stop_public/utils/utils';

const Modal = getModal();

export default class AddModal extends Component {
  constructor(props) {
    super(props);
    this.state = {
      top: 0,
    }
  }

  componentDidMount() {
    setTimeout(() => {
      let dom = document.getElementById('tabsTableFromIframe');
      if (dom && dom.offsetHeight) {
        let height = dom.offsetHeight;
        if (height > 700) {
          this.setState({
            top: height - 700,
          })
        }
        //  console.log(height, 'Iframe页面的高度');
      }
    }, 1500);
  }


  render() {
    let {visible, handleCancel, handleOk, loading} = this.props;
    const { top } = this.state;
    const style = {
    };
    if(top){
      style.top = top;
    }
    return (
      <Modal
        title="提交申请"
        visible={visible}
        onOk={handleOk}
        confirmLoading={loading}
        onCancel={handleCancel}
        width={400}
        style={style}
      >
        <p style={{width: '100%', textAlign: 'center', fontSize: 14, color: '#666666'}}>确定要提交申请吗？</p>
      </Modal>
    )
  }
}
