From 0db5bb3eec26fa10724d36af2fe3321a7363aee8 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 4 Dec 2023 16:22:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20API=20=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datasource/form/EditorDetail.vue | 3 +- .../visualized/data/datasource/form/index.vue | 46 +++++++++++++------ 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue b/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue index 5a102dcf47..19ec595009 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue @@ -121,7 +121,7 @@ const initForm = type => { updateType: 'all_scope', syncRate: 'SIMPLE_CRON', simpleCronValue: '1', - simpleCronType: 'hour', + simpleCronType: 'minute', startTime: '', endTime: '', endLimit: '0', @@ -363,6 +363,7 @@ const onRateChange = () => { } if (form.value.syncSetting.syncRate === 'SIMPLE_CRON') { form.value.syncSetting.cron = '0 0 0/1 * * ? *' + form.value.syncSetting.simpleCronType = 'minute' } if (form.value.syncSetting.syncRate === 'CRON') { form.value.syncSetting.cron = '00 00 * ? * * *' diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/index.vue b/core/core-frontend/src/views/visualized/data/datasource/form/index.vue index ff8f3f98e6..bcb4f3ae31 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/index.vue @@ -42,7 +42,7 @@ const { t } = useI18n() const creatDsFolder = ref() const router = useRouter() const { wsCache } = useCache() - +const dsLoading = ref(false) const state = reactive({ datasourceTree: [] }) @@ -394,21 +394,37 @@ const saveDS = () => { if (res) { ElMessageBox.confirm(t('datasource.has_same_ds'), options as ElMessageBoxOptions).then( () => { - save(request).then(res => { - if (res !== undefined) { - handleShowFinishPage({ id: res.id, name: res.name }) - ElMessage.success('保存数据源成功') - } - }) + if (dsLoading.value === true) { + return + } + dsLoading.value = true + save(request) + .then(res => { + if (res !== undefined) { + handleShowFinishPage({ id: res.id, name: res.name }) + ElMessage.success('保存数据源成功') + } + }) + .finally(() => { + dsLoading.value = false + }) } ) } else { - save(request).then(res => { - if (res !== undefined) { - handleShowFinishPage({ id: res.id, name: res.name }) - ElMessage.success('保存数据源成功') - } - }) + if (dsLoading.value === true) { + return + } + dsLoading.value = true + save(request) + .then(res => { + if (res !== undefined) { + handleShowFinishPage({ id: res.id, name: res.name }) + ElMessage.success('保存数据源成功') + } + }) + .finally(() => { + dsLoading.value = false + }) } }) } else { @@ -609,7 +625,7 @@ defineExpose({ -
+
{{ typeTitle }}
@@ -633,7 +649,7 @@ defineExpose({
-