Showing
1 changed file
with
5 additions
and
19 deletions
| ... | @@ -914,7 +914,7 @@ export default { | ... | @@ -914,7 +914,7 @@ export default { |
| 914 | const onCloseUserView = (status: boolean) => { | 914 | const onCloseUserView = (status: boolean) => { |
| 915 | state.dialogUserFormVisible = status | 915 | state.dialogUserFormVisible = status |
| 916 | } | 916 | } |
| 917 | - const onConfirmUserView = (data: any) => { | 917 | + const onConfirmUserView = async (data: any) => { |
| 918 | state.userTags = data; | 918 | state.userTags = data; |
| 919 | // 自动保存流程 | 919 | // 自动保存流程 |
| 920 | let { nodes, edges } = editor.editorState.graph.save(); | 920 | let { nodes, edges } = editor.editorState.graph.save(); |
| ... | @@ -925,26 +925,12 @@ export default { | ... | @@ -925,26 +925,12 @@ export default { |
| 925 | let flow_id = getFlowId(); // 流程id | 925 | let flow_id = getFlowId(); // 流程id |
| 926 | 926 | ||
| 927 | if (paths.length) { | 927 | if (paths.length) { |
| 928 | - axios.post('/admin/?a=save_flow', qs.stringify({ | 928 | + const { code, data } = await saveFlowAPI({ form_id: +form_id, flow_id: +flow_id, data: JSON.stringify({ nodes, edges }) }); |
| 929 | - form_id: +form_id, | 929 | + if (code) { |
| 930 | - flow_id: +flow_id, | 930 | + flow_id = data; // 更新flow_id |
| 931 | - data: JSON.stringify({ nodes, edges }) | ||
| 932 | - })) | ||
| 933 | - .then(res => { | ||
| 934 | - if (res.data.code) { | ||
| 935 | - flow_id = res.data.data; // 更新flow_id | ||
| 936 | updateFlowId(flow_id); // 更新缓存flow_id | 931 | updateFlowId(flow_id); // 更新缓存flow_id |
| 937 | - console.log(paths); // 输出满足条件的路径结果数组 | 932 | + console.log('满足条件的路径', paths); // 输出满足条件的路径结果数组 |
| 938 | - } else { | ||
| 939 | - ElMessage({ | ||
| 940 | - type: 'error', | ||
| 941 | - message: res.data.msg, | ||
| 942 | - }); | ||
| 943 | } | 933 | } |
| 944 | - }) | ||
| 945 | - .catch(err => { | ||
| 946 | - console.log(err); | ||
| 947 | - }); | ||
| 948 | } else { | 934 | } else { |
| 949 | ElNotification.error('缺少一条从开始节点到结束节点的完整流程!'); | 935 | ElNotification.error('缺少一条从开始节点到结束节点的完整流程!'); |
| 950 | } | 936 | } | ... | ... |
-
Please register or login to post a comment