weaver_trunk_cli/pc4mobx/esearch/components/childComponents/Adlink.js

50 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import {inject, observer} from 'mobx-react';
import {Icon} from 'antd';
import {toJS} from 'mobx';
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
@inject('weesoStore','routing')
@observer
export default class AboutBrowser extends React.Component {
render() {
const {weesoStore, routing} = this.props;
let {contentType, defalutMoreKey, inputValue} = weesoStore;
contentType = toJS(contentType);
if(!contentType || contentType.length === 0){//undified页面会有哥0
return null
}
return (
<div>
{
contentType.map(item => {
if (item.adlink && item.key == weesoStore.defalutMoreKey && window.doThemeAction) {
// 单页不存在window.doThemeAction不显示转到其他模块
return (
<span
className="weeso-cursor result-link"
title={getLabel(384215,'点击进入原搜索界面,进行详细搜索')}
onClick={() => {
if(defalutMoreKey == 'DOC'){
routing.push('/main/document/search?viewcondition=2&docsubject='+inputValue);
}else {
window.doThemeAction('onQuickSearch', {
from: 'fullSearch',
type: item.linktype,
value: weesoStore.inputValue
})
}
}}
>
{getLabel(128861, `${getLabel(23162,'转到')}${item.name}${getLabel(384217,'模块搜索')}`)}&nbsp;
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@ix0tfe@${item.key}`} type="double-right"/>
</span>
)
}
})
}
</div>
)
}
}