king
2022-10-10 5354b648a9765d8c9ca3f8c7ce065b58c3d55716
src/tabviews/custom/components/interfaces/interItem/index.jsx
@@ -15,6 +15,8 @@
    config: PropTypes.object,  // 配置信息
  }
  loading = false
  state = {}
  componentDidMount () {
@@ -27,6 +29,8 @@
    setTimeout(() => {
      this.loadData()
    }, config.setting.delay)
    MKEmitter.addListener('reloadData', this.reloadData)
  }
  shouldComponentUpdate (nextProps, nextState) { return false }
@@ -39,15 +43,27 @@
      return
    }
    this.timer && this.timer.stop()
    MKEmitter.removeListener('reloadData', this.reloadData)
  }
  reloadData = (publicId) => {
    if (this.props.config.uuid !== publicId) return
    this.loadData()
  }
  async loadData () {
    const { config, BID } = this.props
    if (this.loading) return
    this.loading = true
    let param = UtilsDM.getQueryDataParams(config.setting, config.columns.map(col => col.field).join(','), [], config.setting.order, 1, 1, BID)
    let result = await Api.genericInterface(param)
    if (result.status) {
      this.loading = false
      let _data = { $$empty: true }
      if (result.data && result.data[0]) {
@@ -56,8 +72,11 @@
      
      _data.$$loaded = true
      window.GLOB.CacheData.set(config.uuid, _data)
      MKEmitter.emit('mkPublicData', config.uuid, _data)
    } else {
      this.loading = false
      this.timer && this.timer.stop()
      notification.error({
        top: 92,