From 942842e3a854247102452244077ff52743942043 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Sun, 28 Sep 2025 17:19:20 +0800 Subject: [PATCH] feat: enhance application creation flow with loading state management --- .../component/CreateApplicationDialog.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/src/views/application/component/CreateApplicationDialog.vue b/ui/src/views/application/component/CreateApplicationDialog.vue index c6e303ca2..b30aec5ab 100644 --- a/ui/src/views/application/component/CreateApplicationDialog.vue +++ b/ui/src/views/application/component/CreateApplicationDialog.vue @@ -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 }) } })