king
2020-12-13 a3ac1b4636cf446804bb1947d6a5d2dd6c3bc030
src/tabviews/zshare/actionList/changeuserbutton/index.jsx
@@ -14,6 +14,7 @@
class NewPageButton extends Component {
  static propTpyes = {
    show: PropTypes.any,              // 按钮显示样式控制
    position: PropTypes.any,          // 按钮位置,工具栏为toolbar
    BID: PropTypes.string,            // 主表ID
    btn: PropTypes.object,            // 按钮
    selectedData: PropTypes.any,      // 子表中选择数据
@@ -31,9 +32,9 @@
  }
  componentDidMount () {
    const { show } = this.props
    const { position } = this.props
    if (show === 'actionList') {
    if (position === 'toolbar') {
      MKEmitter.addListener('triggerBtnId', this.actionTrigger)
    }
  }
@@ -48,13 +49,13 @@
  /**
   * @description 触发按钮操作
   */
  actionTrigger = (triggerId) => {
  actionTrigger = (triggerId, record) => {
    const { setting, selectedData, btn } = this.props
    const { loading } = this.state
    
    if ((triggerId && btn.uuid !== triggerId) || loading) return
    
    let data = selectedData || []
    let data = record || selectedData || []
    if (data.length !== 1) {
      // 需要选择单行时,校验数据