This commit is contained in:
Chengliang 2023-09-26 16:24:49 +08:00
parent 13c662be09
commit 3c950521a2
1 changed files with 109 additions and 99 deletions

View File

@ -14,7 +14,8 @@ import {
WeaTab,
WeaNewScroll,
WeaAlertPage,
WeaAvatar
WeaAvatar,
WeaLeftRightLayout
} from 'ecCom'
import isEmpty from 'lodash/isEmpty'
import * as mobx from 'mobx';
@ -33,8 +34,10 @@ import {
WeaPopoverHrm
} from 'ecCom';
import TopButton from '../../coms/topButton';
import {i18n} from '../../public/i18n';
import {addContentPath} from '../../util/index.js'
import { i18n } from '../../public/i18n';
import { addContentPath } from '../../util/index.js'
const TabPane = Tabs.TabPane;
const { ua } = WeaTools;
const isIE9 = ua.browser === "IE"
@ -48,7 +51,7 @@ class Main extends React.Component {
constructor(props) {
super(props);
this.state = {
weaWorkplanLoaded:false,
weaWorkplanLoaded: false,
rightMenu: []
}
}
@ -65,9 +68,9 @@ class Main extends React.Component {
componentWillMount() {
// 异步加载日程模块静态资源
eventRegister.loadModule('f_workplan', ()=> {
this.setState({weaWorkplanLoaded:true});
}, ()=> {});
eventRegister.loadModule('f_workplan', () => {
this.setState({ weaWorkplanLoaded: true });
}, () => { });
}
componentDidMount() {
@ -93,7 +96,7 @@ class Main extends React.Component {
});
}
setParentRightMenu = rightMenu => this.setState({rightMenu})
setParentRightMenu = rightMenu => this.setState({ rightMenu })
getTabChildren() {
const {
@ -115,22 +118,22 @@ class Main extends React.Component {
if (tabKey === t.key) {
if (t.isIframe) {
isIframe = true;
if(t.key == 'iframe-9-workplansearch'){ // 日程模块加载方式
if (t.key == 'iframe-9-workplansearch') { // 日程模块加载方式
const selectedUser = t.url.split('?')[1].split('&')[1].split('=')[1];
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'}}}/>
:
''
}else{
ifame = <iframe className="card-iframe" style={{height:window.innerHeight-175}} src={addContentPath(t.url)}></iframe>
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 {
ifame = <iframe className="card-iframe" style={{ height: window.innerHeight - 175 }} src={addContentPath(t.url)}></iframe>
}
}
}
});
return (
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@4jxjh8`} className={innerPage?'hrm-card-hastop' : 'hrm-card-notop'}>
{isIframe ? ifame : children}
</WeaNewScroll>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@4jxjh8`} className={innerPage ? 'hrm-card-hastop' : 'hrm-card-notop'}>
{isIframe ? ifame : children}
</WeaNewScroll>
);
}
render() {
@ -161,100 +164,107 @@ class Main extends React.Component {
}
}
if (verified) {
if(hasRight){
if (hasRight) {
if (verified && isAdmin) {
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) {
const avatarProps = {userId};
if(info.requestParams) Object.assign(avatarProps, {requestParams: JSON.parse(info.requestParams)});
const avatarProps = { userId };
if (info.requestParams) Object.assign(avatarProps, { requestParams: JSON.parse(info.requestParams) });
return (
<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}}>
{
!isEmpty(info) && <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@rwtu3g`} className={"hrm-my-card-top"}>
<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%'}}>
<WeaLeftRightLayout
isNew={true}
leftWidth={96}
leftCom={<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9d23zw`}
type='line'
keyParam='key'
datas={toJS(tabInfo)}
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 ?
<div className='hrm-my-card-top-title-img hrm-my-card-top-title-shortname' onClick={showPortraitSetting}>{info.shortname}</div>
:
<span style={{paddingLeft:10,paddingRight:14, display:'inline-block'}}>
{/* <img className='hrm-my-card-top-title-img' src={info.messagerurl || portraitDefalut} alt="" onClick={showPortraitSetting}/> */}
<span className='hrm-my-card-top-avatar' style={{top: '-2px'}} onClick={showPortraitSetting}>
<WeaAvatar ecId={`${this && this.props && this.props.ecId || ''}_WeaAvatar@m37dbo`}
// userId={userId}
{...avatarProps}
ref={result => {
if(updateSuccess && result) {
result.requestParams && result.requestParams(userId);
setState({updateSuccess: false});
!isEmpty(info) && <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@rwtu3g`} className={"hrm-my-card-top"}>
<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%' }}>
{
info.shortname != null && info.shortname.trim().length > 0 ?
<div className='hrm-my-card-top-title-img hrm-my-card-top-title-shortname' onClick={showPortraitSetting}>{info.shortname}</div>
:
<span style={{ paddingLeft: 10, paddingRight: 14, display: 'inline-block' }}>
{/* <img className='hrm-my-card-top-title-img' src={info.messagerurl || portraitDefalut} alt="" onClick={showPortraitSetting}/> */}
<span className='hrm-my-card-top-avatar' style={{ top: '-2px' }} onClick={showPortraitSetting}>
<WeaAvatar ecId={`${this && this.props && this.props.ecId || ''}_WeaAvatar@m37dbo`}
// userId={userId}
{...avatarProps}
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>
}
}}
/>
</span>
</span>
</div>
{
info.orginfo ?
<div className='orgInfo'
dangerouslySetInnerHTML={{ __html: info.orginfo }} />
:
<div className='orgInfo'>
&nbsp;
</div>
}
</span>
</Col>
</Row>
}
<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>
{
info.orginfo ?
<div className='orgInfo'
dangerouslySetInnerHTML={{__html:info.orginfo}} />
:
<div className = 'orgInfo'>
&nbsp;
</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>
<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>
{this.getTabChildren()}
</div>
{uploadPortrailAuth && <PortraitSetting ecId={`${this && this.props && this.props.ecId || ''}_PortraitSetting@vck80h`} store={hrmCard} />}
</div>
</WeaRightMenu>
</WeaLeftRightLayout>
)
}
}else{
} else {
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@a7bbha`} >
<div style={{color : '#000'}}>
{i18n.message.authFailed()}
<div style={{ color: '#000' }}>
{i18n.message.authFailed()}
</div>
</WeaAlertPage>
</WeaAlertPage>
)
}
}
@ -265,7 +275,7 @@ class Main extends React.Component {
const {
hrmCard
} = this.props;
this.setState({rightMenu: []})
this.setState({ rightMenu: [] })
hrmCard.setTopButtons(null);
hrmCard.setTopRightMenus(null);
hrmCard.setTopShowDropIcon(false);