import React from 'react';
import {
	inject,
	observer
} from 'mobx-react';
import {
	Authority,
	Top,
} from '../../public/coms/index.js';
import {MagicForm} from '../../public/valhalla/components/index';

@inject('salaryApplySet')
@observer
class SalaryApplySet extends React.Component {
	componentWillReceiveProps(nextProps) {
		if (this.props.location.key !== nextProps.location.key) {
			this.props.salaryApplySet.init();
		}
	}

	componentDidMount() {
		this.props.salaryApplySet.init();
	}

	render() {
		const {
			salaryApplySet
		} = this.props, {
			authorityStore,
			topStore,
			formStore,
			pageloading,
			topTitle,
			searchGroupProps
		} = salaryApplySet;

		return (
			<Authority ecId={`${this && this.props && this.props.ecId || ''}_Authority@z8fyyp`} store={authorityStore}>
				<Top ecId={`${this && this.props && this.props.ecId || ''}_Top@bqebcp`} store={topStore} loading={pageloading} title={topTitle}>
					<div style={{paddingLeft:'15%',paddingTop:15}}>
						<MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@qgcif3`} store={formStore}/>
					</div>
				</Top>
			</Authority>
		);
	}
}

export default SalaryApplySet;