Commit 50dd912689199f81c16354cafc080406f6652753
1 parent
9a0396b2
1.增加推送第三方接口
Showing
1 changed file
with
22 additions
and
2 deletions
src/components/Common/ToolBar/ToolBarNew.js
| ... | ... | @@ -1740,7 +1740,7 @@ class ToolBarComponent extends Component { |
| 1740 | 1740 | loading: false, |
| 1741 | 1741 | }); |
| 1742 | 1742 | } |
| 1743 | - } else if (key.indexOf("BtnSend") > -1 && key.includes("BtnSendDialog")) { | |
| 1743 | + } else if ( key.includes("BtnSendDialog")) { | |
| 1744 | 1744 | /* 推送接口 */ |
| 1745 | 1745 | /* 将当前界面所有数据集作为入参传到接口中 */ |
| 1746 | 1746 | const { masterConfig, sModelsId } = this.props; |
| ... | ... | @@ -1927,6 +1927,26 @@ class ToolBarComponent extends Component { |
| 1927 | 1927 | this.props.onSaveState({ |
| 1928 | 1928 | ...addState, |
| 1929 | 1929 | }); |
| 1930 | + } else if (key.indexOf('BtnSend') > -1) { /* 推送接口 */ | |
| 1931 | + /* 根据接口返回是之前调用还是之后调用 */ | |
| 1932 | + this.props.onSaveState({ | |
| 1933 | + loading: true, | |
| 1934 | + }); | |
| 1935 | + if(commonUtils.isNotEmptyArr(interfaceArr)) { | |
| 1936 | + const sendInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "0" ); | |
| 1937 | + if(commonUtils.isNotEmptyArr(sendInterfaceArr)) { /* 之前调用 */ | |
| 1938 | + const asyncFunc = async () => { | |
| 1939 | + for (let i = 0; i < sendInterfaceArr.length; i ++) { | |
| 1940 | + await this.handleInterfaceCall(sendInterfaceArr[i], true, key); | |
| 1941 | + } | |
| 1942 | + } | |
| 1943 | + await asyncFunc(); | |
| 1944 | + } | |
| 1945 | + | |
| 1946 | + } | |
| 1947 | + this.props.onSaveState({ | |
| 1948 | + loading: false, | |
| 1949 | + }); | |
| 1930 | 1950 | } else if (key.includes("BtnGetApiDialog")) { |
| 1931 | 1951 | /* 从第三方拿数据 */ |
| 1932 | 1952 | /* 将当前界面所有数据集作为入参传到接口中 */ |
| ... | ... | @@ -2191,7 +2211,7 @@ class ToolBarComponent extends Component { |
| 2191 | 2211 | const file = e.target.files[0]; |
| 2192 | 2212 | const formData = new FormData(); |
| 2193 | 2213 | formData.append('file', file); |
| 2194 | - | |
| 2214 | + | |
| 2195 | 2215 | const { formId } = this.props; |
| 2196 | 2216 | const { token } = this.props.app; |
| 2197 | 2217 | const url = `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`; | ... | ... |