king
2021-01-08 da7068bd48791cdee966c786ce0dfd46f6e03df9
src/tabviews/subtabtable/index.jsx
@@ -26,15 +26,12 @@
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    // 关闭模态框
  }
  state = {
@@ -66,7 +63,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { permAction, type, Tab } = this.props
    const { permAction, Tab } = this.props
    let param = {
      func: 'sPC_Get_LongParam',
@@ -112,26 +109,15 @@
      // 版本兼容
      config = UtilsUpdate.updateSubTable(config)
      // 仅支持exec、prompt、pop 三种类型按钮
      // 不支持funcbutton、popview 类型按钮
      let labels = []
      if (type === 'calendar') {
        config.action = config.action.filter(item => {
          if (['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType)) return true
      config.action = config.action.filter(item => {
        if (['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut', 'innerpage'].includes(item.OpenType)) return true
          labels.push(item.label)
        labels.push(item.label)
          return false
        })
      } else {
        config.action = config.action.filter(item => {
          if (['exec', 'prompt', 'pop'].includes(item.OpenType)) return true
          labels.push(item.label)
          return false
        })
      }
        return false
      })
      if (window.GLOB.systemType !== 'production' && labels.length > 0) {
        notification.warning({
@@ -370,6 +356,9 @@
            })
          }
          item.key = index
          item.$$uuid = item[setting.primaryKey] || ''
          item.$$BID = BID || ''
          return item
        }),
        total: result.total,
@@ -510,18 +499,6 @@
  }
  /**
   * @description 按钮操作完成后(成功或失败),页面刷新,重置页码及选择项
   */
  refreshbyaction = (position, btn) => {
    if (position === 'grid' || position === 'view' || position === 'maingrid') {
      this.reloadtable(btn)
      this.props.refreshSupView()
    } else if (position === 'trigger') { // 日历子表触发标签点击事件
      this.props.closeModalView && this.props.closeModalView()
    }
  }
  /**
   * @description 导出Excel时,获取页面搜索排序等参数
   */
  getexceloutparam = (menuId, btnId) => {
@@ -544,6 +521,21 @@
  }
  /**
   * @description 按钮执行完成后页面刷新
   * @param {*} menuId     // 菜单Id
   * @param {*} position   // 刷新位置
   * @param {*} btn        // 执行的按钮
   */
  refreshByButtonResult = (menuId, position, btn) => {
    const { MenuID } = this.props
    if (MenuID !== menuId) return
    this.reloadtable(btn)
    MKEmitter.emit('refreshPopButton', this.props.Tab.uuid)
  }
  /**
   * @description 图表视图切换
   */
  changeChart = (uuid) => {
@@ -561,6 +553,7 @@
  componentDidMount () {
    MKEmitter.addListener('getexceloutparam', this.getexceloutparam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
  }
  /**
@@ -571,6 +564,7 @@
      return
    }
    MKEmitter.removeListener('getexceloutparam', this.getexceloutparam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
  }
  render() {
@@ -606,7 +600,6 @@
                      BData={this.props.BData}
                      selectedData={selectedData}
                      MenuID={this.props.SupMenuID}
                      refreshdata={this.refreshbyaction}
                    />
                  </div>
                  <SubTable
@@ -614,7 +607,6 @@
                    setting={setting}
                    columns={columns}
                    pageSize={pageSize}
                    BID={this.props.BID}
                    data={this.state.data}
                    dict={this.state.dict}
                    BData={this.props.BData}
@@ -623,7 +615,6 @@
                    loading={this.state.loading}
                    refreshdata={this.refreshbytable}
                    statFValue={this.state.statFValue}
                    refreshbyaction={this.refreshbyaction}
                    chgSelectData={this.changeSelectedData}
                    handleTableId={() => {}}
                  />
@@ -641,7 +632,6 @@
                    data={this.state.data}
                    BData={this.props.BData}
                    loading={this.state.loading}
                    refreshdata={this.refreshbyaction}
                    handleTableId={() => {}}
                  />
                </Col>