king
2021-04-13 e0aff8f4c0e9c8f16d1ba07863cf600638067514
src/menu/components/share/normalheader/index.jsx
@@ -5,6 +5,7 @@
import asyncComponent from '@/utils/asyncComponent'
import MKEmitter from '@/utils/events.js'
import { resetStyle } from '@/utils/utils-custom.js'
import './index.scss'
const SearchComponent = asyncComponent(() => import('@/menu/components/share/searchcomponent'))
@@ -12,6 +13,7 @@
class NormalHeader extends Component {
  static propTpyes = {
    defaultshow: PropTypes.any,      // 标题与搜索条件不存在时隐藏
    hideSearch: PropTypes.any,       // 隐藏搜索条件
    config: PropTypes.object,        // 配置信息
    updateComponent: PropTypes.func  // 配置更新
  }
@@ -51,7 +53,7 @@
  }
  render() {
    const { config, defaultshow } = this.props
    const { config, defaultshow, hideSearch } = this.props
    let title = config.plot ? config.plot.title : config.wrap.title
    let show = true
@@ -60,9 +62,10 @@
        show = false
      }
    }
    let _style = resetStyle(config.headerStyle)
    return (
      <div className={'normal-header' + (!show ? ' hidden' : '')} style={config.headerStyle}>
      <div className={'normal-header' + (!show ? ' hidden' : '')} style={_style}>
        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
          <div className="mk-popover-control">
            <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" />
@@ -70,7 +73,7 @@
        } trigger="hover">
          <span className="title">{title}</span>
        </Popover>
        {config.search ? <SearchComponent config={config} updatesearch={this.props.updateComponent}/> : null}
        {hideSearch !== 'true' && config.search ? <SearchComponent config={config} updatesearch={this.props.updateComponent}/> : null}
      </div>
    )
  }