king
2023-10-24 c81296b147b3b6e578a241e21bae7bded4b5f6c6
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -38,7 +38,8 @@
    pageSize: 10,         // 每页数据条数
    orderBy: '',          // 排序
    search: '',           // 搜索条件数组,使用时需分场景处理
    statFValue: []        // 合计值
    statFValue: [],       // 合计值
    allSearch: null
  }
  loaded = false
@@ -138,6 +139,18 @@
    _config.style = _config.style || {}
    let allSearch = null
    if (_config.colsCtrls && _config.colsCtrls.length > 0) {
      allSearch = [{key: 'BID', value: BID || ''}]
      allSearch.push(..._config.$searches)
      if (_config.setting.useMSearch) {
        let mainSearch = window.GLOB.SearchBox.get(_config.$searchId) || []
        allSearch.push(...mainSearch)
      }
    } else {
      _config.colsCtrls = null
    }
    this.setState({
      pageSize: setting.pageSize || 10,
      BID: BID || '',
@@ -148,7 +161,8 @@
      setting: setting,
      actions: _config.action,
      columns: _config.cols,
      search: _config.$searches
      search: _config.$searches,
      allSearch
    })
  }
@@ -467,9 +481,16 @@
        total = data[data.length - 1].mk_total || 0
      }
      let allSearch = null
      if (config.colsCtrls) {
        allSearch = [{key: 'BID', value: BID || ''}]
        allSearch.push(...searches)
      }
      this.setState({
        data: data,
        selectedData: [],
        allSearch: allSearch,
        total: total,
        loading: false
      })
@@ -801,7 +822,7 @@
  }
  render() {
    const { BID, setting, actions, config, columns, selectedData, BData, data } = this.state
    const { BID, setting, actions, config, columns, selectedData, BData, data, allSearch } = this.state
    let style = {...config.style}
    if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) {
@@ -825,9 +846,11 @@
          setting={setting}
          columns={columns}
          MenuID={config.uuid}
          allSearch={allSearch}
          data={this.state.data}
          fields={config.columns}
          total={this.state.total}
          colsCtrls={config.colsCtrls}
          lineMarks={config.lineMarks}
          loading={this.state.loading}
          refreshdata={this.refreshbytable}