king
2024-08-13 7bd04b1c21a59e8d79325f247bdb1726507b51fb
src/tabviews/custom/components/share/normalheader/index.jsx
@@ -9,7 +9,6 @@
class NormalHeader extends Component {
  static propTpyes = {
    BID: PropTypes.any,        // 上级主键值
    menuType: PropTypes.any,   // 菜单类型
    config: PropTypes.object,  // 配置信息
    refresh: PropTypes.func    // 条件刷新
  }
@@ -24,11 +23,18 @@
    this.setState({
      title: config.plot ? config.plot.title : config.wrap.title,
      show: !['normaltable', 'propcard'].includes(config.subtype) && config.search && config.search.length > 0
      show: !['normaltable', 'propcard', 'editable'].includes(config.subtype) && config.search && config.search.length > 0
    })
  }
  shouldComponentUpdate (nextProps, nextState) { return false }
  shouldComponentUpdate (nextProps, nextState) {
    const { config } = this.props
    if (config.checkBid && this.props.BID !== nextProps.BID) {
      return true
    }
    return false
  }
  /**
   * @description 组件销毁,清除state更新,清除快捷键设置
@@ -40,15 +46,15 @@
  }
  render() {
    const { config, menuType, BID } = this.props
    const { config, BID } = this.props
    const { title, show } = this.state
    if (!title && !show) return null
    return (
      <div className="normal-header" style={config.headerStyle}>
      <div className={'normal-header' + (show ? ' header-search' : '')} style={config.headerStyle}>
        <span className="title">{title}</span>
        {show ? <SearchComponent config={config} BID={BID} menuType={menuType} refreshdata={this.props.refresh}/> : null}
        {show ? <SearchComponent config={config} BID={BID} refreshdata={this.props.refresh}/> : null}
      </div>
    )
  }