import React from 'react'; import {inject, observer} from 'mobx-react'; import {routerShape} from 'react-router'; import {Condition} from '../list/listCondition'; import {WeaErrorPage,WeaTools,WeaTop,WeaRightMenu,WeaLocaleProvider} from 'ecCom'; import {Button} from 'antd'; const getLabel = WeaLocaleProvider.getLabel; @inject("queryPrjStore") @observer class QueryProjectCondition extends React.Component { static contextTypes = { router: routerShape } constructor(props) { super(props); } resetHeight(height){ jQuery(".prj-query-condition").height(height - 60); } componentDidMount() { const {queryPrjStore} = this.props; queryPrjStore.initDatas(); } componentWillReceiveProps(nextProps){ if(this.props.location.key !== nextProps.location.key){ const {queryPrjStore} = this.props; queryPrjStore.initDatas({},true); } } shouldComponentUpdate(nextProps, nextState) { return true; } render() { const { queryPrjStore } = this.props; const { loading,form } = queryPrjStore; return (
} iconBgcolor='#217346' getHeight={this.resetHeight.bind(this)} buttons={[]} buttonSpace={10} showDropIcon={true} dropMenuDatas={this.getRightMenu()} >
{this.getSearchButtons()}
) } getRightMenu(){ let btns = []; btns.push({ key: "search", icon: , content: getLabel(197,"搜索"), onClick: this.forwardQueryResult.bind(this) }); return btns; } getSearchButtons() { const { queryPrjStore } = this.props; const {clearFormFields,setSelectedTreeKey} = queryPrjStore; const btnStyle = {borderRadius: 3, minWidth: 80} return [ (), (), () ] } forwardQueryResult(){ const path = "/queryProjectResult"; this.context.router.push({ pathname: "/main/prj"+path }); } } export default WeaTools.tryCatch(React, props => , {error: ""} )(QueryProjectCondition);