king
2020-04-29 9b6ce1a5778c6e1a813237e87588c0052aae1bbb
src/tabviews/subtable/index.jsx
@@ -31,6 +31,7 @@
    BData: PropTypes.any,            // 上级数据
    MenuID: PropTypes.string,        // 菜单Id
    SupMenuID: PropTypes.string,     // 上级菜单Id
    mainSearch: PropTypes.any,       // 主表搜索条件
    ContainerId: PropTypes.any,      // 三级菜单Container(html) ID
    handleTableId: PropTypes.func,   // 控制表格数据切换时,更新在主表中的id
    handleMainTable: PropTypes.func, // 刷新主表
@@ -81,6 +82,10 @@
      this.setState({
        triggerBtn: trigger
      })
    } else if (!this.props.Tab.supMenu && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
      this.setState({}, () => {
        this.loadmaindata()
      })
    }
  }
@@ -170,6 +175,7 @@
        config.action = config.action.map(item => {
          if (userConfig.action[item.uuid]) {
            delete userConfig.action[item.uuid].label
            item = {...item, ...userConfig.action[item.uuid]}
          }
@@ -265,6 +271,7 @@
      if (userConfig) {
        _columns = _columns.map(item => {
          if (userConfig.columns[item.uuid]) {
            delete userConfig.columns[item.uuid].label
            item = {...item, ...userConfig.columns[item.uuid]}
          }
@@ -298,10 +305,12 @@
        loadingview: false,
        viewlost: true
      })
      let prex = Tab && Tab.label ? Tab.label + ': ' : ''
      notification.warning({
        top: 92,
        message: result.message,
        duration: 10
        message: prex + result.message,
        duration: 5
      })
    }
  }
@@ -349,10 +358,12 @@
        })
        deffers.push(defer)
      } else if (item.resourceType === '1' && !item.dataSource) {
        let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
        notification.warning({
          top: 92,
          message: item.label + ': ' + this.state.dict['main.datasource.settingerror'],
          duration: 10
          message: prex + item.label + ': ' + this.state.dict['main.datasource.settingerror'],
          duration: 5
        })
      }
    })
@@ -384,10 +395,12 @@
            return item
          })
        } else {
          let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
          notification.warning({
            top: 92,
            message: res.search.label + ':' + res.message,
            duration: 10
            message: prex + res.search.label + ':' + res.message,
            duration: 5
          })
        }
      })
@@ -454,10 +467,12 @@
      this.setState({
        loading: false
      })
      let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + ': ' : ''
      notification.error({
        top: 92,
        message: result.message,
        duration: 15
        message: prex + result.message,
        duration: 10
      })
    }
  }
@@ -466,9 +481,15 @@
   * @description 获取用户自定义存储过程传参
   */
  getCustomParam = (BID) => {
    const { mainSearch } = this.props
    const { pageIndex, pageSize, orderBy, search, setting } = this.state
    let _search = Utils.formatCustomMainSearch(search)
    let searches = search
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      searches = [...mainSearch, ...search]
    }
    let _search = Utils.formatCustomMainSearch(searches)
    let param = {
      PageIndex: pageIndex,
@@ -507,9 +528,15 @@
   * @description 获取系统存储过程 sPC_Get_TableData 的参数
   */
  getDefaultParam = (BID) => {
    const { mainSearch } = this.props
    const { arr_field, pageIndex, pageSize, orderBy, search, setting } = this.state
    let _search = Utils.joinMainSearchkey(search)
    let searches = search
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      searches = [...mainSearch, ...search]
    }
    let _search = Utils.joinMainSearchkey(searches)
    _search = _search ? 'where ' + _search : ''
    let param = {
@@ -671,13 +698,18 @@
   * @description 导出Excel时,获取页面搜索排序等参数
   */
  getexceloutparam = () => {
    const { Tab } = this.props
    const { Tab, mainSearch } = this.props
    const { arr_field, orderBy, search, setting} = this.state
    let searches = search
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      searches = [...mainSearch, ...search]
    }
    return {
      arr_field: arr_field,
      orderBy: orderBy || setting.order,
      search: search,
      search: searches,
      menuName: Tab.label
    }
  }
@@ -705,7 +737,6 @@
        data: record
      }
    })
    // this.refs.subButton.actionTrigger(btn, record)
  }
  /**