From d0fd4a6111f329ce8db4275f293af5f2591321a1 Mon Sep 17 00:00:00 2001 From: ulleo Date: Tue, 5 Aug 2025 22:25:14 +0800 Subject: [PATCH] feat: create chat add loading --- frontend/src/views/chat/ChatCreator.vue | 199 +++++++++++++----------- 1 file changed, 104 insertions(+), 95 deletions(-) diff --git a/frontend/src/views/chat/ChatCreator.vue b/frontend/src/views/chat/ChatCreator.vue index f53ea62e..02769f97 100644 --- a/frontend/src/views/chat/ChatCreator.vue +++ b/frontend/src/views/chat/ChatCreator.vue @@ -51,6 +51,7 @@ function listDs() { const innerDs = ref() const loading = ref(false) +const statusLoading = ref(false) function showDs() { listDs() @@ -68,12 +69,18 @@ function selectDsInDialog(ds: any) { function confirmSelectDs() { if (innerDs.value) { + statusLoading.value = true //check first - datasourceApi.check_by_id(innerDs.value).then((res: any) => { - if (res) { - createChat(innerDs.value) - } - }) + datasourceApi + .check_by_id(innerDs.value) + .then((res: any) => { + if (res) { + createChat(innerDs.value) + } + }) + .finally(() => { + statusLoading.value = false + }) } } @@ -117,98 +124,100 @@ defineExpose({