From 496fd146d27824209a19023743af35c79c4d7b6c Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 18 Mar 2026 16:01:23 +0800 Subject: [PATCH] fix: add loading while click to start chat in datasource management --- frontend/src/views/ds/Card.vue | 18 +++++++++++++----- frontend/src/views/ds/Datasource.vue | 13 ++++++++++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/ds/Card.vue b/frontend/src/views/ds/Card.vue index a99cafac3..f2e777c7d 100644 --- a/frontend/src/views/ds/Card.vue +++ b/frontend/src/views/ds/Card.vue @@ -35,6 +35,8 @@ const emits = defineEmits([ 'dataTableDetail', 'showTable', 'recommendation', + 'startChecking', + 'endChecking', ]) const icon = computed(() => { return (dsTypeWithImg.find((ele) => props.type === ele.type) || {}).img @@ -53,11 +55,17 @@ const handleDel = () => { const handleQuestion = () => { //check first - datasourceApi.check_by_id(props.id).then((res: any) => { - if (res) { - emits('question', props.id) - } - }) + emits('startChecking') + datasourceApi + .check_by_id(props.id) + .then((res: any) => { + if (res) { + emits('question', props.id) + } + }) + .finally(() => { + emits('endChecking') + }) } function runSQL() { diff --git a/frontend/src/views/ds/Datasource.vue b/frontend/src/views/ds/Datasource.vue index 72bd1c8dd..82c4f7e70 100644 --- a/frontend/src/views/ds/Datasource.vue +++ b/frontend/src/views/ds/Datasource.vue @@ -198,6 +198,15 @@ const back = () => { currentDataTable.value = null } +const loading = ref(false) + +function startLoading() { + loading.value = true +} +function endLoading() { + loading.value = false +} + useEmitt({ name: 'ds-index-click', callback: back, @@ -205,7 +214,7 @@ useEmitt({