king
2021-08-24 1a11f7115e61c548f9ffc77d0a9e504307ca71b2
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -138,7 +138,7 @@
   */
  async loadmaindata (reset, repage) {
    const { mainSearch } = this.props
    const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize } = this.state
    const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (setting.supModule && !BID) { // BID 不存在时,不做查询
      this.setState({
@@ -148,6 +148,9 @@
      })
      MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 广播数据切换
      reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置
      if (setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
      }
      return
    }
@@ -188,6 +191,7 @@
          item.key = index
          item.$$uuid = item[setting.primaryKey] || ''
          item.$$BID = BID || ''
          item.$$BData = BData || ''
          item.$Index = start + index + ''
          return item
        }),
@@ -195,6 +199,9 @@
        total: result.total,
        loading: false
      })
      if (setting.$hasSyncModule) {
        MKEmitter.emit('syncBalconyData', config.uuid, [], false)
      }
    } else {
      this.setState({
        loading: false
@@ -212,7 +219,7 @@
   */ 
  async loadmainLinedata (id) {
    const { mainSearch } = this.props
    const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize } = this.state
    const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件
@@ -239,6 +246,7 @@
        let _data = result.data[0] || {}
        _data.$$uuid = _data[setting.primaryKey] || ''
        _data.$$BID = BID || ''
        _data.$$BData = BData || ''
        try {
          data = data.map(item => {
            if (item.$$uuid === _data.$$uuid) {
@@ -489,14 +497,6 @@
    }
  }
  getSyncData = (syncModule, btnId) => {
    const { config, selectedData } = this.state
    if (config.uuid !== syncModule) return
    MKEmitter.emit('triggerBtnId', btnId, (selectedData || []))
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    const { sync, config, BID } = this.state
@@ -527,7 +527,6 @@
  componentDidMount () {
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('getSyncData', this.getSyncData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
@@ -541,7 +540,6 @@
      return
    }
    MKEmitter.removeListener('reloadData', this.reloadData)
    MKEmitter.removeListener('getSyncData', this.getSyncData)
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)