king
2020-08-17 ed818fbca1a913065a6a3c2c767714efe5b18685
src/tabviews/subtabtable/index.jsx
@@ -27,9 +27,11 @@
class SubTabModalTable extends Component {
  static propTpyes = {
    type: PropTypes.any,             // 类型,calendar需特殊处理
    Tab: PropTypes.any,              // 日历标签信息
    BID: PropTypes.string,           // 上级数据ID
    BData: PropTypes.any,            // 上级数据
    MenuID: PropTypes.string,        // 菜单Id
    mainSearch: PropTypes.any,       // 主表搜索条件
    SupMenuID: PropTypes.string,     // 上级菜单Id
    refreshSupView: PropTypes.any,   // 刷新上级菜单
    closeModalView: PropTypes.any    // 关闭模态框
@@ -138,7 +140,7 @@
      // 仅支持exec、prompt、pop 三种类型按钮
      if (type === 'calendar') {
        config.action = config.action.filter(item => ['exec', 'prompt', 'pop', 'tab'].includes(item.OpenType))
        config.action = config.action.filter(item => ['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType))
      } else {
        config.action = config.action.filter(item => ['exec', 'prompt', 'pop'].includes(item.OpenType))
      }
@@ -359,9 +361,15 @@
   * @description 获取用户自定义存储过程传参
   */
  getCustomParam = () => {
    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 = {
      OrderCol: orderBy || setting.order,
@@ -402,9 +410,15 @@
   * @description 获取系统存储过程 sPC_Get_TableData 的参数
   */
  getDefaultParam = () => {
    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 = {
@@ -435,7 +449,7 @@
    let regoptions = null
    if (setting.queryType === 'statistics' || param.custom_script) {
      let allSearch = Utils.getAllSearchOptions(search)
      let allSearch = Utils.getAllSearchOptions(searches)
      regoptions = allSearch.map(item => {
        return {
@@ -589,7 +603,7 @@
   * @description 按钮操作完成后(成功或失败),页面刷新,重置页码及选择项
   */
  refreshbyaction = (position) => {
    if (position === 'grid') {
    if (position === 'grid' || position === 'maingrid') {
      this.reloadtable()
      this.props.refreshSupView()
    } else if (position === 'view') {
@@ -612,6 +626,26 @@
        data: record
      }
    })
  }
  /**
   * @description 导出Excel时,获取页面搜索排序等参数
   */
  getexceloutparam = () => {
    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: searches,
      menuName: Tab.label
    }
  }
  /**
@@ -682,6 +716,7 @@
                      logcolumns={this.state.logcolumns}
                      operations={config.gridBtn.operations || []}
                      refreshdata={this.refreshbyaction}
                      getexceloutparam={this.getexceloutparam}
                    />
                  </div>
                  <SubTable