king
2022-09-18 7046b2568593b72f3640df6796a2b81980134030
src/tabviews/custom/components/carousel/prop-card/index.jsx
@@ -7,6 +7,7 @@
import Api from '@/api'
import UtilsDM from '@/utils/utils-datamanage.js'
import MKEmitter from '@/utils/events.js'
import TimerTask from '@/utils/timer-task.js'
import './index.scss'
const CardItem = asyncComponent(() => import('../cardItem'))
@@ -105,10 +106,19 @@
  }
  componentDidMount () {
    const { config } = this.state
    MKEmitter.addListener('reloadData', this.reloadData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    if (config.timer) {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {
        this.loadData('timer')
      })
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -123,6 +133,8 @@
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
  }
  /**
@@ -211,7 +223,7 @@
    this.loadData()
  }
  async loadData () {
  async loadData (type) {
    const { mainSearch } = this.props
    const { config, arr_field, BID, BData } = this.state
@@ -234,9 +246,11 @@
      return
    }
    this.setState({
      loading: true
    })
    if (type !== 'timer') {
      this.setState({
        loading: true
      })
    }
    let _orderBy = config.setting.order || ''
    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, 1, BID)
@@ -262,6 +276,7 @@
      this.setState({
        loading: false
      })
      this.timer && this.timer.stop()
      notification.error({
        top: 92,
        message: result.message,