| | |
| | | if (btn.OpenType === 'formSubmit') { |
| | | MKEmitter.addListener('triggerFormSubmit', this.actionSubmit) |
| | | } |
| | | MKEmitter.addListener('returnModuleParam', this.resetModuleParam) |
| | | |
| | | if (btn.autoMatic) { |
| | | MKEmitter.addListener('triggerBtnPopSubmit', this.triggerBtnPopSubmit) |
| | |
| | | } |
| | | MKEmitter.removeListener('triggerBtnId', this.actionTrigger) |
| | | MKEmitter.removeListener('triggerFormSubmit', this.actionSubmit) |
| | | MKEmitter.removeListener('returnModuleParam', this.resetModuleParam) |
| | | MKEmitter.removeListener('triggerBtnPopSubmit', this.triggerBtnPopSubmit) |
| | | } |
| | | |
| | |
| | | this.setState({ loading: true }) |
| | | |
| | | this.execSubmit(data, () => {}, res.form) |
| | | } |
| | | |
| | | resetModuleParam = (menuId, btnId, param) => { |
| | | const { btn } = this.props |
| | | |
| | | if (btn.$menuId !== menuId || btn.uuid !== btnId || !param) return |
| | | |
| | | this.moduleParams = param |
| | | } |
| | | |
| | | /** |
| | |
| | | btn.sqlType !== 'insert' && btn.Ot !== 'notRequired' && btn.verify && btn.verify.invalid === 'true' && |
| | | setting.dataresource |
| | | ) { |
| | | MKEmitter.emit('queryModuleParam', btn.$menuId, btn.uuid) |
| | | setTimeout(() => { |
| | | if (this.moduleParams) { |
| | | MKEmitter.emit('queryModuleParam', btn.$menuId, (param) => { |
| | | this.moduleParams = param |
| | | this.execRealSubmit(data, _resolve, formdata) |
| | | } else { |
| | | setTimeout(() => { |
| | | this.execRealSubmit(data, _resolve, formdata) |
| | | }, 100) |
| | | } |
| | | }, 50) |
| | | }) |
| | | } else { |
| | | this.execRealSubmit(data, _resolve, formdata) |
| | | } |