king
2021-09-28 342d3498191f1683059fe586209ec920545e0bf9
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -109,9 +109,7 @@
    if (btn.uuid !== res.menuId) return
    this.setState({
      loading: true
    })
    this.setState({ loading: true })
    this.execSubmit(this.state.tabledata, () => {}, res.form)
  }
@@ -127,17 +125,12 @@
  /**
   * @description 按钮状态改变
   */
  updateStatus = (type) => {
    if (type === 'start') {
      this.setState({
        loading: true
      })
    } else if (type === 'over') {
      this.setState({
        loading: false,
        visible: false
      })
    }
  updateStatus = () => {
    this.setState({
      loading: false,
      visible: false,
      confirmLoading: false
    })
  }
  
  /**
@@ -242,7 +235,7 @@
      MKEmitter.emit('mkFormSubmit', btn.uuid)
      return
    } else if (btn.OpenType === 'prompt') {
      this.updateStatus('start')
      this.setState({loading: true})
      confirm({
        title: this.state.dict['main.action.confirm.tip'],
        onOk() {
@@ -251,21 +244,20 @@
          })
        },
        onCancel() {
          _this.updateStatus('over')
          _this.setState({loading: false})
        }
      })
    } else if (btn.OpenType === 'exec') {
      this.updateStatus('start')
      this.setState({loading: true})
      this.execSubmit(data, () => { this.setState({loading: false})})
    } else if (btn.OpenType === '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
      }, () => {
@@ -712,7 +704,7 @@
                }
                resolve(res)
              }, () => {
                this.updateStatus('over')
                this.updateStatus()
                _resolve()
              })
            }, 100 * i)
@@ -867,7 +859,7 @@
                }
                resolve()
              }, () => {
                _this.updateStatus('over')
                _this.updateStatus()
                resolve()
                _resolve()
              })
@@ -884,7 +876,7 @@
        _resolve()
      }
    }, () => {
      this.updateStatus('over')
      this.updateStatus()
      _resolve()
    })
  }
@@ -1136,7 +1128,7 @@
        _resolve()
      }
    }, () => {
      this.updateStatus('over')
      this.updateStatus()
      _resolve()
    })
  }
@@ -1189,7 +1181,7 @@
        _resolve()
      }
    }, () => {
      this.updateStatus('over')
      this.updateStatus()
      _resolve()
    })
  }
@@ -1242,7 +1234,7 @@
            _resolve()
          }
        }, () => {
          this.updateStatus('over')
          this.updateStatus()
          _resolve()
        })
      } else {
@@ -1680,14 +1672,14 @@
            message: res.message,
            duration: 5
          })
          this.updateStatus('over')
          this.setState({ loading: false })
        } else if (!_LongParam || (btn.OpenType === '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)
@@ -1713,15 +1705,9 @@
   */
  handleOk = () => {
    this.formRef.handleConfirm().then(res => {
      this.setState({
        confirmLoading: true
      })
      this.setState({ confirmLoading: true })
      this.execSubmit(this.state.tabledata, () => {
        this.setState({
          confirmLoading: false
        })
      }, res)
      this.execSubmit(this.state.tabledata, () => { this.setState({ confirmLoading: false }) }, res)
    })
  }
@@ -1730,10 +1716,10 @@
   */
  handleCancel = () => {
    this.setState({
      loading: false,
      visible: false,
      confirmLoading: false
    })
    this.updateStatus('over')
  }
  modelconfirm = () => {
@@ -1799,7 +1785,7 @@
        })
      },
      onCancel() {
        _this.updateStatus('over')
        _this.setState({ loading: false })
      }
    })
  }