1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
* 徐立
* 2019年9月16日
* Modal定制样式
*/
import React, {Component} from 'react';
import { Button } from 'antd';
import { getModal } from '@/webPublic/one_stop_public/utils/utils';
import stylesList from '@/webPublic/one_stop_public/AffairButton/AuditButton/Modal/stylesList';
const Modal = getModal();
export default class WebModal extends Component {
constructor(props) {
super(props);
this.state = {
top: 0,
};
}
/**
* 钟是志
* 2020年4月22日 17:07:53
* 修改Iframe打开弹窗的时候 弹窗定位错误的bug
* */
componentDidMount() {
// setTimeout(() => {
// let dom = document.getElementById('detailInfoDiv');
// 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, title, width, getContainer} = this.props;
const {top} = this.state;
const style = {
borderRadius: 4,
};
if (top) {
style.top = top;
}
let dom = document.getElementsByClassName('antd-pro-web-public-one_stop_public-affair-button-audit-button-user-table-styles-btn_page');
if(dom && dom.length){
dom = dom[0];
}
return (
<Modal
closable={false}
visible={visible}
footer={null}
destroyOnClose={true}
width={!!width ? width : 800}
handleCancel={handleCancel}
style={style}>
<div style={stylesList.content_div}>
<div style={stylesList.title}>
{title}
<Button style={stylesList.button}
onClick={handleCancel}>
X
</Button>
</div>
{this.props.children}
</div>
</Modal>
);
}
}