import {
    inject,
    observer
} from 'mobx-react'
import {
    WeaDialog,
    WeaRightMenu
} from 'ecCom'

//根据情况import组件
import FormInfo from './FormInfo';

@inject('hrmRecruitPlan') //todo
@observer
export default class SubDialog extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        const {
            hrmRecruitPlan
        } = this.props, {
            subDialog,
            closeDialog,
            buttons,
            style,
            dropMenuDatas,
        } = hrmRecruitPlan, {
            title,
            visible,
        } = subDialog;

        return (
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@75hxmp`}
                title={title}
                icon="icon-coms-hrm"
                iconBgcolor="#217346"
                visible={visible}
                hasScroll={true}
                onCancel={() => closeDialog()}
                buttons={buttons}
                style={style}
            >
                <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@6s6l9s`} datas={dropMenuDatas}>
                    {visible && <FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@b4aq6r`} />}
                </WeaRightMenu>
            </WeaDialog>
        )

    }
}