king
2021-09-28 342d3498191f1683059fe586209ec920545e0bf9
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -91,21 +91,6 @@
    }
    MKEmitter.removeListener('triggerBtnId', this.actionTrigger)
  }
  /**
   * @description 按钮状态改变
   */
  updateStatus = (type) => {
    if (type === 'start') {
      this.setState({
        loading: true
      })
    } else if (type === 'over') {
      this.setState({
        loading: false
      })
    }
  }
  
  /**
   * @description 触发按钮操作
@@ -166,27 +151,27 @@
    }
    if (btn.execMode === 'pop') {
      this.updateStatus('start')
      let modal = this.state.btnconfig
      if (!modal && btn.modal) {
        modal = this.handleModelConfig(btn.modal)
      }
      this.setState({
        loading: true,
        tabledata: data,
        btnconfig: modal
      }, () => {
        this.improveAction()
      })
    } else if (btn.execMode === 'prompt') {
      this.updateStatus('start')
      this.setState({ loading: true })
      confirm({
        title: this.state.dict['main.action.confirm.tip'],
        onOk() {
          _this.triggerPrint(data)
        },
        onCancel() {
          _this.updateStatus('over')
          _this.setState({ loading: false })
        }
      })
    } else {
@@ -1348,14 +1333,14 @@
            message: res.message,
            duration: 5
          })
          this.updateStatus('over')
          this.setState({ loading: false })
        } else if (!_LongParam || (btn.execMode === 'pop' && _LongParam.type !== 'Modal')) {
          notification.warning({
            top: 92,
            message: '未获取到按钮配置信息!',
            duration: 5
          })
          this.updateStatus('over')
          this.setState({ loading: false })
        } else {
          _LongParam = updateForm(_LongParam)
          _LongParam = this.handleModelConfig(_LongParam)
@@ -1380,10 +1365,13 @@
   * @description 模态框(表单),确认
   */
  handleOk = () => {
    const { btnconfig } = this.state
    this.formRef.handleConfirm().then(res => {
      this.setState({
        visible: false
      })
      if (btnconfig.setting.finish !== 'unclose') {
        this.setState({
          visible: false
        })
      }
      this.triggerPrint(this.state.tabledata, res)
    })
  }
@@ -1393,9 +1381,9 @@
   */
  handleCancel = () => {
    this.setState({
      loading: false,
      visible: false
    })
    this.updateStatus('over')
  }
  modelconfirm = () => {
@@ -1452,7 +1440,7 @@
        _this.triggerPrint(tabledata, result)
      },
      onCancel() {
        _this.updateStatus('over')
        _this.setState({ loading: false })
      }
    })
  }