| | |
| | | |
| | | if (btn.uuid !== res.menuId) return |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | this.setState({ loading: true }) |
| | | |
| | | this.execSubmit(this.state.tabledata, () => {}, res.form) |
| | | } |
| | |
| | | /** |
| | | * @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 |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | 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() { |
| | |
| | | }) |
| | | }, |
| | | 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 |
| | | }, () => { |
| | |
| | | } |
| | | resolve(res) |
| | | }, () => { |
| | | this.updateStatus('over') |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | | }, 100 * i) |
| | |
| | | } |
| | | resolve() |
| | | }, () => { |
| | | _this.updateStatus('over') |
| | | _this.updateStatus() |
| | | resolve() |
| | | _resolve() |
| | | }) |
| | |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | this.updateStatus('over') |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | | } |
| | |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | this.updateStatus('over') |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | | } |
| | |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | this.updateStatus('over') |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | | } |
| | |
| | | _resolve() |
| | | } |
| | | }, () => { |
| | | this.updateStatus('over') |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | | } else { |
| | |
| | | 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) |
| | |
| | | */ |
| | | 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) |
| | | }) |
| | | } |
| | | |
| | |
| | | */ |
| | | handleCancel = () => { |
| | | this.setState({ |
| | | loading: false, |
| | | visible: false, |
| | | confirmLoading: false |
| | | }) |
| | | this.updateStatus('over') |
| | | } |
| | | |
| | | modelconfirm = () => { |
| | |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | _this.updateStatus('over') |
| | | _this.setState({ loading: false }) |
| | | } |
| | | }) |
| | | } |