From c23247edb3899f06b4102ae26f9c3281985b0a4c Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 30 Jul 2025 16:02:24 +0800 Subject: [PATCH] fix: bug fix --- frontend/src/views/ds/DatasourceForm.vue | 40 ++++++++++++++---------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/frontend/src/views/ds/DatasourceForm.vue b/frontend/src/views/ds/DatasourceForm.vue index 80bafdb0..e81db1b8 100644 --- a/frontend/src/views/ds/DatasourceForm.vue +++ b/frontend/src/views/ds/DatasourceForm.vue @@ -43,6 +43,7 @@ const tableList = ref([]) const excelUploadSuccess = ref(false) const tableListLoading = ref(false) const token = wsCache.get('user.token') +const checkLoading = ref(false) const request_key = computed(() => { // eslint-disable-next-line no-undef return LicenseGenerator.generate() @@ -350,23 +351,30 @@ const next = debounce(async (formEl: FormInstance | undefined) => { emit('changeActiveStep', props.activeStep + 1) } } else { + if (checkLoading.value) return // check status if success do next const requestObj = buildConf() - datasourceApi.check(requestObj).then((res: boolean) => { - if (res) { - emit('changeActiveStep', props.activeStep + 1) - // request tables - datasourceApi.getTablesByConf(requestObj).then((res: any) => { - tableList.value = res - }) - } else { - ElMessage({ - message: t('ds.form.connect.failed'), - type: 'error', - showClose: true, - }) - } - }) + checkLoading.value = true + datasourceApi + .check(requestObj) + .then((res: boolean) => { + if (res) { + emit('changeActiveStep', props.activeStep + 1) + // request tables + datasourceApi.getTablesByConf(requestObj).then((res: any) => { + tableList.value = res + }) + } else { + ElMessage({ + message: t('ds.form.connect.failed'), + type: 'error', + showClose: true, + }) + } + }) + .finally(() => { + checkLoading.value = false + }) } } }) @@ -480,7 +488,7 @@ defineExpose({