mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: enhance application creation flow with loading state management
This commit is contained in:
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
|
||||
applicationForm.value['work_flow'] = workflowDefault.value
|
||||
}
|
||||
loading.value=true
|
||||
applicationApi
|
||||
.postApplication({ ...applicationForm.value, folder_id: currentFolder.value }, loading)
|
||||
.then(async (res) => {
|
||||
await user.profile()
|
||||
.postApplication({ ...applicationForm.value, folder_id: currentFolder.value })
|
||||
.then((res) => {
|
||||
return user.profile().then(() => {
|
||||
return res
|
||||
})
|
||||
})
|
||||
.then((res) => {
|
||||
MsgSuccess(t('common.createSuccess'))
|
||||
emit('refresh')
|
||||
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` })
|
||||
}
|
||||
dialogVisible.value = false
|
||||
}).finally(() => {
|
||||
loading.value=false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue