king
2022-04-29 eec619b6e3339e9999a7a1c2c5454cef5d763b24
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -24,6 +24,7 @@
    btn: PropTypes.object,            // 按钮
    setting: PropTypes.any,           // 页面通用设置
    disabled: PropTypes.any,          // 行按钮禁用
    lineId: PropTypes.any,            // 行索引+主键值,用于行按钮双击
  }
  state = {
@@ -42,7 +43,7 @@
    if (btn.controlField && selectedData && selectedData.length > 0) { // 表格中按钮隐藏控制
      selectedData.forEach(item => {
        let s = item[btn.controlField] + ''
        let s = item[btn.controlField] !== undefined ? item[btn.controlField] + '' : ''
        if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
          disabled = true
        }
@@ -84,7 +85,7 @@
    if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) {
      if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制
        nextProps.selectedData.forEach(item => {
          let s = item[btn.controlField] + ''
          let s = item[btn.controlField] !== undefined ? item[btn.controlField] + '' : ''
          if (s === btn.controlVal || (btn.controlVal && btn.controlVal.split(',').includes(s))) {
            disabled = true
          }
@@ -156,7 +157,13 @@
    const { setting, Tab, BID, btn, selectedData } = this.props
    const { loading, disabled } = this.state
    if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return
    if (loading || disabled) return
    if (triggerId) {
      if (btn.uuid !== triggerId) return
      if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) {
        return
      }
    }
    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
      notification.warning({
@@ -177,7 +184,7 @@
      // 需要选择单行时,校验数据
      notification.warning({
        top: 92,
        message: this.state.dict['main.action.confirm.selectSingleLine'],
        message: data.length === 0 ? '请选择行!' : '请选择单行数据!',
        duration: 5
      })
      return
@@ -263,7 +270,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} MenuID={btn.uuid} MenuName={btn.label} param={{$BID: (popData ? primaryId : this.props.BID), ...(popData || this.props.BData || {})}} /> : null}
      </Modal>
    } else {
      let height = '100vh'
@@ -343,12 +350,13 @@
          className={'mk-btn mk-' + btn.class}
          icon={btn.icon}
          disabled={disabled}
          title={disabled ? (btn.reason || '') : ''}
          onClick={() => {this.actionTrigger()}}
          loading={loading}
        >{btn.label}</Button> : null}
        {show !== 'actionList' ? <Button
          type="link"
          title={show === 'icon' ? btn.label : ''}
          title={disabled ? (btn.reason || '') : (show === 'icon' ? btn.label : '')}
          loading={loading}
          disabled={disabled}
          style={btn.style}