king
2022-04-26 5046d0d13dc6a8563b8e54e31913bc44cfa1072f
src/tabviews/custom/components/timeline/normal-timeline/index.jsx
@@ -58,6 +58,7 @@
        item.key = index
        item.$$uuid = item[_config.setting.primaryKey] || ''
        item.$$BID = BID || ''
        item.$$BData = BData || ''
        item.$Index = index + 1 + ''
        return item
      })
@@ -67,13 +68,14 @@
    _config.wrap.contentHeight = _config.wrap.title ? 'calc(100% - 45px)' : '100%'
    _config.columns.forEach(item => {
      if (item.type !== 'number') return
      _cols.set(item.field, item)
    })
    card = _config.subcards[0]
    card.elements = card.elements.map(item => {
      if (item.field && _cols.has(item.field)) {
        item.col = _cols.get(item.field)
      if (item.eleType === 'number' && item.field && _cols.has(item.field) && typeof(item.decimal) !== 'number') {
        item.decimal = _cols.get(item.field).decimal || 0
      }
      return item
    })
@@ -88,7 +90,9 @@
      arr_field: _config.columns.map(col => col.field).join(','),
    }, () => {
      if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') {
        this.loadData()
        setTimeout(() => {
          this.loadData()
        }, _config.setting.delay || 0)
      }
    })
  }
@@ -154,16 +158,23 @@
    if (config.uuid !== menuId) return
    this.loadData(btn)                                                         // 数据刷新
    let supModule = config.setting.supModule
    if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) {
      MKEmitter.emit('reloadData', btn.syncComponentId)                        // 同级标签刷新
    btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
    if (!btn.syncComponentId || btn.syncComponentId !== supModule) {
      if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件
        if (supModule && BID) {
          MKEmitter.emit('reloadData', supModule, BID)
        } else {
          this.loadData()
        }
      } else {
        this.loadData()
      }
    }
    if (position === 'mainline' && config.setting.supModule) {                 // 主表行刷新
      MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty'))
    } else if (position === 'popclose') {                                      // 标签关闭刷新
      config.setting.supModule && MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty'))
    if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项
      btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
    }
  }