king
2024-08-13 7bd04b1c21a59e8d79325f247bdb1726507b51fb
2024-08-13
8个文件已修改
710 ■■■■■ 已修改文件
src/menu/components/share/actioncomponent/actionform/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/base-table/options.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 169 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/double-data-card/index.jsx 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/normalTable/index.jsx 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/base-table/index.jsx 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/index.jsx 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -233,7 +233,7 @@
      if (this.record.openmenu && this.record.openmenu !== 'goback') {
        shows.push('open')
      }
      if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) {
      if (['grid'].includes(this.record.execSuccess) || ['grid'].includes(this.record.execError)) {
        shows.push('resetPageIndex')
      }
@@ -305,7 +305,7 @@
      if (this.record.execSuccess === 'goback') {
        shows.push('reload')
      }
      if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) {
      if (['grid'].includes(this.record.execSuccess) || ['grid'].includes(this.record.execError)) {
        shows.push('resetPageIndex')
      }
@@ -352,7 +352,7 @@
      } else {
        shows.push('database')
      }
      if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) {
      if (['grid'].includes(this.record.execSuccess) || ['grid'].includes(this.record.execError)) {
        shows.push('resetPageIndex')
      }
    } else if (openType === 'excelOut') {
@@ -389,7 +389,7 @@
      } else {
        shows.push('database')
      }
      if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) {
      if (['grid'].includes(this.record.execSuccess) || ['grid'].includes(this.record.execError)) {
        shows.push('resetPageIndex')
      }
      if (this.record.Ot !== 'notRequired' && appType === 'mob') {
@@ -485,7 +485,7 @@
          shows.push('innerFunc', 'extraParam')
          reRequired.innerFunc = true
        }
        if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) {
        if (['grid'].includes(this.record.execSuccess) || ['grid'].includes(this.record.execError)) {
          shows.push('resetPageIndex')
        }
        if (this.record.execMode === 'pop' || this.record.execMode === 'prompt') {
src/menu/components/table/base-table/options.jsx
@@ -88,19 +88,6 @@
        {value: 'small', label: '小'},
      ],
    },
    // {
    //   type: 'radio',
    //   field: 'selected',
    //   label: '首行选中',
    //   initval: wrap.selected || 'false',
    //   tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。',
    //   required: false,
    //   options: [
    //     {value: 'false', label: '无'},
    //     {value: 'init', label: '初始化'},
    //     {value: 'always', label: '数据加载'},
    //   ]
    // },
    {
      type: 'radio',
      field: 'tableMode',
src/tabviews/custom/components/card/data-card/index.jsx
@@ -410,9 +410,7 @@
    if (config.$searchId !== searchId) return
    
    this.setState({pageIndex: 1}, () => {
      this.loadData()
    })
    this.reloadIndex()
  }
  /**
@@ -426,6 +424,7 @@
    if (config.uuid !== menuId) return
    let _id = config.wrap.selected === 'always' ? id : ''
    if (config.supNodes) {
      if (['mainline', 'maingrid', 'popclose'].includes(position)) {
        let supNode = this.supModules[this.supModules.length - 1]
@@ -439,43 +438,41 @@
          }, i * 10)
        })
      } else {
        if ((position === 'line' || position === 'line_grid') && lines && lines.length === 1 && !config.forbidLine) {
          this.loadLinedata(lines[0].$$uuid, position)
        } else if (btn.resetPageIndex !== 'false') {
          this.setState({
            pageIndex: 1
          }, () => {
            this.loadData(id)
          })
        if (position === 'line' || position === 'line_grid') {
          if (lines && lines.length === 1) {
            if (config.forbidLine) {
              this.loadData(lines[0].$$uuid, 'repage')
        } else {
          this.loadData(id)
              this.loadLinedata(lines[0].$$uuid, position)
            }
          } else {
            this.loadData(_id, 'repage')
          }
        } else if (btn.resetPageIndex !== 'false') {
          this.reloadIndex()
        } else {
          this.loadData(_id, 'repage')
        }
      }
    } else {
      let supModule = config.setting.supModule
      if (position === 'line' || position === 'line_grid') {
        if (lines && lines.length === 1 && !config.forbidLine) {
          this.loadLinedata(lines[0].$$uuid, position)
        } else if (btn.resetPageIndex !== 'false') {
          this.setState({
            pageIndex: 1
          }, () => {
            this.loadData(id)
          })
        if (lines && lines.length === 1) {
          if (config.forbidLine) {
            this.loadData(lines[0].$$uuid, 'repage')
        } else {
          this.loadData(id)
            this.loadLinedata(lines[0].$$uuid, position)
          }
        } else {
          this.loadData(_id, 'repage')
        }
      } else if (['mainline', 'maingrid', 'popclose'].includes(position) && supModule) {
        MKEmitter.emit('reloadData', supModule, position === 'maingrid' ? '' : BID)
      } else if (btn.resetPageIndex !== 'false') {
        this.setState({
          pageIndex: 1
        }, () => {
          this.loadData(id)
        })
        this.reloadIndex()
      } else {
        this.loadData(id)
        this.loadData(_id, 'repage')
      }
    }
  }
@@ -497,13 +494,21 @@
    })
  }
  reloadIndex = () => {
    this.setState({
      pageIndex: 1
    }, () => {
      this.loadData()
    })
  }
  prevCheck = (id) => {
    const { selected } = this.state
    if (selected === 'false' && !id) return
    setTimeout(() => {
      this.checkTopLine(id)
      this.checkTopLine(id, selected)
    }, 10)
    if (selected === 'init') {
@@ -511,10 +516,39 @@
    }
  }
  checkTopLine = (id) => {
    const { config, data, selected } = this.state
  checkTopLine = (id, selected) => {
    const { config, data } = this.state
    if (data.length === 0) {
    let index = -1
    let keys = []
    let items = []
    if (data.length > 0) {
      if (id) {
        index = data.findIndex(item => item.$$uuid === id && !item.$disabled)
      }
      if (index !== -1) {
        keys = [index]
        items = [data[index]]
      } else if (selected === 'sign') {
        data.forEach((item, i) => {
          if (!item.$disabled && item.selected === 'true') {
            items.push(item)
            keys.push(i)
            index = i
          }
        })
      } else if (selected !== 'false') {
        if (!data[0].$disabled) {
          index = 0
          keys = [index]
          items = [data[index]]
        }
      }
    }
    if (index === -1) {
      this.setState({
        activeKey: '',
        selectKeys: [],
@@ -528,19 +562,7 @@
      return
    }
    if (selected === 'sign') {
      let index = ''
      let keys = []
      let items = []
      let last = ''
      data.forEach((item, i) => {
        if (!item.$disabled && item.selected === 'true') {
          items.push(item)
          keys.push(i)
          index = i
          last = item
        }
      })
    let item = items[items.length - 1]
      this.setState({
        activeKey: index,
@@ -548,44 +570,9 @@
        selectedData: items
      })
  
      MKEmitter.emit('resetSelectLine', config.uuid, last ? last.$$uuid : '', last)
    MKEmitter.emit('resetSelectLine', config.uuid, item.$$uuid, item)
      if (config.setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', config.uuid, items, data.length === keys.length)
      }
      return
    }
    let index = 0
    if (id) {
      index = data.findIndex(item => item.$$uuid === id)
      if (index === -1) {
        index = 0
      }
    }
    if (data[index].$disabled) {
      this.setState({
        activeKey: '',
        selectKeys: [],
        selectedData: []
      })
      MKEmitter.emit('resetSelectLine', config.uuid, '', '')
      if (config.setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
      }
      return
    }
    this.setState({
      activeKey: index,
      selectKeys: [index],
      selectedData: [data[index]]
    })
    MKEmitter.emit('resetSelectLine', config.uuid, data[index].$$uuid, data[index])
    if (config.setting.$hasSyncModule) {
      MKEmitter.emit('syncBalconyData', config.uuid, [data[index]], data.length === 1)
    }
  }
@@ -683,7 +670,9 @@
    if (config.uuid !== menuId) return
    if (!id) {
      this.loadData()
      this.reloadIndex()
    } else if (config.forbidLine) {
      this.loadData(id, 'repage')
    } else {
      this.loadLinedata(id)
    }
@@ -806,6 +795,11 @@
    if (result.status) {
      if (result.$requestId && this.requestId !== result.$requestId) return
      if (type === 'repage' && result.data.length === 0 && pageIndex > 1) {
        this.reloadIndex()
        return
      }
      let start = 1
      if (config.setting.laypage) {
        start = pageSize * (pageIndex - 1) + 1
@@ -816,7 +810,7 @@
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (selected !== 'false' || (id && config.wrap.selected !== 'false')) {
      if (selected !== 'false' || id) {
        this.prevCheck(id)
      } else {
        MKEmitter.emit('resetSelectLine', config.uuid, '', '')
@@ -904,15 +898,6 @@
  async loadLinedata (id, position) {
    const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
    if (config.forbidLine) {
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadData()
      })
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
@@ -934,7 +919,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadData()
        this.reloadIndex()
        return
      }
src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -358,9 +358,7 @@
    if (config.$searchId !== searchId) return
    
    this.setState({pageIndex: 1}, () => {
      this.loadData()
    })
    this.reloadIndex()
  }
  /**
@@ -373,28 +371,23 @@
    let supModule = config.setting.supModule
    let _id = config.wrap.selected === 'always' ? id : ''
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1 && !config.forbidLine) {
        this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid, position)
      } else if (btn.resetPageIndex !== 'false') {
        this.setState({
          pageIndex: 1
        }, () => {
          this.loadData(id)
        })
      if (lines && lines.length === 1) {
        if (config.forbidLine) {
          this.loadData(lines[0].$$parentId || lines[0].$$uuid, 'repage')
      } else {
        this.loadData(id)
          this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid, position)
        }
      } else {
        this.loadData(_id, 'repage')
      }
    } else if (['mainline', 'maingrid', 'popclose'].includes(position) && supModule) {
      MKEmitter.emit('reloadData', supModule, position === 'maingrid' ? '' : BID)
    } else if (btn.resetPageIndex !== 'false') {
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadData(id)
      })
      this.reloadIndex()
    } else {
      this.loadData(id)
      this.loadData(_id, 'repage')
    }
  }
@@ -420,11 +413,40 @@
    })
  }
  checkTopLine = (id) => {
    const { config, data, selected, card } = this.state
  checkTopLine = (id, selected) => {
    const { config, data, card } = this.state
    let _opens = [...this.state.opens]
    if (data.length === 0) {
    let index = -1
    let keys = []
    let items = []
    if (data.length > 0) {
      if (id) {
        index = data.findIndex(item => item.$$uuid === id && !item.$disabled)
      }
      if (index !== -1) {
        keys = [index]
        items = [data[index]]
      } else if (selected === 'sign') {
        data.forEach((item, i) => {
          if (!item.$disabled && item.selected === 'true') {
            items.push(item)
            keys.push(i)
            index = i
          }
        })
      } else if (selected !== 'false') {
        if (!data[0].$disabled) {
          index = 0
          keys = [index]
          items = [data[index]]
        }
      }
    }
    if (index === -1) {
      this.setState({
        activeKey: '',
        selectKeys: [],
@@ -435,28 +457,11 @@
      return
    }
    if (selected === 'sign') {
      let index = ''
      let keys = []
      let items = []
      let last = ''
      if (card.setting.display === 'collapse') {
        _opens = []
      _opens = keys
      }
      data.forEach((item, i) => {
        if (!item.$disabled && item.selected === 'true') {
          items.push(item)
          keys.push(i)
          index = i
          last = item
          if (card.setting.display === 'collapse') {
            _opens.push(i)
          }
        }
      })
    let item = items[items.length - 1]
      this.setState({
        opens: _opens,
@@ -465,41 +470,7 @@
        selectedData: items
      })
  
      MKEmitter.emit('resetSelectLine', config.uuid, last ? last.$$uuid : '', last)
      return
    }
    let index = 0
    if (id) {
      index = data.findIndex(item => item.$$uuid === id)
      if (index === -1) {
        index = 0
      }
    }
    if (data[index].$disabled) {
      this.setState({
        activeKey: '',
        selectKeys: [],
        selectedData: []
      })
      MKEmitter.emit('resetSelectLine', config.uuid, '', '')
      return
    }
    if (card.setting.display === 'collapse') {
      _opens = [index]
    }
    this.setState({
      opens: _opens,
      activeKey: index,
      selectKeys: [index],
      selectedData: [data[index]]
    })
    MKEmitter.emit('resetSelectLine', config.uuid, data[index].$$uuid, data[index])
    MKEmitter.emit('resetSelectLine', config.uuid, item.$$uuid, item)
  }
  checkAll = () => {
@@ -547,7 +518,9 @@
    if (config.uuid !== menuId) return
    if (!id) {
      this.loadData()
      this.reloadIndex()
    } else if (config.forbidLine) {
      this.loadData(id, 'repage')
    } else {
      this.loadLinedata(id)
    }
@@ -643,6 +616,11 @@
    if (result.status) {
      if (result.$requestId && this.requestId !== result.$requestId) return
      if (type === 'repage' && result.data.length === 0 && pageIndex > 1) {
        this.reloadIndex()
        return
      }
      let start = 1
      if (config.setting.laypage) {
        start = pageSize * (pageIndex - 1) + 1
@@ -653,13 +631,10 @@
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (selected !== 'false' || (id && config.wrap.selected !== 'false')) {
      if (selected !== 'false' || id) {
        setTimeout(() => {
          this.checkTopLine(id)
          this.checkTopLine(id, selected)
        }, 10)
        if (selected === 'init') {
          this.setState({selected: 'false'})
        }
      } else {
        MKEmitter.emit('resetSelectLine', config.uuid, '', '')
      }
@@ -769,6 +744,10 @@
        loading: false
      })
      if (selected === 'init') {
        this.setState({selected: 'false'})
      }
      if (config.timer && config.clearField && result.data && result.data[0]) {
        let vals = (config.clearValue || '').split(',')
        if (vals.includes(result.data[0][config.clearField])) {
@@ -793,15 +772,6 @@
  async loadLinedata (id, position) {
    const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
    if (config.forbidLine) {
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadData()
      })
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
@@ -823,7 +793,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadData()
        this.reloadIndex()
        return
      }
@@ -946,6 +916,14 @@
    }
  }
  reloadIndex = () => {
    this.setState({
      pageIndex: 1
    }, () => {
      this.loadData()
    })
  }
  loadMore = () => {
    const { total, pageIndex, pageSize, loading } = this.state
src/tabviews/custom/components/share/normalTable/index.jsx
@@ -811,15 +811,27 @@
    this.props.refreshdata({pageIndex})
  }
  mkCheckTopLine = (menuId, id, type) => {
  mkCheckTopLine = (menuId, id, selected) => {
    const { MenuID, data, setting } = this.props
    if (MenuID !== menuId || !data || data.length === 0) return
    if (MenuID !== menuId) return
    if (!data || data.length === 0) {
      MKEmitter.emit('resetSelectLine', menuId, '', '')
      return
    }
    if (type === 'sign') {
      let index = ''
    let index = -1
      let keys = []
      let items = []
    if (id) {
      index = data.findIndex(item => item.$$uuid === id && !item.$disabled)
    }
    if (index !== -1) {
      keys = [index]
      items = [data[index]]
    } else if (selected === 'sign') {
      data.forEach((item, i) => {
        if (!item.$disabled && item.selected === 'true') {
          items.push(item)
@@ -827,6 +839,18 @@
          index = i
        }
      })
    } else if (selected !== 'false') {
      if (!data[0].$disabled) {
        index = 0
        keys = [index]
        items = [data[index]]
      }
    }
    if (index === -1) {
      MKEmitter.emit('resetSelectLine', menuId, '', '')
      return
    }
  
      this.changedata(index)
      this.setState({ selectedRowKeys: keys, activeIndex: index })
@@ -834,26 +858,6 @@
      if (setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', MenuID, items, data.length === keys.length)
      }
      return
    }
    let index = 0
    if (id) {
      index = data.findIndex(item => item.$$uuid === id)
      if (index === -1) {
        index = 0
      }
    }
    if (data[index].$disabled) return
    this.changedata(index)
    this.setState({ selectedRowKeys: [index], activeIndex: index })
    this.props.chgSelectData([data[index]])
    if (setting.$hasSyncModule) {
      MKEmitter.emit('syncBalconyData', MenuID, [data[index]], data.length === 1)
    }
  }
@@ -1028,22 +1032,9 @@
      if (setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', MenuID, selects, data.length === selects.length)
      }
    } else if (type === 'false') {
      this.setState({
        selectedRowKeys: [],
        activeIndex: null,
        pickup: false
      })
    } else if (type === 'repage') {
      this.setState({
        pageIndex: Index,
        selectedRowKeys: [],
        activeIndex: null,
        pickup: false
      })
    } else {
      this.setState({
        pageIndex: 1,
        pageIndex: type === 'false' ? this.state.pageIndex : 1,
        selectedRowKeys: [],
        activeIndex: null,
        pickup: false
src/tabviews/custom/components/table/base-table/index.jsx
@@ -67,8 +67,6 @@
    if (setting.selected !== 'always' && setting.selected !== 'init' && setting.selected !== 'sign') {
      setting.selected = 'false'
    } else {
      setting.orisel = true
    }
    _config.style = _config.style || {}
@@ -85,7 +83,7 @@
    }, () => {
      if (_config.setting.onload === 'true') {
        setTimeout(() => {
          this.loadmaindata()
          this.loadData()
          this.getStatFieldsValue()
        }, _config.setting.delay || 0)
      }
@@ -94,10 +92,8 @@
  /**
   * @description 主表数据加载
   * @param { Boolean } reset  表格是否重置
   * @param { String }  repage 表格是否重置页码
   */
  async loadmaindata (reset, repage, id) {
  async loadData (reset, repage, id) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (setting.supModule && !BID) { // BID 不存在时,不做查询
@@ -110,9 +106,6 @@
      
      MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换
      reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 列表重置
      // if (setting.$hasSyncModule) {
      //   MKEmitter.emit('syncBalconyData', config.uuid, [], false)
      // }
      this.requestId = ''
      return
@@ -147,38 +140,12 @@
    if (result.status) {
      if (result.$requestId && this.requestId !== result.$requestId) return
      if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) {
        let _pageIndex = Math.ceil(result.total / pageSize)
        if (_pageIndex < pageIndex) {
          MKEmitter.emit('resetTable', config.uuid, 'repage', _pageIndex)
          this.setState({
            pageIndex: _pageIndex,
            data: [],
            selectedData: [],
            total: result.total
          }, () => {
            this.loadmaindata()
          })
      if (repage === 'false' && result.data.length === 0 && pageIndex > 1) {
        this.reloadIndex()
          return
        }
      }
      if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) {
        setTimeout(() => {
          MKEmitter.emit('mkCheckTopLine', config.uuid, id, setting.selected)
        }, 200)
        if (setting.selected === 'init') {
          this.setState({setting: {...setting, selected: 'false'}})
        }
      } else {
        MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换
        // if (setting.$hasSyncModule) {
        //   MKEmitter.emit('syncBalconyData', config.uuid, [], false)
        // }
      }
      reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置
      reset && MKEmitter.emit('resetTable', config.uuid, repage || '') // 列表重置
      let start = 1
      if (setting.laypage) {
@@ -214,12 +181,24 @@
        total = data[data.length - 1].mk_total || 0
      }
      if (data.length && (id || setting.selected !== 'false')) {
        setTimeout(() => {
          MKEmitter.emit('mkCheckTopLine', config.uuid, id, setting.selected)
        }, 200)
      } else {
        MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换
      }
      this.setState({
        data: data,
        selectedData: [],
        total: total,
        loading: false
      })
      if (setting.selected === 'init') {
        this.setState({setting: {...setting, selected: 'false'}})
      }
      if (config.autoMatic) {
        if (result.data && result.data.length > 0) {
@@ -249,11 +228,6 @@
  async loadLinedata (id, position) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
      this.reloadtable()
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
@@ -275,7 +249,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadmaindata(true, 'false')
        this.reloadIndex()
        return
      }
@@ -463,7 +437,7 @@
      pageIndex: 1,
      search: searches
    }, () => {
      this.loadmaindata(true, 'true')
      this.loadData(true, 'true')
      this.getStatFieldsValue()
    })
@@ -481,7 +455,7 @@
      this.setState({
        pageIndex: pagination.pageIndex
      }, () => {
        this.loadmaindata()
        this.loadData()
      })
    } else {
      if (sorter.order) {
@@ -497,25 +471,8 @@
        pageSize: pagination.pageSize,
        orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : ''
      }, () => {
        this.loadmaindata()
        this.loadData()
      })
    }
  }
  /**
   * @description 表格刷新
   */
  reloadtable = (btn, id) => {
    if (!btn || btn.resetPageIndex !== 'false') {
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadmaindata(true, 'true', id)
        this.getStatFieldsValue()
      })
    } else {
      this.loadmaindata(true, 'false', id)
      this.getStatFieldsValue()
    }
  }
@@ -550,7 +507,10 @@
    if (config.uuid !== menuId) return
    if (!id) {
      this.reloadtable()
      this.reloadIndex()
    } else if (config.forbidLine) {
      this.loadData(true, 'false', id)
      this.getStatFieldsValue()
    } else {
      this.loadLinedata(id)
    }
@@ -567,7 +527,7 @@
        BData: data
      }, () => {
        if (!setting.checkBid) {
          this.loadmaindata(true, 'true')
          this.loadData(true, 'true')
          this.getStatFieldsValue()
        }
      })
@@ -576,25 +536,32 @@
  /**
   * @description 按钮执行完成后页面刷新
   * @param {*} menuId     // 菜单Id
   * @param {*} position   // 刷新位置
   * @param {*} btn        // 执行的按钮
   */
  refreshByButtonResult = (menuId, position, btn, id, lines) => {
    const { config, BID } = this.state
    if (config.uuid !== menuId) return
    let _id = config.wrap.selected === 'always' ? (id || '') : ''
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1 && !config.forbidLine) {
        this.loadLinedata(lines[0].$$uuid, position)
      if (lines && lines.length === 1) {
        if (config.forbidLine) {
          this.loadData(true, 'false', lines[0].$$uuid)
          this.getStatFieldsValue()
      } else {
        this.reloadtable(btn, id)
          this.loadLinedata(lines[0].$$uuid, position)
        }
      } else {
        this.loadData(true, 'false', _id)
        this.getStatFieldsValue()
      }
    } else if (['mainline', 'maingrid', 'popclose'].includes(position) && config.setting.supModule) {
      MKEmitter.emit('reloadData', config.setting.supModule, position === 'maingrid' ? '' : BID)
    } else if (btn.resetPageIndex !== 'false') {
      this.reloadIndex()
    } else {
      this.reloadtable(btn, id)
      this.loadData(true, 'false', _id)
      this.getStatFieldsValue()
    }
  }
@@ -603,7 +570,16 @@
    if (config.$searchId !== searchId) return
    
    this.reloadtable()
    this.reloadIndex()
  }
  reloadIndex = () => {
    this.setState({
      pageIndex: 1
    }, () => {
      this.loadData(true, 'true')
      this.getStatFieldsValue()
    })
  }
  autoExec = (times) => {
src/tabviews/custom/components/table/edit-table/index.jsx
@@ -225,7 +225,7 @@
    }, () => {
      if (_config.setting.onload === 'true') {
        setTimeout(() => {
          this.loadmaindata()
          this.loadData()
        }, _config.setting.delay || 0)
      }
    })
@@ -421,10 +421,8 @@
  /**
   * @description 主表数据加载
   * @param { Boolean } reset  表格是否重置
   * @param { String }  repage 表格是否重置页码
   */
  async loadmaindata (reset, repage) {
  async loadData (reset, repage) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (setting.supModule && !BID) { // BID 不存在时,不做查询
@@ -531,11 +529,6 @@
  async loadLinedata (id, position) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
      this.reloadtable()
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
@@ -557,7 +550,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadmaindata(true, 'false')
        this.reloadIndex()
        return
      }
@@ -652,7 +645,7 @@
      pageIndex: 1,
      search: searches
    }, () => {
      this.loadmaindata(true, 'true')
      this.loadData(true, 'true')
    })
  }
@@ -673,23 +666,19 @@
      pageSize: pagination.pageSize,
      orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : ''
    }, () => {
      this.loadmaindata()
      this.loadData()
    })
  }
  /**
   * @description 表格刷新
   */
  reloadtable = (btn) => {
    if (!btn || btn.resetPageIndex !== 'false') {
  reloadIndex = () => {
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadmaindata(true, 'true')
      this.loadData(true, 'true')
      })
    } else {
      this.loadmaindata(true, 'false')
    }
  }
  /**
@@ -723,7 +712,9 @@
    if (config.uuid !== menuId) return
    if (!id) {
      this.reloadtable()
      this.reloadIndex()
    } else if (config.forbidLine) {
      this.loadData(true, 'false')
    } else {
      this.loadLinedata(id)
    }
@@ -745,7 +736,7 @@
      }, () => {
        if (!setting.checkBid) {
          setTimeout(() => {
            this.loadmaindata(true, 'true')
            this.loadData(true, 'true')
          }, setting.delay || 0)
        }
      })
@@ -764,15 +755,21 @@
    if (config.uuid !== menuId) return
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1 && !config.forbidLine) {
        this.loadLinedata(lines[0].$$uuid, position)
      if (lines && lines.length === 1) {
        if (config.forbidLine) {
          this.loadData(true, 'false')
      } else {
        this.reloadtable(btn)
          this.loadLinedata(lines[0].$$uuid, position)
        }
      } else {
        this.loadData(true, 'false')
      }
    } else if (['mainline', 'maingrid', 'popclose'].includes(position) && config.setting.supModule) {
      MKEmitter.emit('reloadData', config.setting.supModule, position === 'maingrid' ? '' : BID)
    } else if (btn.resetPageIndex !== 'false') {
      this.reloadIndex()
    } else {
      this.reloadtable(btn)
      this.loadData(true, 'false')
    }
  }
@@ -805,7 +802,7 @@
    if (config.$searchId !== searchId) return
    
    this.reloadtable()
    this.reloadIndex()
  }
  shouldComponentUpdate (nextProps, nextState) {
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -79,8 +79,6 @@
    if (setting.selected !== 'always' && setting.selected !== 'init' && setting.selected !== 'sign') {
      setting.selected = 'false'
    } else {
      setting.orisel = true
    }
    if (_config.setting.sync === 'true') {
@@ -200,7 +198,7 @@
        this.setState({
          pageIndex: 1
        }, () => {
          this.loadmaindata(true, 'true', '', 'timer')
          this.loadData(true, 'true', '', 'timer')
        })
      })
    }
@@ -237,7 +235,7 @@
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadmaindata(false, 'true', '', 'init')
                this.loadData(false, 'true', '', 'init')
              }, config.setting.delay || 0)
            }
  
@@ -299,13 +297,13 @@
        if (config.setting.onload === 'true') {
          setTimeout(() => {
            this.loadmaindata(false, 'true', '', 'init')
            this.loadData(false, 'true', '', 'init')
          }, config.setting.delay || 0)
        }
      }
    } else if (config.setting.onload === 'true') {
      setTimeout(() => {
        this.loadmaindata()
        this.loadData()
      }, config.setting.delay || 0)
    }
  }
@@ -511,10 +509,8 @@
  /**
   * @description 主表数据加载
   * @param { Boolean } reset  表格是否重置
   * @param { String }  repage 表格是否重置页码
   */
  async loadmaindata (reset, repage, id, type) {
  async loadData (reset, repage, id, type) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (setting.supModule && !BID && setting.supKey !== 'false') { // BID 不存在时,不做查询
@@ -575,35 +571,9 @@
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) {
        let _pageIndex = Math.ceil(result.total / pageSize)
        if (_pageIndex < pageIndex) {
          MKEmitter.emit('resetTable', config.uuid, 'repage', _pageIndex)
          this.setState({
            pageIndex: _pageIndex,
            data: [],
            selectedData: [],
            total: result.total
          }, () => {
            this.loadmaindata()
          })
      if (repage === 'false' && result.data.length === 0 && pageIndex > 1) {
        this.reloadIndex()
          return
        }
      }
      if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) {
        setTimeout(() => {
          MKEmitter.emit('mkCheckTopLine', config.uuid, id, setting.selected)
        }, 200)
        if (setting.selected === 'init') {
          this.setState({setting: {...setting, selected: 'false'}})
        }
      } else {
        MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换
        if (setting.$hasSyncModule) {
          MKEmitter.emit('syncBalconyData', config.uuid, [], false)
        }
      }
      
      reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置
@@ -649,6 +619,17 @@
        allSearch.push(...searches)
      }
      if (data.length && (id || setting.selected !== 'false')) {
        setTimeout(() => {
          MKEmitter.emit('mkCheckTopLine', config.uuid, id, setting.selected)
        }, 200)
      } else {
        MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换
        if (setting.$hasSyncModule) {
          MKEmitter.emit('syncBalconyData', config.uuid, [], false)
        }
      }
      this.setState({
        data: data,
        selectedData: [],
@@ -656,6 +637,10 @@
        total: total,
        loading: false
      })
      if (setting.selected === 'init') {
        this.setState({setting: {...setting, selected: 'false'}})
      }
      if (config.$hasTopModule) {
        window.GLOB.CacheData.set(config.uuid + 'tb', data[0] || { $$empty: true, $$uuid: '' })
@@ -686,11 +671,6 @@
  async loadLinedata (id, position) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
      this.reloadtable()
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
@@ -712,7 +692,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadmaindata(true, 'false')
        this.reloadIndex()
        return
      }
      
@@ -836,7 +816,7 @@
      pageIndex: 1,
      search: searches
    }, () => {
      this.loadmaindata(true, 'true')
      this.loadData(true, 'true')
    })
  }
@@ -857,23 +837,19 @@
      pageSize: pagination.pageSize,
      orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : ''
    }, () => {
      this.loadmaindata()
      this.loadData()
    })
  }
  /**
   * @description 表格刷新
   */
  reloadtable = (btn, id) => {
    if (!btn || btn.resetPageIndex !== 'false') {
  reloadIndex = () => {
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadmaindata(true, 'true', id)
      this.loadData(true, 'true')
      })
    } else {
      this.loadmaindata(true, 'false', id)
    }
  }
  /**
@@ -907,7 +883,9 @@
    if (config.uuid !== menuId) return
    if (!id) {
      this.reloadtable()
      this.reloadIndex()
    } else if (config.forbidLine) {
      this.loadData(true, 'false', id)
    } else {
      this.loadLinedata(id)
    }
@@ -932,7 +910,7 @@
      if (bid !== this.state.BID || bid !== '') {
        this.setState({ BID: bid, BData: _data, pageIndex: 1 }, () => {
          this.loadmaindata(true, 'true')
          this.loadData(true, 'true')
        })
      }
    } else {
@@ -948,7 +926,7 @@
          BData: data
        }, () => {
          if (!setting.checkBid) {
            this.loadmaindata(true, 'true')
            this.loadData(true, 'true')
          }
        })
      }
@@ -957,15 +935,13 @@
  /**
   * @description 按钮执行完成后页面刷新
   * @param {*} menuId     // 菜单Id
   * @param {*} position   // 刷新位置
   * @param {*} btn        // 执行的按钮
   */
  refreshByButtonResult = (menuId, position, btn, id, lines) => {
    const { config, BID } = this.state
    if (config.uuid !== menuId) return
    let _id = config.wrap.selected === 'always' ? (id || '') : ''
    if (config.supNodes) {
      if (['mainline', 'maingrid', 'popclose'].includes(position)) {
        let supNode = this.supModules[this.supModules.length - 1]
@@ -980,26 +956,38 @@
        })
      } else {
        if (position === 'line' || position === 'line_grid') {
          if (lines && lines.length === 1 && !config.forbidLine) {
            this.loadLinedata(lines[0].$$uuid, position)
          if (lines && lines.length === 1) {
            if (config.forbidLine) {
              this.loadData(true, 'false', lines[0].$$uuid)
          } else {
            this.reloadtable(btn, id)
              this.loadLinedata(lines[0].$$uuid, position)
          }
        } else {
          this.reloadtable(btn, id)
            this.loadData(true, 'false', _id)
          }
        } else if (btn.resetPageIndex !== 'false') {
          this.reloadIndex()
        } else {
          this.loadData(true, 'false', _id)
        }
      }
    } else {
      if (position === 'line' || position === 'line_grid') {
        if (lines && lines.length === 1 && !config.forbidLine) {
          this.loadLinedata(lines[0].$$uuid, position)
        if (lines && lines.length === 1) {
          if (config.forbidLine) {
            this.loadData(true, 'false', lines[0].$$uuid)
        } else {
          this.reloadtable(btn, id)
            this.loadLinedata(lines[0].$$uuid, position)
          }
        } else {
          this.loadData(true, 'false', _id)
        }
      } else if (['mainline', 'maingrid', 'popclose'].includes(position) && config.setting.supModule) {
        MKEmitter.emit('reloadData', config.setting.supModule, position === 'maingrid' ? '' : BID)
      } else if (btn.resetPageIndex !== 'false') {
        this.reloadIndex()
      } else {
        this.reloadtable(btn, id)
        this.loadData(true, 'false', _id)
      }
    }
  }
@@ -1033,7 +1021,7 @@
    if (config.$searchId !== searchId) return
    
    this.reloadtable()
    this.reloadIndex()
  }
  render() {