diff --git a/src/components/Common/ToolBar/ToolBarNew.js b/src/components/Common/ToolBar/ToolBarNew.js index a91b0f0..facab8a 100644 --- a/src/components/Common/ToolBar/ToolBarNew.js +++ b/src/components/Common/ToolBar/ToolBarNew.js @@ -1740,7 +1740,7 @@ class ToolBarComponent extends Component { loading: false, }); } - } else if (key.indexOf("BtnSend") > -1 && key.includes("BtnSendDialog")) { + } else if ( key.includes("BtnSendDialog")) { /* 推送接口 */ /* 将当前界面所有数据集作为入参传到接口中 */ const { masterConfig, sModelsId } = this.props; @@ -1927,6 +1927,26 @@ class ToolBarComponent extends Component { this.props.onSaveState({ ...addState, }); + } else if (key.indexOf('BtnSend') > -1) { /* 推送接口 */ + /* 根据接口返回是之前调用还是之后调用 */ + this.props.onSaveState({ + loading: true, + }); + if(commonUtils.isNotEmptyArr(interfaceArr)) { + const sendInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "0" ); + if(commonUtils.isNotEmptyArr(sendInterfaceArr)) { /* 之前调用 */ + const asyncFunc = async () => { + for (let i = 0; i < sendInterfaceArr.length; i ++) { + await this.handleInterfaceCall(sendInterfaceArr[i], true, key); + } + } + await asyncFunc(); + } + + } + this.props.onSaveState({ + loading: false, + }); } else if (key.includes("BtnGetApiDialog")) { /* 从第三方拿数据 */ /* 将当前界面所有数据集作为入参传到接口中 */ @@ -2191,7 +2211,7 @@ class ToolBarComponent extends Component { const file = e.target.files[0]; const formData = new FormData(); formData.append('file', file); - + const { formId } = this.props; const { token } = this.props.app; const url = `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`;