king
2022-01-02 bde2916433c7830e2879e6524e32b9f6c8bd0bab
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -24,6 +24,7 @@
    btn: PropTypes.object,            // 按钮
    setting: PropTypes.any,           // 页面通用设置
    updateStatus: PropTypes.func,     // 按钮状态更新
    disabled: PropTypes.any,          // 行按钮禁用
  }
  state = {
@@ -31,11 +32,12 @@
    excelName: '',  // 文件名
    search: '',     // 搜索条件
    loading: false, // 导出中
    hidden: false
    hidden: false,
    disabled: false
  }
  UNSAFE_componentWillMount () {
    const { btn, BData } = this.props
    const { btn, BData, disabled } = this.props
    if (btn.control === 'parent') {
      if (!BData || !BData.hasOwnProperty(btn.controlField)) {
@@ -48,6 +50,10 @@
          this.setState({hidden: false})
        }
      }
    }
    if (disabled) {
      this.setState({disabled: true})
    }
  }
@@ -74,6 +80,12 @@
          this.setState({hidden: false})
        }
      }
    }
    if (nextProps.disabled) {
      this.setState({disabled: true})
    } else {
      this.setState({disabled: false})
    }
  }
@@ -106,9 +118,9 @@
   */
  actionTrigger = (triggerId) => {
    const { setting, Tab, BID, btn } = this.props
    const { loading } = this.state
    const { loading, disabled } = this.state
    if ((triggerId && btn.uuid !== triggerId) || loading) return
    if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return
    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
      notification.warning({
@@ -910,7 +922,7 @@
  render() {
    const { btn, show } = this.props
    const { loading, hidden } = this.state
    const { loading, hidden, disabled } = this.state
    if (hidden) return null
@@ -919,6 +931,7 @@
        <Button
          className={'mk-btn mk-' + btn.class}
          icon={btn.icon}
          disabled={disabled}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
          loading={loading}
        >{btn.label}</Button>
@@ -945,6 +958,7 @@
          type="link"
          title={show === 'icon' ? btn.label : ''}
          loading={loading}
          disabled={disabled}
          style={btn.style}
          icon={icon}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}