import React from 'react'; import {inject, observer} from 'mobx-react'; import {toJS} from 'mobx'; import {Spin, Pagination} from 'antd'; import {WeaNewScroll, WeaDialog, WeaTools, WeaAvatar, WeaInput, WeaCustomNew } from 'ecCom'; const { sendMsg } = WeaTools; const Base64 = ecCom.WeaTools.Base64; import {WeaLocaleProvider} from 'ecCom'; const getLabel = WeaLocaleProvider.getLabel; // import Apps from 'weaSmallApp'; // const AppCom = Apps.com; // const SendSms = AppCom.SendSms; // // import Workplan from 'weaWorkplan'; // const WorkPlanCreate = Workplan.com.WorkPlanCreate; const store = [ 'weesoSeachSetStore', 'weesoStore', 'routing' ]; @inject(...store) @observer export default class CommonContent extends React.Component { constructor(props) { super(props); this.state = { smsVisible: false, workPlanVisible: false, id: '', } } componentDidMount() { const { getAdConditions } = this.props.weesoSeachSetStore; let pageuuid = this.props.routing&&this.props.routing.location&&this.props.routing.location.query&&this.props.routing.location.query.page_uuid; const { getBaseData, setUrlParams } = this.props.weesoStore; let urlParms = this.props.routing && this.props.routing.location && this.props.routing.location.query; urlParms = toJS(urlParms); if(pageuuid) { setUrlParams(urlParms,() => { getBaseData(undefined, undefined, undefined, pageuuid, () => { if(pageuuid !== 'FULLSEARCH') { let p = { page_uuid: pageuuid, }; getAdConditions(p); } }); }); } else { setUrlParams(urlParms,() => { getBaseData(); }); } if (!window.weaWorkplan) { eventRegister.loadModule('f_workplan', ()=>{ this.props.weesoStore.setWPLoaded(true) }, ()=>{}) } else { this.props.weesoStore.setWPLoaded(true) } if (!window.weaSmallApp) { eventRegister.loadModule('f_smallApp', ()=>{ this.props.weesoStore.setSMLoaded(true) }, ()=>{}) } else { this.props.weesoStore.setSMLoaded(true) } } render() { const {weesoStore, topTabHeight} = this.props; let {searchResult, emptyResult, page, searchDatas, supportSkipSearch, addSubdomainUrl, defalutMoreKey} = weesoStore; searchDatas = toJS(searchDatas); let maxPerPage = searchDatas.maxPerPage || '', recordCount = searchDatas.recordCount || ''; let paginationProps = supportSkipSearch ? { showQuickJumper: true, showTotal: total => getLabel('514163','共${num}页').replace('${num}', Math.ceil(total/maxPerPage)), } : { className: "esearch-pagination-customize", }; const hidesearch = this.props.hidesearch || '0'; let topStyle = {}; if (hidesearch === '1') { topStyle = { paddingTop: '10px', paddingLeft:'10px'}; } if(topTabHeight === 'h-85') { topStyle = { ...topStyle, paddingTop: 88, // 85+3 } } return (
{defalutMoreKey === 'customOdoc'?
: {emptyResult ?
:
{ searchResult && searchResult.length != 0 && searchResult.map((item,index) => { if (item.schema == 'ROBOT') { return (
) } else if (item.schema == 'RSC') { return (
{item && item.head && item.head.id != '' ? : }

{this.getHrmNameContent(item,weesoStore,index)} {item.head.gender}

{ item.foot && item.foot.info && item.foot.info.length != 0 && item.foot.info.map(i => { return (

{i.key}:

{ i.value && (i.value.indexOf('desensitization__') > -1 || i.value.indexOf('encryption__') > -1) ? () : i.value }

) } ) }
{this.getCommonComtent(item.head)}
) } else { const other = item.other ? JSON.parse(item.other) : undefined; return ( } } {this.props.weesoStore.wpLoaded && window.weaWorkplan && window.weaWorkplan.com && window.weaWorkplan.com.WorkPlanCreate && {this.setState({workPlanVisible: false})}} onlyClose={() => {this.setState({workPlanVisible: false})}} isCustom={true} selectUser={this.state.id} createConditionParams={[]} /> } {this.setState({smsVisible: false})}} > {this.props.weesoStore.smLoaded && window.weaSmallApp && window.weaSmallApp.com && window.weaSmallApp.com.SendSms && }
) } //用户使用习惯记录 userHabitCollect = (link, index) => { const {weesoStore} = this.props; weesoStore.userDatas.push({ type: 'eventTrack', key: weesoStore.inputValue, contentType: weesoStore.defaultKey, page: weesoStore.page, searchType: weesoStore.defalutMoreKey, sortField: weesoStore.sortValue, timeStamp: String(new Date().getTime()), index: String(index), eventUrl: link }) } getHrmNameContent=(item,weesoStore,index)=>{ if(item.head.titlelink&&item.head.titlelink!=''){ return( {this.userHabitCollect(item.head.titlelink,index)}} > ); }else{ return( ); } } getCommonComtent = (chooseValues) => { const { addSubdomainUrl } = this.props.weesoStore; return (
{ (chooseValues.hideMessage==undefined||chooseValues.hideMessage!='1')&& sendMsg(chooseValues && chooseValues.id, 0, '', '')}> } { (chooseValues.hideSms==undefined||chooseValues.hideSms!='1')&& {this.setState({smsVisible: true, id: chooseValues.id})}}> } { (chooseValues.hideEmail==undefined||chooseValues.hideEmail!='1')&& window.open(`${addSubdomainUrl('/spa/email/static/index.html#/main/email/new?isInternal=1&internalto=')}${chooseValues && chooseValues.id}`)}> } { (chooseValues.hideWorkPlan==undefined||chooseValues.hideWorkPlan!='1')&& {this.setState({workPlanVisible: true, id: chooseValues.id})}}> }
) } }