king
2020-02-21 063b983daaf51a7f1e8677bde1e9c0e618866c91
src/tabviews/formtab/index.jsx
@@ -258,9 +258,16 @@
   * @description 主表数据加载
   */ 
  async loadmaindata () {
    const { setting } = this.state
    const { setting, BIDs } = this.state
    if (setting.datatype !== 'query') return
    if (setting.datatype !== 'query') {
      notification.warning({
        top: 92,
        message: '未设置数据查询配置!',
        duration: 10
      })
      return
    }
    let param = null
@@ -285,6 +292,7 @@
        data: _data,
        primaryId: _primaryId,
        BIDs: {
          ...BIDs,
          mainTable: _primaryId,
          mainTabledata: _data
        }
@@ -376,13 +384,31 @@
  /**
   * @description 按钮操作完成后(成功或失败),页面刷新,重置页码及选择项
   */
  refreshbyaction = (btn, type, primaryId) => {
  refreshbyaction = (btn, type, primaryId, formdata) => {
    const { BIDs } = this.state
    if (type === 'success' && btn.afterExecSuccess === 'notclose') {
      this.setState({
        primaryId: primaryId
      }, () => {
        if (btn.execSuccess === 'refresh') {
          this.loadmaindata()
        } else {
          let data = {}
          if (formdata && formdata.length > 0) {
            formdata.forEach(item => {
              data[item.key] = item.value
            })
          }
          this.setState({
            BIDs: {
              ...BIDs,
              mainTable: primaryId,
              mainTabledata: data
            }
          })
        }
      })
    } else if (type === 'success' && btn.afterExecSuccess === 'close') {
@@ -536,8 +562,7 @@
            refreshdata={this.refreshbyaction}
          /> : null
        }
        {setting && setting.onload !== 'false' &&
          config.tabgroups.map(group => {
        {!loadingview && !viewlost && config.tabgroups.map(group => {
            if (config[group].length === 0) return null
            return (