king
2023-08-27 da64ab0923bf8817fc8599a6e37b953ce38f64c8
src/tabviews/custom/components/card/balcony/index.jsx
@@ -55,7 +55,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
        _config.setting.sync = 'false'
@@ -118,8 +118,7 @@
      syncConfig,
      data: _data,
      BID: BID || '',
      config: _config,
      arr_field: _config.columns.map(col => col.field).join(',')
      config: _config
    })
  }
@@ -144,7 +143,7 @@
    if (config.wrap.datatype === 'dynamic') {
      if (config.timer) {
        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()
@@ -172,15 +171,15 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
                this.loadData('init')
              }, config.setting.delay || 0)
            }
  
@@ -194,7 +193,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            let _data = res.data[0] || {$$empty: true}
@@ -206,7 +205,7 @@
        if (config.setting.onload === 'true') {
          setTimeout(() => {
            this.loadData()
            this.loadData('init')
          }, config.setting.delay || 0)
        }
      }
@@ -227,7 +226,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data[0] || {$$empty: true}
@@ -339,10 +338,8 @@
    if (config.uuid !== menuId) return
    callback({
      arr_field: '',
      orderBy: '',
      search: [],
      menuName: config.name
    })
  }
@@ -354,8 +351,8 @@
    this.loadData()
  }
  async loadData (hastimer) {
    const { config, arr_field, BID, BData } = this.state
  async loadData (type) {
    const { config, BID, BData } = this.state
    if (config.wrap.datatype === 'public') {
      MKEmitter.emit('reloadData', config.wrap.publicId)
@@ -377,22 +374,22 @@
    let searches = []
    if (!hastimer) {
    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)
    let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, 1, 1, BID)
    let result = await Api.genericInterface(param)
    if (result.status) {
      let _data = {}
      this.loaded = true
      if (config.$cache && config.setting.onload !== 'false') {
        Api.writeCacheConfig(config.uuid, result.data || [])
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (!result.data || !result.data[0]) {