This commit is contained in:
parent
13c662be09
commit
3c950521a2
|
|
@ -14,7 +14,8 @@ import {
|
||||||
WeaTab,
|
WeaTab,
|
||||||
WeaNewScroll,
|
WeaNewScroll,
|
||||||
WeaAlertPage,
|
WeaAlertPage,
|
||||||
WeaAvatar
|
WeaAvatar,
|
||||||
|
WeaLeftRightLayout
|
||||||
} from 'ecCom'
|
} from 'ecCom'
|
||||||
import isEmpty from 'lodash/isEmpty'
|
import isEmpty from 'lodash/isEmpty'
|
||||||
import * as mobx from 'mobx';
|
import * as mobx from 'mobx';
|
||||||
|
|
@ -33,8 +34,10 @@ import {
|
||||||
WeaPopoverHrm
|
WeaPopoverHrm
|
||||||
} from 'ecCom';
|
} from 'ecCom';
|
||||||
import TopButton from '../../coms/topButton';
|
import TopButton from '../../coms/topButton';
|
||||||
import {i18n} from '../../public/i18n';
|
import { i18n } from '../../public/i18n';
|
||||||
import {addContentPath} from '../../util/index.js'
|
import { addContentPath } from '../../util/index.js'
|
||||||
|
|
||||||
|
const TabPane = Tabs.TabPane;
|
||||||
|
|
||||||
const { ua } = WeaTools;
|
const { ua } = WeaTools;
|
||||||
const isIE9 = ua.browser === "IE"
|
const isIE9 = ua.browser === "IE"
|
||||||
|
|
@ -48,7 +51,7 @@ class Main extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
weaWorkplanLoaded:false,
|
weaWorkplanLoaded: false,
|
||||||
rightMenu: []
|
rightMenu: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -65,9 +68,9 @@ class Main extends React.Component {
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
// 异步加载日程模块静态资源
|
// 异步加载日程模块静态资源
|
||||||
eventRegister.loadModule('f_workplan', ()=> {
|
eventRegister.loadModule('f_workplan', () => {
|
||||||
this.setState({weaWorkplanLoaded:true});
|
this.setState({ weaWorkplanLoaded: true });
|
||||||
}, ()=> {});
|
}, () => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
@ -93,7 +96,7 @@ class Main extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setParentRightMenu = rightMenu => this.setState({rightMenu})
|
setParentRightMenu = rightMenu => this.setState({ rightMenu })
|
||||||
|
|
||||||
getTabChildren() {
|
getTabChildren() {
|
||||||
const {
|
const {
|
||||||
|
|
@ -115,22 +118,22 @@ class Main extends React.Component {
|
||||||
if (tabKey === t.key) {
|
if (tabKey === t.key) {
|
||||||
if (t.isIframe) {
|
if (t.isIframe) {
|
||||||
isIframe = true;
|
isIframe = true;
|
||||||
if(t.key == 'iframe-9-workplansearch'){ // 日程模块加载方式
|
if (t.key == 'iframe-9-workplansearch') { // 日程模块加载方式
|
||||||
const selectedUser = t.url.split('?')[1].split('&')[1].split('=')[1];
|
const selectedUser = t.url.split('?')[1].split('&')[1].split('=')[1];
|
||||||
this.state.weaWorkplanLoaded && window.weaWorkplan && window.weaWorkplan.com ?
|
this.state.weaWorkplanLoaded && window.weaWorkplan && window.weaWorkplan.com ?
|
||||||
ifame = <window.weaWorkplan.com.MyWorkPlan ecId={`${this && this.props && this.props.ecId || ''}_undefined@ai7pco`} location={{query:{hidesidebar: 'true',hideheader: 'true', selectedUser:selectedUser, fromcard:'true'}}}/>
|
ifame = <window.weaWorkplan.com.MyWorkPlan ecId={`${this && this.props && this.props.ecId || ''}_undefined@ai7pco`} location={{ query: { hidesidebar: 'true', hideheader: 'true', selectedUser: selectedUser, fromcard: 'true' } }} />
|
||||||
:
|
:
|
||||||
''
|
''
|
||||||
}else{
|
} else {
|
||||||
ifame = <iframe className="card-iframe" style={{height:window.innerHeight-175}} src={addContentPath(t.url)}></iframe>
|
ifame = <iframe className="card-iframe" style={{ height: window.innerHeight - 175 }} src={addContentPath(t.url)}></iframe>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@4jxjh8`} className={innerPage?'hrm-card-hastop' : 'hrm-card-notop'}>
|
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@4jxjh8`} className={innerPage ? 'hrm-card-hastop' : 'hrm-card-notop'}>
|
||||||
{isIframe ? ifame : children}
|
{isIframe ? ifame : children}
|
||||||
</WeaNewScroll>
|
</WeaNewScroll>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
|
|
@ -161,100 +164,107 @@ class Main extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (verified) {
|
if (verified) {
|
||||||
if(hasRight){
|
if (hasRight) {
|
||||||
if (verified && isAdmin) {
|
if (verified && isAdmin) {
|
||||||
return (
|
return (
|
||||||
<SystemCard ecId={`${this && this.props && this.props.ecId || ''}_SystemCard@vmf9rw`} {...this.props} id={this.props.params.hrmId}/>
|
<SystemCard ecId={`${this && this.props && this.props.ecId || ''}_SystemCard@vmf9rw`} {...this.props} id={this.props.params.hrmId} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (verified && !isAdmin) {
|
if (verified && !isAdmin) {
|
||||||
const avatarProps = {userId};
|
const avatarProps = { userId };
|
||||||
if(info.requestParams) Object.assign(avatarProps, {requestParams: JSON.parse(info.requestParams)});
|
if (info.requestParams) Object.assign(avatarProps, { requestParams: JSON.parse(info.requestParams) });
|
||||||
return (
|
return (
|
||||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@uojsrt`} datas={rightMenu} >
|
<WeaLeftRightLayout
|
||||||
<div style={{height:'100%'}}>
|
isNew={true}
|
||||||
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@kadp5g`} />
|
leftWidth={96}
|
||||||
<div className='hrm-my-card' style={{height:"100%",background: '#ffff'}}>
|
leftCom={<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9d23zw`}
|
||||||
<div className="hrm-my-card-top-wapper" style={{minHeight: 60}}>
|
type='line'
|
||||||
{
|
keyParam='key'
|
||||||
!isEmpty(info) && <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@rwtu3g`} className={"hrm-my-card-top"}>
|
datas={toJS(tabInfo)}
|
||||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@lq1pi0`} span="24" className='hrm-my-card-top-title' style={{paddingLeft:14,paddingTop:7,height:'100%'}}>
|
selectedKey={tabKey}
|
||||||
|
onChange={v => {
|
||||||
|
this.tabsOnChange(v);
|
||||||
|
}}
|
||||||
|
tabPosition="left"
|
||||||
|
/>}
|
||||||
|
>
|
||||||
|
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@uojsrt`} datas={rightMenu} >
|
||||||
|
<div style={{ height: '100%' }}>
|
||||||
|
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@kadp5g`} />
|
||||||
|
<div className='hrm-my-card' style={{ height: "100%", background: '#ffff' }}>
|
||||||
|
<div className="hrm-my-card-top-wapper" style={{ minHeight: 60 }}>
|
||||||
{
|
{
|
||||||
info.shortname != null && info.shortname.trim().length > 0 ?
|
!isEmpty(info) && <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@rwtu3g`} className={"hrm-my-card-top"}>
|
||||||
<div className='hrm-my-card-top-title-img hrm-my-card-top-title-shortname' onClick={showPortraitSetting}>{info.shortname}</div>
|
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@lq1pi0`} span="24" className='hrm-my-card-top-title' style={{ paddingLeft: 14, paddingTop: 7, height: '100%' }}>
|
||||||
:
|
{
|
||||||
<span style={{paddingLeft:10,paddingRight:14, display:'inline-block'}}>
|
info.shortname != null && info.shortname.trim().length > 0 ?
|
||||||
{/* <img className='hrm-my-card-top-title-img' src={info.messagerurl || portraitDefalut} alt="" onClick={showPortraitSetting}/> */}
|
<div className='hrm-my-card-top-title-img hrm-my-card-top-title-shortname' onClick={showPortraitSetting}>{info.shortname}</div>
|
||||||
<span className='hrm-my-card-top-avatar' style={{top: '-2px'}} onClick={showPortraitSetting}>
|
:
|
||||||
<WeaAvatar ecId={`${this && this.props && this.props.ecId || ''}_WeaAvatar@m37dbo`}
|
<span style={{ paddingLeft: 10, paddingRight: 14, display: 'inline-block' }}>
|
||||||
// userId={userId}
|
{/* <img className='hrm-my-card-top-title-img' src={info.messagerurl || portraitDefalut} alt="" onClick={showPortraitSetting}/> */}
|
||||||
{...avatarProps}
|
<span className='hrm-my-card-top-avatar' style={{ top: '-2px' }} onClick={showPortraitSetting}>
|
||||||
ref={result => {
|
<WeaAvatar ecId={`${this && this.props && this.props.ecId || ''}_WeaAvatar@m37dbo`}
|
||||||
if(updateSuccess && result) {
|
// userId={userId}
|
||||||
result.requestParams && result.requestParams(userId);
|
{...avatarProps}
|
||||||
setState({updateSuccess: false});
|
ref={result => {
|
||||||
|
if (updateSuccess && result) {
|
||||||
|
result.requestParams && result.requestParams(userId);
|
||||||
|
setState({ updateSuccess: false });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
<span style={{ display: 'inline-block', verticalAlign: 'top' }} className='hrm-my-card-top-title-info'>
|
||||||
|
<div style={{ fontSize: 14 }}>
|
||||||
|
<span style={{ paddingRight: 5 }}>{info.lastname} {
|
||||||
|
info.workcode ?
|
||||||
|
(
|
||||||
|
<span>({info.workcode.indexOf('desensitization__') > -1 ? <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@m09slu`} value={info.workcode} viewArre={1} /> : info.workcode})</span>
|
||||||
|
)
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}</span>
|
||||||
|
{
|
||||||
|
info.sex && <span className={info.sex.value == '1' ? 'icon-coms-women femaleColor' : 'icon-coms-men maleColor'} title={info.sex.name}></span>
|
||||||
}
|
}
|
||||||
}}
|
</div>
|
||||||
/>
|
{
|
||||||
</span>
|
info.orginfo ?
|
||||||
</span>
|
<div className='orgInfo'
|
||||||
|
dangerouslySetInnerHTML={{ __html: info.orginfo }} />
|
||||||
|
:
|
||||||
|
<div className='orgInfo'>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
}
|
}
|
||||||
<span style={{display:'inline-block',verticalAlign:'top'}} className='hrm-my-card-top-title-info'>
|
<TopButton ecId={`${this && this.props && this.props.ecId || ''}_TopButton@br79o7`}
|
||||||
<div style={{fontSize:14}}>
|
buttons={hrmCard.topButtons && hrmCard.topButtons()}
|
||||||
<span style={{paddingRight:5}}>{info.lastname} {
|
buttonSpace={10}
|
||||||
info.workcode ?
|
showDropIcon={hrmCard.topShowDropIcon}
|
||||||
(
|
dropMenuDatas={hrmCard.topRightMenus && hrmCard.topRightMenus()}
|
||||||
<span>({info.workcode.indexOf('desensitization__') > -1 ? <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@m09slu`} value={info.workcode} viewArre={1} /> : info.workcode})</span>
|
/>
|
||||||
)
|
</div>
|
||||||
:
|
|
||||||
null
|
{this.getTabChildren()}
|
||||||
}</span>
|
</div>
|
||||||
{
|
{uploadPortrailAuth && <PortraitSetting ecId={`${this && this.props && this.props.ecId || ''}_PortraitSetting@vck80h`} store={hrmCard} />}
|
||||||
info.sex && <span className={info.sex.value=='1'?'icon-coms-women femaleColor':'icon-coms-men maleColor'} title={info.sex.name}></span>
|
</div>
|
||||||
}
|
</WeaRightMenu>
|
||||||
</div>
|
</WeaLeftRightLayout>
|
||||||
{
|
|
||||||
info.orginfo ?
|
|
||||||
<div className='orgInfo'
|
|
||||||
dangerouslySetInnerHTML={{__html:info.orginfo}} />
|
|
||||||
:
|
|
||||||
<div className = 'orgInfo'>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
}
|
|
||||||
<TopButton ecId={`${this && this.props && this.props.ecId || ''}_TopButton@br79o7`}
|
|
||||||
buttons={hrmCard.topButtons && hrmCard.topButtons()}
|
|
||||||
buttonSpace={10}
|
|
||||||
showDropIcon={hrmCard.topShowDropIcon}
|
|
||||||
dropMenuDatas={hrmCard.topRightMenus && hrmCard.topRightMenus()}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9d23zw`}
|
|
||||||
type='editable-inline'
|
|
||||||
keyParam='key'
|
|
||||||
datas={toJS(tabInfo)}
|
|
||||||
selectedKey={tabKey}
|
|
||||||
onChange={ v => {
|
|
||||||
this.tabsOnChange(v);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{this.getTabChildren()}
|
|
||||||
</div>
|
|
||||||
{uploadPortrailAuth && <PortraitSetting ecId={`${this && this.props && this.props.ecId || ''}_PortraitSetting@vck80h`} store={hrmCard}/>}
|
|
||||||
</div>
|
|
||||||
</WeaRightMenu>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@a7bbha`} >
|
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@a7bbha`} >
|
||||||
<div style={{color : '#000'}}>
|
<div style={{ color: '#000' }}>
|
||||||
{i18n.message.authFailed()}
|
{i18n.message.authFailed()}
|
||||||
</div>
|
</div>
|
||||||
</WeaAlertPage>
|
</WeaAlertPage>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -265,7 +275,7 @@ class Main extends React.Component {
|
||||||
const {
|
const {
|
||||||
hrmCard
|
hrmCard
|
||||||
} = this.props;
|
} = this.props;
|
||||||
this.setState({rightMenu: []})
|
this.setState({ rightMenu: [] })
|
||||||
hrmCard.setTopButtons(null);
|
hrmCard.setTopButtons(null);
|
||||||
hrmCard.setTopRightMenus(null);
|
hrmCard.setTopRightMenus(null);
|
||||||
hrmCard.setTopShowDropIcon(false);
|
hrmCard.setTopShowDropIcon(false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue