king
2023-06-15 7bba7b209c0637d7afff05953a4b0563db0e9bdc
src/tabviews/zshare/topSearch/index.jsx
@@ -25,9 +25,7 @@
class MainSearch extends Component {
  static propTpyes = {
    BID: PropTypes.any,          // 父级Id,用于查询下拉选择项
    searchlist: PropTypes.array, // 搜索条件列表
    config: PropTypes.object,    // 组件配置信息(自定义页面)
    setting: PropTypes.object,   // 组件配置信息(自定义页面)
    refreshdata: PropTypes.func  // 刷新数据
  }
@@ -43,7 +41,7 @@
  sign = ''
  UNSAFE_componentWillMount () {
    const { config, searchlist, setting } = this.props
    const { config } = this.props
    let _searchlist = []
    let fieldMap = new Map()
@@ -56,43 +54,29 @@
    let hasReqFields = false
    let forbid = false // header中不设置高级搜索
    let _setting = {showAdv: false, show: false}
    let _setting = {showAdv: false, show: false, style: null}
    
    if (setting) {
      _setting.show = setting.show !== 'false'
      _setting.float = setting.float || 'left'
      _setting.advanceType = setting.advanceType || 'modal'
      _setting.advWidth = setting.advanceWidth || 1000
      _setting.placement = setting.drawerPlacement || 'right'
      _setting.ratio = setting.searchRatio || 6
      _setting.labelwidth = setting.searchLwidth !== undefined ? setting.searchLwidth : 33.3
    if (config.wrap) {
      _setting.show = config.wrap.show !== 'false'
      _setting.advanceType = config.wrap.advanceType || 'modal'
      _setting.advWidth = config.wrap.advanceWidth || 1000
      _setting.placement = config.wrap.drawerPlacement || 'right'
      _setting.ratio = config.wrap.searchRatio || 6
      _setting.labelwidth = config.wrap.searchLwidth !== undefined ? config.wrap.searchLwidth : 33.3
      _setting.labelCol = {style: {width: _setting.labelwidth + '%'}}
      _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}}
      _setting.style = null
    } else if (config) {
      if (config.wrap) {
        _setting.show = config.wrap.show !== 'false'
        _setting.advanceType = config.wrap.advanceType || 'modal'
        _setting.advWidth = config.wrap.advanceWidth || 1000
        _setting.placement = config.wrap.drawerPlacement || 'right'
        _setting.ratio = config.wrap.searchRatio || 6
        _setting.labelwidth = config.wrap.searchLwidth !== undefined ? config.wrap.searchLwidth : 33.3
        _setting.labelCol = {style: {width: _setting.labelwidth + '%'}}
        _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}}
        _setting.borderRadius = config.wrap.borderRadius
      }
      _setting.style = null
      if (config.type === 'search') {
        _setting.float = config.wrap.float || 'left'
        _setting.style = config.style
      } else if (config.type === 'table') {
        _setting.float = 'left'
      } else {
        _setting.float = 'right'
        _setting.show = false
        forbid = true
      }
      _setting.borderRadius = config.wrap.borderRadius
    }
    if (config.type === 'search') {
      _setting.float = config.wrap.float || 'left'
      _setting.style = config.style
    } else if (config.type === 'table') {
      _setting.float = 'left'
    } else {
      _setting.float = 'right'
      _setting.show = false
      forbid = true
    }
    if (_setting.advanceType === 'drawer' && _setting.advWidth) {
@@ -110,11 +94,7 @@
      }
    }
    if (searchlist) {
      _searchlist = fromJS(searchlist).toJS()
    } else if (config) {
      _searchlist = fromJS(config.search).toJS()
    }
    _searchlist = fromJS(config.search).toJS()
    _searchlist.forEach(item => {
      if (item.linkField) {