king
2021-11-17 c51f5e007a3e03c9d6731ab7f28f0080de009990
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -1,6 +1,5 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { Button, Modal, notification, Icon, Drawer } from 'antd'
@@ -32,6 +31,7 @@
    popData: null,
    primaryId: '',
    disabled: false,
    hidden: false,
    loading: false,
  }
@@ -46,7 +46,7 @@
          disabled = true
        }
      })
      this.setState({disabled})
      this.setState({disabled, hidden: disabled && btn.control === 'hidden'})
    }
  }
@@ -55,6 +55,7 @@
  }
  componentDidMount () {
    MKEmitter.addListener('popclose', this.popclose)
    MKEmitter.addListener('triggerBtnId', this.actionTrigger)
    MKEmitter.addListener('openNewTab', this.openNewTab)
    MKEmitter.addListener('refreshPopButton', this.refreshPopButton)
@@ -74,7 +75,7 @@
          }
        })
      }
      this.setState({disabled})
      this.setState({disabled, hidden: disabled && btn.control === 'hidden'})
    }
  }
@@ -82,6 +83,7 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('popclose', this.popclose)
    MKEmitter.removeListener('openNewTab', this.openNewTab)
    MKEmitter.removeListener('triggerBtnId', this.actionTrigger)
    MKEmitter.removeListener('refreshPopButton', this.refreshPopButton)
@@ -120,9 +122,9 @@
   */
  actionTrigger = (triggerId, record, type) => {
    const { setting, Tab, BID, btn, selectedData } = 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({
@@ -265,7 +267,7 @@
            BID={popData ? primaryId : this.props.BID}
            BData={popData || this.props.BData}
          /> : null}
          {btn.$view === 'CustomPage' ? <CustomPage Tab={btn} MenuID={btn.uuid} param={{$BID: (popData ? primaryId : this.props.BID), ...(popData || this.props.BData || {})}} /> : null}
          {btn.$view === 'CustomPage' ? <CustomPage Tab={btn} MenuName={btn.label} MenuID={btn.uuid} param={{$BID: (popData ? primaryId : this.props.BID), ...(popData || this.props.BData || {})}} /> : null}
          <div className="close-drawer">
            <Button onClick={this.popclose}>
              关闭
@@ -278,7 +280,9 @@
  render() {
    const { btn, show } = this.props
    const { loading, disabled } = this.state
    const { loading, disabled, hidden } = this.state
    if (hidden) return null
    let label = ''
    let icon = ''
@@ -318,15 +322,4 @@
    )
  }
}
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(PopupButton)
export default PopupButton