king
2023-07-10 19e156d67e400bff8883425f3511812bb4f9d193
src/tabviews/custom/components/card/balcony/index.jsx
@@ -84,21 +84,23 @@
      _data.$$uuid = _data[_config.setting.primaryKey] || ''
    }
    if (_config.wrap.position === 'fixed' || _config.wrap.position === 'absolute') {
      _config.style.position = _config.wrap.position
      _config.style.zIndex = 3
      _config.style.left = _config.wrap.left || ''
      _config.style.right = _config.wrap.right || ''
      _config.style.top = _config.wrap.top || ''
      _config.style.bottom = _config.wrap.bottom || ''
      _config.style.transform = _config.wrap.transform || ''
      _config.style.width = _config.wrap.realwidth || ''
    } else {
      _config.style.zIndex = 3
      _config.style.left = _config.wrap.left || ''
      _config.style.right = _config.wrap.right || ''
      _config.style.top = _config.wrap.top || ''
      _config.style.bottom = _config.wrap.bottom || ''
    if (!_config.style.position) {
      if (_config.wrap.position === 'fixed' || _config.wrap.position === 'absolute') {
        _config.style.position = _config.wrap.position
        _config.style.zIndex = _config.wrap.position === 'fixed' ? 3 : 2
        _config.style.left = _config.wrap.left || ''
        _config.style.right = _config.wrap.right || ''
        _config.style.top = _config.wrap.top || ''
        _config.style.bottom = _config.wrap.bottom || ''
        _config.style.transform = _config.wrap.transform || ''
        _config.style.width = _config.wrap.realwidth || ''
      } else {
        _config.style.zIndex = 1
        _config.style.left = _config.wrap.left || ''
        _config.style.right = _config.wrap.right || ''
        _config.style.top = _config.wrap.top || ''
        _config.style.bottom = _config.wrap.bottom || ''
      }
    }
    let show = true
@@ -140,6 +142,7 @@
    MKEmitter.addListener('syncBalconyData', this.syncBalconyData)
    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
    MKEmitter.addListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.addListener('refreshLineData', this.refreshLineData)
    MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult)
    if (config.wrap.datatype === 'public') {
@@ -176,6 +179,7 @@
    MKEmitter.removeListener('syncBalconyData', this.syncBalconyData)
    MKEmitter.removeListener('resetSelectLine', this.resetParentParam)
    MKEmitter.removeListener('queryModuleParam', this.queryModuleParam)
    MKEmitter.removeListener('refreshLineData', this.refreshLineData)
    MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult)
    this.timer && this.timer.stop()
@@ -243,11 +247,20 @@
      } else {
        this.loadData()
      }
      if (position === 'popclose') {                                      // 标签关闭刷新
        btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
      }
    }
  }
  refreshLineData = (menuId, btn, uuid, count) => {
    const { config, data } = this.state
    if (config.uuid !== menuId) return
    let _data = fromJS(data).toJS()
    _data[btn.field] = count
    this.setState({
      data: _data
    })
  }
  syncBalconyData = (menuId, data, checked) => {
@@ -364,10 +377,24 @@
        loading: false
      })
      if (config.timer && config.clearField) {
      if (config.timer && config.clearField && result.data && result.data[0]) {
        let vals = (config.clearValue || '').split(',')
        if (vals.includes(_data[config.clearField])) {
        if (vals.includes(result.data[0][config.clearField])) {
          this.timer && this.timer.stop()
        }
      }
      if (result.message) {
        if (result.ErrCode === 'Y') {
          Modal.success({
            title: result.message
          })
        } else if (result.ErrCode === 'S') {
          notification.success({
            top: 92,
            message: result.message,
            duration: 2
          })
        }
      }
    } else {
@@ -375,11 +402,13 @@
        loading: false
      })
      this.timer && this.timer.stop()
      if (!result.message) return
      if (result.ErrCode === 'N') {
        Modal.error({
          title: result.message,
        })
      } else {
      } else if (result.ErrCode !== '-2') {
        notification.error({
          top: 92,
          message: result.message,