king
2021-06-28 3c26f581cd77bed95cc56464f8424993f3c6b13a
src/tabviews/custom/index.jsx
@@ -191,9 +191,7 @@
        })
      }
      let isEmpty = mainSearch.filter(item => item.required && (!item.value || item.value.length === 0)).length > 0
      config.components = this.formatSetting(config.components, params, mainSearch, inherit, regs, isEmpty)
      config.components = this.formatSetting(config.components, params, mainSearch, inherit, regs)
      this.setState({
        BID: BID,
@@ -715,7 +713,7 @@
  }
  // 格式化默认设置
  formatSetting = (components, params, mainSearch, inherit, regs, isEmpty) => {
  formatSetting = (components, params, mainSearch, inherit, regs) => {
    return components.map(component => {
      if (component.type === 'tabs') {
        component.subtabs = component.subtabs.map(tab => {
@@ -790,21 +788,10 @@
      // dataName 系统生成的数据源名称
      // pageable 是否分页,组件属性,不分页的组件才可以统一查询
      if (component.floor === 1 && component.dataName && (!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true' && component.setting.sync === 'true') {
        if (isEmpty && component.setting.useMSearch) {
          component.setting.sync = 'false'
          component.setting.onload = 'false'
        } else {
          let searchlist = []
          if (component.search && component.search.length > 0) {
            searchlist = Utils.initMainSearch(component.search)
          }
          let _empty = searchlist.filter(item => item.required && (!item.value || item.value.length === 0)).length > 0
          if (_empty) {
            component.setting.sync = 'false'
            component.setting.onload = 'false'
          } else {
            if (component.setting.useMSearch) {
              let keys = searchlist.map(item => item.key)
              mainSearch.forEach(item => {
@@ -813,8 +800,12 @@
                }
              })
            }
        if (searchlist.filter(item => item.required && item.value === '').length > 0) {
          component.setting.sync = 'false'
          component.setting.onload = 'false'
        } else {
            params.push(this.getDefaultParam(component, searchlist))
          }
        }
      } else if (component.floor === 1) {
        component.setting.sync = 'false'
@@ -1083,7 +1074,7 @@
      } else if (item.type === 'search') {
        return (
          <Col span={item.width} key={item.uuid}>
            <MainSearch config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} refreshdata={this.resetSearch} />
            <MainSearch config={item} BID={BID} menuType={menuType} refreshdata={this.resetSearch} />
          </Col>
        )
      } else if (item.type === 'tabs') {