| | |
| | | execAction: null, |
| | | loadingUuid: '', |
| | | configMap: {}, |
| | | loadingNumber: '' |
| | | loadingNumber: '', |
| | | } |
| | | |
| | | refreshdata = (item, type) => { |
| | |
| | | _resolve() |
| | | }) |
| | | } else { // 超出20个请求时循环执行 |
| | | if (btn.progress === 'progressbar') { |
| | | this.setState({ |
| | | loadingTotal: _params.length |
| | | }) |
| | | } |
| | | this.innerLoopRequest(_params, btn, _resolve) |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | if (_params.length > 1 && btn.progress === 'progressbar') { |
| | | this.setState({ |
| | | loadingTotal: _params.length |
| | | }) |
| | | } |
| | | |
| | | // 循环调用外部接口(包括内部及回调函数) |
| | | this.outerLoopRequest(_params, btn, _resolve, _params.length > 20) |
| | | this.outerLoopRequest(_params, btn, _resolve) |
| | | } |
| | | } |
| | | |
| | |
| | | let param = params.shift() |
| | | |
| | | this.setState({ |
| | | loadingNumber: params.length || '' |
| | | loadingNumber: params.length |
| | | }) |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | |
| | | /** |
| | | * @description 外部请求循环执行 |
| | | */ |
| | | outerLoopRequest = (params, btn, _resolve, widthNumber) => { |
| | | outerLoopRequest = (params, btn, _resolve) => { |
| | | if (!params && params.length === 0) return |
| | | |
| | | let param = params.shift() |
| | |
| | | let _localParam = null |
| | | let errRes = null |
| | | |
| | | if (widthNumber) { |
| | | this.setState({ |
| | | loadingNumber: params.length || '' |
| | | }) |
| | | } |
| | | this.setState({ |
| | | loadingNumber: params.length |
| | | }) |
| | | |
| | | new Promise(resolve => { |
| | | // 内部请求 |
| | |
| | | this.execSuccess(btn, response) |
| | | _resolve() |
| | | } else { |
| | | this.outerLoopRequest(params, btn, _resolve, widthNumber) |
| | | this.outerLoopRequest(params, btn, _resolve) |
| | | } |
| | | } else { |
| | | this.execError(response, btn) |
| | |
| | | this.execSuccess(btn, res) |
| | | _resolve() |
| | | } else { |
| | | this.outerLoopRequest(params, btn, _resolve, widthNumber) |
| | | this.outerLoopRequest(params, btn, _resolve) |
| | | } |
| | | } else { |
| | | this.execError(res, btn) |
| | |
| | | this.execSuccess(btn, res) |
| | | _resolve() |
| | | } else { |
| | | this.outerLoopRequest(params, btn, _resolve, widthNumber) |
| | | this.outerLoopRequest(params, btn, _resolve) |
| | | } |
| | | } else { |
| | | this.execError(errRes || res, btn) |
| | |
| | | destroyOnClose |
| | | > |
| | | <MutilForm |
| | | menuType="HS" |
| | | dict={this.props.dict} |
| | | action={execAction} |
| | | inputSubmit={this.handleOk} |
| | |
| | | <div className="verup-button-list verup-toolbar-button"> |
| | | {this.props.actions.map((item, index) => { |
| | | let label = item.label |
| | | if (loadingUuid === item.uuid && loadingNumber !== '') { |
| | | if (loadingUuid === item.uuid && loadingNumber) { |
| | | label = label + '(' + loadingNumber + ')' |
| | | } |
| | | return ( |