king
2021-03-24 abe57d274e6b12c3612788e0be3d1b9201852ebd
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -54,6 +54,8 @@
    if (position === 'toolbar') {
      MKEmitter.addListener('triggerBtnId', this.actionTrigger)
    } else if (position === 'form') {
      MKEmitter.addListener('triggerFormSubmit', this.actionSubmit)
    }
  }
@@ -62,6 +64,23 @@
      return
    }
    MKEmitter.removeListener('triggerBtnId', this.actionTrigger)
    MKEmitter.removeListener('triggerFormSubmit', this.actionSubmit)
  }
  actionSubmit = (res) => {
    const { btn } = this.props
    if (btn.uuid !== res.menuId) return
    this.setState({
      confirmLoading: true
    })
    this.execSubmit(this.state.tabledata, () => {
      this.setState({
        confirmLoading: false
      })
    }, res.form)
  }
  /**
@@ -117,7 +136,7 @@
        duration: 5
      })
      return
    } else if (!setting.primaryKey) {
    } else if (btn.OpenType !== 'formSubmit' && !setting.primaryKey) {
      // 需要选择行时,校验是否设置主键
      notification.warning({
        top: 92,
@@ -179,7 +198,13 @@
      return
    }
    if (btn.OpenType === 'prompt') {
    if (btn.OpenType === 'formSubmit') {
      this.setState({
        tabledata: data
      })
      MKEmitter.emit('mkFormSubmit', btn.uuid)
      return
    } else if (btn.OpenType === 'prompt') {
      this.updateStatus('start')
      confirm({
        title: this.state.dict['main.action.confirm.tip'],
@@ -275,7 +300,7 @@
        }
        param.LText = Utils.formatOptions(param.LText)
      } else if (btn.OpenType === 'pop') { // 表单
      } else if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit') { // 表单
        if (btn.sqlType === 'insert') { // 系统函数添加时,生成uuid
          primaryId = ''
@@ -499,7 +524,7 @@
      param[setting.primaryKey] = primaryId // 设置主键参数
      if (btn.OpenType === 'pop') { // 表单
      if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit') { // 表单
        formdata.forEach(_data => {
          param[_data.key] = _data.value
        })
@@ -610,7 +635,7 @@
          param.BID = this.props.BID
        }
        if (btn.OpenType === 'pop' && formdata) { // 表单
        if ((btn.OpenType === 'pop' || btn.OpenType === 'formSubmit') && formdata) { // 表单
          formdata.forEach(_data => {
            param[_data.key] = _data.value
          })