king
2021-01-07 2292d1826e69e21c8a411c217faef635fe57d458
src/tabviews/subtabtable/index.jsx
@@ -229,9 +229,7 @@
      config.action.forEach(item => {
        item.logLabel = Tab.label + '-' + item.label // 用于sPC_TableData_InUpDe记录操作按钮
        if (item.execMode) {
          item.OpenType = 'funcbutton'
        }
        item.$menuId = this.props.MenuID
        if (item.position === 'toolbar') {
          _actions.push(item)
@@ -526,21 +524,23 @@
  /**
   * @description 导出Excel时,获取页面搜索排序等参数
   */
  getexceloutparam = () => {
    const { Tab, mainSearch } = this.props
  getexceloutparam = (menuId, btnId) => {
    const { Tab, mainSearch, MenuID } = this.props
    const { arr_field, orderBy, search, setting} = this.state
    if (MenuID !== menuId) return
    let searches = search
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      searches = [...mainSearch, ...search]
    }
    return {
    MKEmitter.emit('execExcelout', MenuID, btnId, {
      arr_field: arr_field,
      orderBy: orderBy || setting.order,
      search: searches,
      menuName: Tab.label
    }
    })
  }
  /**
@@ -559,6 +559,10 @@
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  componentDidMount () {
    MKEmitter.addListener('getexceloutparam', this.getexceloutparam)
  }
  /**
   * @description 组件销毁,清除state更新
   */
@@ -566,6 +570,7 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('getexceloutparam', this.getexceloutparam)
  }
  render() {
@@ -602,7 +607,6 @@
                      selectedData={selectedData}
                      MenuID={this.props.SupMenuID}
                      refreshdata={this.refreshbyaction}
                      getexceloutparam={this.getexceloutparam}
                    />
                  </div>
                  <SubTable