FormModal.jsx 1016 Bytes
Newer Older
1 2
import React from 'react';
import { Button } from 'antd';
钟是志's avatar
钟是志 committed
3
import { getModal } from '@/webPublic/one_stop_public/utils/utils';
4
import styles from './style.less'
钟是志's avatar
钟是志 committed
5
const Modal = getModal();
chscls@163.com's avatar
chscls@163.com committed
6 7

export default class FormModal extends React.Component {
8
	render() {
9 10 11 12 13 14
		const showFullScreen = () => {
      let dom = document.getElementById('smartFormModal');
      dom.requestFullscreen();
      console.log(dom);
    };

15 16
		return (
			<Modal
17 18 19 20 21
				bodyStyle={{
					maxHeight: '80vh',
					overflowY: 'auto',
				}}
				{...this.props}
22 23 24 25 26 27 28 29
				destroyOnClose
				title={this.props.title}
				maskClosable={false}
				width={this.props.width}
				height={this.props.height}
				visible={this.props.visible}
				footer={null}
				onCancel={this.props.handleCancel}>
30 31 32 33 34 35 36 37
				{this.props.showFullScreen && (
					<Button type={'primary'} onClick={showFullScreen}>
						全屏查看
					</Button>
				)}
        <div id={'smartFormModal'} className={styles.fullScreen}>
          {this.props.children}
        </div>
38 39 40 41
			</Modal>
		);
	}
}