fix: add loading while click to start chat in datasource management

This commit is contained in:
ulleo
2026-03-18 16:02:52 +08:00
committed by ulleo
parent a645de1a25
commit a1b4b9611b
2 changed files with 25 additions and 6 deletions
+13 -5
View File
@@ -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() {
+12 -1
View File
@@ -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({
</script>
<template>
<div v-show="!currentDataTable" class="datasource-config no-padding">
<div v-show="!currentDataTable" v-loading="loading" class="datasource-config no-padding">
<div class="datasource-methods">
<span class="title">{{ $t('ds.title') }}</span>
<div class="button-input">
@@ -299,6 +308,8 @@ useEmitt({
:type-name="ele.type_name"
:num="ele.num"
:description="ele.description"
@start-checking="startLoading"
@end-checking="endLoading"
@question="handleQuestion"
@edit="handleEditDatasource(ele)"
@recommendation="handleRecommendation(ele)"