import React, {
	Component
} from 'react';
import {
	observer
} from 'mobx-react';
import {WeaSearchGroup, WeaTableEditable} from 'ecCom';

@observer
export default class Item extends Component {
	constructor(props) {
		super(props);
	}

	componentDidMount() {}

	componentWillReceiveProps(nextProps) {}

	render() {
		const {
            store,
            groupSetting
        } = this.props;
        const {setTableRef, onChange, onRowSelect} = store;
		return (
            <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@d1genp`} title={groupSetting.groupName} showGroup={groupSetting.defaultShow}>
                <WeaTableEditable ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEditable@4diuaf`} 
					ref={ref => setTableRef(ref, groupSetting.tableName)}
					{...store.toJS(groupSetting.tableProps)} 
					onChange={(datas, other) => onChange(datas, other, groupSetting.tableName)} 
					onRowSelect={(selectedRowKeys) => onRowSelect(selectedRowKeys, groupSetting.tableName)}/>
            </WeaSearchGroup>
		)
	}
}