king
2020-01-19 b35e3f0bacdbadf5823e06fe8dc6e047089aae38
src/tabviews/subtable/index.jsx
@@ -65,7 +65,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { permAction } = this.props
    const { permAction, Tab, BID } = this.props
    let param = {
      func: 'sPC_Get_LongParam',
@@ -159,11 +159,16 @@
        actions: _actions,
        columns: _columns,
        arr_field: _arrField.join(','),
        search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化)
        loading: true
        search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化)
      }, () => {
        this.improveSearch()
        if (config.setting.onload !== 'false' && (!Tab.supMenu || BID)) { // 初始化可加载
          this.setState({
            loading: true
          })
        this.loadmaindata()
        }
      })
    } else {
      this.setState({
@@ -364,6 +369,22 @@
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
    if (setting.queryType === 'statistics') { // 统计数据源,内容替换
      let fieldmap = new Map()
      search.forEach(item => {
        let _field = item.key
        if (fieldmap.has(_field)) {
          _field = _field + '1'
        }
        fieldmap.set(item.key, true)
        let reg = new RegExp('@' + _field, 'ig')
        _dataresource = _dataresource.replace(reg, `'${item.value}'`)
      })
    }
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
@@ -612,6 +633,7 @@
            type="sub"
            setting={setting}
            actions={actions}
            Tab={this.props.Tab}
            BID={this.props.BID}
            dict={this.state.dict}
            MenuID={this.props.SupMenuID}