feat: enhance application creation flow with loading state management
parent
6f392b775c
commit
942842e3a8
|
|
@ -237,10 +237,15 @@ const submitHandle = async (formEl: FormInstance | undefined) => {
|
||||||
workflowDefault.value.nodes[0].properties.node_data.name = applicationForm.value.name
|
workflowDefault.value.nodes[0].properties.node_data.name = applicationForm.value.name
|
||||||
applicationForm.value['work_flow'] = workflowDefault.value
|
applicationForm.value['work_flow'] = workflowDefault.value
|
||||||
}
|
}
|
||||||
|
loading.value=true
|
||||||
applicationApi
|
applicationApi
|
||||||
.postApplication({ ...applicationForm.value, folder_id: currentFolder.value }, loading)
|
.postApplication({ ...applicationForm.value, folder_id: currentFolder.value })
|
||||||
.then(async (res) => {
|
.then((res) => {
|
||||||
await user.profile()
|
return user.profile().then(() => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
MsgSuccess(t('common.createSuccess'))
|
MsgSuccess(t('common.createSuccess'))
|
||||||
emit('refresh')
|
emit('refresh')
|
||||||
if (isWorkFlow(applicationForm.value.type)) {
|
if (isWorkFlow(applicationForm.value.type)) {
|
||||||
|
|
@ -249,6 +254,8 @@ const submitHandle = async (formEl: FormInstance | undefined) => {
|
||||||
router.push({ path: `/application/workspace/${res.data.id}/${res.data.type}/setting` })
|
router.push({ path: `/application/workspace/${res.data.id}/${res.data.type}/setting` })
|
||||||
}
|
}
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value=false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue