king
2023-08-16 d8561eb770249f6fe00aeb3092555188ab6d076c
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -146,7 +146,7 @@
    if (config.timer && config.wrap.datatype === 'dynamic') {
      this.timer = new TimerTask()
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {this.loadData(true)})
      this.timer.init(config.uuid, config.timer, config.timerRepeats, () => {this.loadData('timer')})
    }
    this.initExec()
@@ -180,15 +180,15 @@
        if (config.$time) {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, config.$time).then(res => {
              if (!res && config.setting.onload === 'true') {
              if (!res.valid && config.setting.onload === 'true') {
                setTimeout(() => {
                  this.loadData()
                  this.loadData('init')
                }, config.setting.delay || 0)
              }
              if (!res || this.loaded) return
              if (!res.data || this.loaded) return
  
              let _data = res[0] || {$$empty: true}
              let _data = res.data[0] || {$$empty: true}
              _data.$$uuid = _data[config.setting.primaryKey] || ''
      
              this.setState({data: _data})
@@ -210,9 +210,9 @@
        } else {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, 0).then(res => {
              if (!res || this.loaded) return
              if (!res.data || this.loaded) return
      
              let _data = res[0] || {$$empty: true}
              let _data = res.data[0] || {$$empty: true}
              _data.$$uuid = _data[config.setting.primaryKey] || ''
      
              this.setState({data: _data})
@@ -221,7 +221,7 @@
  
          if (config.setting.onload === 'true') {
            setTimeout(() => {
              this.loadData()
              this.loadData('init')
            }, config.setting.delay || 0)
          } else if (this.loaded) {
            if (config.wrap.goback === 'true' && data.$$empty) {
@@ -278,11 +278,11 @@
      if (config.$cache && config.$time && config.wrap.autoExec) {
        Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          if (!res) {
            this.autoExec()
          } else {
            Api.writeCacheConfig(config.uuid, [])
          }
          if (res.valid) return
          this.autoExec()
          Api.writeCacheConfig(config.uuid, [])
        })
      } else {
        this.autoExec()
@@ -429,7 +429,7 @@
    if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件
      MKEmitter.emit('reloadData', config.setting.supModule, BID)
    } else {
      this.loadData(false, btn)
      this.loadData('', btn)
    }
  }
@@ -487,7 +487,7 @@
    this.loadData()
  }
  async loadData (hastimer, btn) {
  async loadData (type, btn) {
    const { config, arr_field, BID, BData, selected } = this.state
    if (config.wrap.datatype === 'public') {
@@ -521,7 +521,7 @@
      return
    }
    if (!hastimer) {
    if (type !== 'timer') {
      this.setState({
        loading: true
      })
@@ -535,7 +535,7 @@
      let _data = {}
      this.loaded = true
      if (config.$cache && config.setting.onload !== 'false') {
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
      }