import {
	inject,
	observer,
} from 'mobx-react'
import {
	toJS
} from 'mobx'
import {
	WeaDialog,
	WeaMoreButton,
} from 'ecCom'
import {
	Button,
} from 'antd'
import {
	i18n
} from '../../public/i18n';

import ThirdTable from './ThirdTable';

@inject('hrmAssImple')
@observer
export default class SubDialog extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			width: 800,
			height: 450,
		}
	}

	componentDidMount() {
		this.props.hrmAssImple.getTableInfo();
	}

	getButtons = () => {
		const btns = (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@fqx4hs`} />)
		return btns;
	}


	render() {
		const {
			hrmAssImple
		} = this.props, {
			closeDialog,
			subDialog,
		} = hrmAssImple, {
			title,
			visible,
		} = subDialog, {
			width,
			height,
		} = this.state;

		return (
			<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@33mbop`}
	          	title={title}
	          	icon="icon-coms-hrm"
	          	iconBgcolor="#217346"
	          	visible={visible}
	          	closable={true}
	          	hasScroll={true}
	          	onCancel={() => closeDialog()}
	          	buttons={this.getButtons()}
	          	style={{width: width, height: height}}
	          	onChangeHeight={(h) => this.setState({height: h})}
	        >
	          	{visible && <ThirdTable ecId={`${this && this.props && this.props.ecId || ''}_ThirdTable@pr1ouo`} />}
	        </WeaDialog>
		)

	}
}