From 3c950521a2846dde6738739aa5e735e97d2eb642 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 26 Sep 2023 16:24:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrm/components/card/index.js | 208 ++++++++++++++------------- 1 file changed, 109 insertions(+), 99 deletions(-) diff --git a/pc4mobx/hrm/components/card/index.js b/pc4mobx/hrm/components/card/index.js index 00aefe5..48dec8f 100644 --- a/pc4mobx/hrm/components/card/index.js +++ b/pc4mobx/hrm/components/card/index.js @@ -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 = - : - '' - }else{ - ifame = + ifame = + : + '' + } else { + ifame = } } } }); return ( - - {isIframe ? ifame : children} - + + {isIframe ? ifame : children} + ); } render() { @@ -161,100 +164,107 @@ class Main extends React.Component { } } if (verified) { - if(hasRight){ + if (hasRight) { if (verified && isAdmin) { return ( - + ) } 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 ( - -
- -
-
- { - !isEmpty(info) && - + { + this.tabsOnChange(v); + }} + tabPosition="left" + />} + > + +
+ +
+
{ - info.shortname != null && info.shortname.trim().length > 0 ? -
{info.shortname}
- : - - {/* */} - - { - if(updateSuccess && result) { - result.requestParams && result.requestParams(userId); - setState({updateSuccess: false}); + !isEmpty(info) && + + { + info.shortname != null && info.shortname.trim().length > 0 ? +
{info.shortname}
+ : + + {/* */} + + { + if (updateSuccess && result) { + result.requestParams && result.requestParams(userId); + setState({ updateSuccess: false }); + } + }} + /> + + + } + +
+ {info.lastname} { + info.workcode ? + ( + ({info.workcode.indexOf('desensitization__') > -1 ? : info.workcode}) + ) + : + null + } + { + info.sex && } - }} - /> - - +
+ { + info.orginfo ? +
+ : +
+   +
+ } + + + } - -
- {info.lastname} { - info.workcode ? - ( - ({info.workcode.indexOf('desensitization__') > -1 ? : info.workcode}) - ) - : - null - } - { - info.sex && - } -
- { - info.orginfo ? -
- : -
-   -
- } - - - - } - -
- { - this.tabsOnChange(v); - }} - /> - {this.getTabChildren()} -
- {uploadPortrailAuth && } -
- + +
+ + {this.getTabChildren()} +
+ {uploadPortrailAuth && } +
+ + ) } - }else{ + } else { return ( -
- {i18n.message.authFailed()} +
+ {i18n.message.authFailed()}
- + ) } } @@ -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);