import {
    inject,
    observer
} from 'mobx-react'
import {
    WeaTableNew
} from 'comsMobx'
const WeaTable = WeaTableNew.WeaTable;

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

    componentDidMount() {
        const {
            hrmRecruitLibrary
        } = this.props, {
            mainTable
        } = hrmRecruitLibrary, {
            index
        } = mainTable;

        (index == '8') && this.props.hrmRecruitLibrary.getTableInfo();
    }

    render() {
        const {
            hrmRecruitLibrary,
        } = this.props, {
            subTable,
            onOperatesClick,
        } = hrmRecruitLibrary, {
            tableStore
        } = subTable;

        return (
            <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@q4680y`} 
                comsWeaTableStore={tableStore}
                hasOrder={true}
                needScroll={true}
                onOperatesClick={(record, rowIndex, operate) => onOperatesClick(record, rowIndex, operate)}
            />
        )

    }
}