weaver_trunk_cli/pc4mobx/hrm/components/financeV2/index.js

55 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-09-22 14:01:42 +08:00
import '../../style/finance.less';
import React, {Component} from 'react';
import {inject,observer} from 'mobx-react';
import {WeaTop, WeaRightMenu} from 'ecCom';
import Authority from '../../public/coms/Authority';
import Content from './Content';
@inject('financeStore')
@inject('hrmCard')
@observer
export default class Finance extends Component{
componentDidMount(){
this.init(this.props);
}
componentWillReceiveProps(nextProps){
if (this.props.location.key !== nextProps.location.key) {
this.init(nextProps);
}
}
init = props => {
this.props.financeStore.init(props)
}
render(){
const {financeStore: store} = this.props;
const {fromcard, topProps} = store;
let com;
if(fromcard){
com = (
2023-09-26 16:58:23 +08:00
<WeaRightMenu datas={topProps.dropMenuDatas}>
<Content store={store} />
2023-09-22 14:01:42 +08:00
</WeaRightMenu>
)
}else{
com = (
2023-09-26 16:58:23 +08:00
<WeaTop {...topProps}>
<WeaRightMenu datas={topProps.dropMenuDatas}>
<Content store={store} />
2023-09-22 14:01:42 +08:00
</WeaRightMenu>
</WeaTop>
)
}
return (
<div className='hrm_finance'>
2023-09-26 16:58:23 +08:00
<Authority store={store}>
2023-09-22 14:01:42 +08:00
{com}
</Authority>
</div>
)
}
}