king
2024-02-03 06a670976e2145a10ea05207041d3cf3164cd380
src/tabviews/custom/components/card/data-card/index.jsx
@@ -154,6 +154,10 @@
        pageOptions.push(size)
        pageOptions = pageOptions.sort((a, b) => a - b)
      }
      if (_config.wrap.maxPageSize) {
        pageOptions = pageOptions.filter(item => item <= _config.wrap.maxPageSize)
      }
    }
    let _data = []
@@ -236,6 +240,8 @@
    }
    this.initExec()
    this.autoExec()
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -327,6 +333,25 @@
      setTimeout(() => {
        this.loadData()
      }, config.setting.delay || 0)
    }
  }
  autoExec = (times) => {
    const { config } = this.state
    if (!config.wrap.autoExec) return
    let btn = document.getElementById('button' + config.wrap.autoExec)
    this.autoTimer && clearTimeout(this.autoTimer)
    if (btn) {
      MKEmitter.emit('triggerBtnId', config.wrap.autoExec, [])
    } else if (!times || times < 20) {
      times = times ? times + 1 : 1
      this.autoTimer = setTimeout(() => {
        this.autoExec(times)
      }, 1000)
    }
  }
@@ -680,7 +705,9 @@
      if (!config.setting.supModule || config.setting.supModule !== MenuID) return
      if (id !== this.state.BID || id !== '') {
        this.setState({ BID: id, BData: data, pageIndex: 1 }, () => {
          this.loadData()
          if (!config.checkBid) {
            this.loadData()
          }
        })
      }
    }