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

@inject('hrmStaffPayrollSummary')
@observer
export default class MainTable extends React.Component {
    constructor(props) {
        super(props);
    }

    componentWillUnmount() {
        this.props.hrmStaffPayrollSummary.resetTable({
            type: 'main'
        });
    }

    render() {
        const {
            hrmStaffPayrollSummary,
        } = this.props, {
            mainTable,
            onOperatesClick,
            reRenderColumns,
        } = hrmStaffPayrollSummary, {
            tableStore,
            colNum,
        } = mainTable;

        return (
            <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@302y16`} 
                comsWeaTableStore={tableStore}
                hasOrder={true}
                needScroll={true}
                scroll={{x: colNum*100}}
                getColumns={reRenderColumns}
                onOperatesClick={onOperatesClick}
            />
        )

    }
}