king
2021-01-06 b6ccd63b80fc7017bfabc446787732a98c7cbab7
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -233,6 +233,7 @@
  componentDidMount () {
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('getexceloutparam', this.getexceloutparam)
  }
  /**
@@ -243,6 +244,7 @@
      return
    }
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('getexceloutparam', this.getexceloutparam)
  }
  resetParentParam = (MenuID, id) => {
@@ -254,6 +256,33 @@
        this.loadData()
      })
    }
  }
  /**
   * @description 导出Excel时,获取页面搜索排序等参数
   */
  getexceloutparam = (menuId, btnId) => {
    const { mainSearch } = this.props
    const { arr_field, config, search } = this.state
    if (config.uuid !== menuId) return
    let searches = search ? fromJS(search).toJS() : []
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      let keys = searches.map(item => item.key.toLowerCase())
      mainSearch.forEach(item => {
        if (!keys.includes(item.key.toLowerCase())) {
          searches.push(item)
        }
      })
    }
    MKEmitter.emit('execExcelout', config.uuid, btnId, {
      arr_field: arr_field,
      orderBy: config.setting.order || '',
      search: searches,
      menuName: config.name
    })
  }
  /**
@@ -272,7 +301,7 @@
      return
    }
    let searches = fromJS(search).toJS()
    let searches = search ? fromJS(search).toJS() : []
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      let keys = searches.map(item => item.key)
      mainSearch.forEach(item => {