import { inject, observer} from 'mobx-react'; import {Row,Col,Input,Button,Alert,Spin,Icon} from 'antd' import {WeaTop} from "ecCom" import MLinkCard from './MLinkCard'; import OLinkCard from './OLinkCard'; import AddProject from '../dialog/addProjectDialog' import {WeaLocaleProvider} from 'ecCom'; const getLabel = WeaLocaleProvider.getLabel; @inject('prjAddStore') @observer class PrjAdd extends React.Component { componentDidMount() { const {prjAddStore} = this.props; prjAddStore.initDatas(); this.scrollheigth(); } scrollheigth(){ let top = jQuery(".wea-prj-add-content").offset() ? (jQuery(".wea-prj-add-content").offset().top ? jQuery(".wea-prj-add-content").offset().top : 0) : 0; let scrollheigth = document.documentElement.clientHeight - top; jQuery(".wea-prj-add-content").height(scrollheigth-30); } componentWillReceiveProps(nextProps){ const keyOld = this.props.location.key; const keyNew = nextProps.location.key; if(keyOld !== keyNew) { const {prjAddStore} = nextProps; prjAddStore.initDatas(); this.scrollheigth(); } } componentWillUnmount(){ const { prjAddStore } = this.props; prjAddStore.clearStatus(); } render() { const {prjAddStore} = this.props; const {showDatas = {},mulitcol,isAbc,loading,addProjectStore} = prjAddStore; const {typesShow,typesCols,usedBeans,abcBtns,user} = showDatas; const actions = {addProjectStore}; return (
} iconBgcolor='#217346' title={getLabel(15007,"新建项目")} buttons={this.getButtons()} showDropIcon={false}/>
{isAbc && (
{ abcBtns.map(abcBtn => ) }
) } { typesShow.length == 0 && !loading ? :( mulitcol ? {typesCols.map((c,i)=>{ return })} : ) }
); } getButtons(){ const {prjAddStore} = this.props; const {isAbc,mulitcol} = prjAddStore; return [ , ] } goABC(letter){ const {prjAddStore} = this.props; prjAddStore.setAbcSelected(letter); let topheight = jQuery('#'+letter).position().top; jQuery(".wea-prj-add-content").scrollTop(topheight); } showMulitcol(){ const {prjAddStore} = this.props; const mulitcol = prjAddStore.mulitcol; prjAddStore.setMulitcol(!mulitcol); jQuery(".wea-wf-add-content").scrollTop(0); } showABC(){ const {prjAddStore} = this.props; const {isAbc} = prjAddStore; prjAddStore.setIsAbc(!isAbc); jQuery(".wea-wf-add-content").scrollTop(0); } } export default PrjAdd