king
2022-04-25 9e716f3bd30820a08757845b592db73363faa48c
src/tabviews/subtable/index.jsx
@@ -319,6 +319,8 @@
        config.setting.selected = 'false'
      } else if (config.setting.selected === 'init' && config.setting.onload === 'false') {
        config.setting.selected = 'false'
      } else {
        config.setting.orisel = true
      }
      if (config.setting.controlField) {
@@ -365,7 +367,7 @@
    }
  }
  
  loadData = () => {
  loadData = (id) => {
    const { mainSearch } = this.props
    const { setting, BID, search, loadCustomApi, hasReqFields } = this.state
@@ -414,10 +416,10 @@
      this.loadOutResource(searches)
      if (setting.execType === 'async') {
        this.loadmaindata()
        this.loadmaindata(id)
      }
    } else {
      this.loadmaindata()
      this.loadmaindata(id)
    }
  }
@@ -591,7 +593,7 @@
  /**
   * @description 子表数据加载
   */
  async loadmaindata () {
  async loadmaindata (id) {
    const { mainSearch } = this.props
    const { setting, BID, arr_field, search, orderBy, pageIndex, pageSize, absFields } = this.state
@@ -617,9 +619,9 @@
        start = pageSize * (pageIndex - 1) + 1
      }
      if (setting.selected !== 'false') {
      if (setting.selected !== 'false' || (setting.orisel && id)) {
        setTimeout(() => {
          MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID)
          MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID, id)
        }, 200)
        if (setting.selected === 'init') {
          this.setState({setting: {...setting, selected: 'false'}})
@@ -827,17 +829,17 @@
  /**
   * @description 表格刷新
   */
  reloadtable = (btn) => {
  reloadtable = (btn, id = '') => {
    if (!btn || btn.resetPageIndex !== 'false') {
      MKEmitter.emit('resetTable', this.props.Tab.uuid) // 列表重置
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadData()
        this.loadData(id)
      })
    } else {
      MKEmitter.emit('resetTable', this.props.Tab.uuid, 'false') // 列表重置
      this.loadData()
      this.loadData(id)
    }
  }
@@ -918,19 +920,19 @@
      if (lines && lines.length === 1) {
        this.loadmainLinedata(lines[0].$$uuid)
      } else {
        this.reloadtable(btn)
        this.reloadtable(btn, id)
      }
    } else if (position === 'grid' || position === 'view') {
      this.reloadtable(btn)
      this.reloadtable(btn, id)
    } else if (position === 'maingrid' || position === 'mainline') {
      this.reloadtable(btn)
      this.reloadtable(btn, id)
      if (Tab.supMenu && BID) {
        MKEmitter.emit('reloadData', Tab.supMenu, BID) // 主表重置
      } else if (!Tab.supMenu && Tab.level === 0 && BID) {
        MKEmitter.emit('reloadData', SupMenuID, BID)   // 树形结构,0级标签
      }
    } else if (position === 'equaltab') {
      this.reloadtable(btn)
      this.reloadtable(btn, id)
      if (Tab.equalTab && Tab.equalTab.length > 0) {
        MKEmitter.emit('reloadData', Tab.equalTab.join(',')) // 同级标签重置
      }