From 6e29a30f5d570226474619130860168ac0389e38 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 31 Jul 2025 15:22:08 +0800 Subject: [PATCH] fix: bug fix --- frontend/src/i18n/en.json | 2 ++ frontend/src/i18n/zh-CN.json | 2 ++ frontend/src/style.less | 4 ++++ frontend/src/views/ds/DatasourceForm.vue | 15 ++++++++++++--- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index a54056e1..bda07966 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -6,6 +6,8 @@ "AI Model Configuration": "AI Model Configuration" }, "common": { + "excessive_tables_selected": "Excessive tables selected", + "to_continue_saving": "The number of selected tables is 67, exceeding {msg}. This may cause the operation to time out or become unresponsive. Do you want to continue saving?", "proceed_with_caution": "Deletion is irreversible, so proceed with caution.", "sales_in_2024": "Delete conversation: {msg}?", "limited_to_30": "The number of data tables is limited to 30", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 3f219944..7ea38d4b 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -6,6 +6,8 @@ "AI Model Configuration": "模型配置" }, "common": { + "excessive_tables_selected": "选择数据表过量", + "to_continue_saving": "选择的数据表数量为: {msg},已超出30,可能会导致操作超时或者无响应,是否继续保存?", "proceed_with_caution": "删除后无法恢复,请谨慎操作。", "sales_in_2024": "是否删除对话:{msg}?", "limited_to_30": "数据表数量限制30", diff --git a/frontend/src/style.less b/frontend/src/style.less index 9cdf5565..b7bc4d56 100644 --- a/frontend/src/style.less +++ b/frontend/src/style.less @@ -172,6 +172,10 @@ body { } } +.confirm-with_icon { + border-radius: 12px; +} + .form-content_error { .ed-form-item--default { margin-bottom: 16px; diff --git a/frontend/src/views/ds/DatasourceForm.vue b/frontend/src/views/ds/DatasourceForm.vue index e81db1b8..d31f3b6f 100644 --- a/frontend/src/views/ds/DatasourceForm.vue +++ b/frontend/src/views/ds/DatasourceForm.vue @@ -231,7 +231,7 @@ const initForm = (item: any, editTable: boolean = false) => { const save = async (formEl: FormInstance | undefined) => { if (!formEl) return - await formEl.validate((valid) => { + await formEl.validate(async (valid) => { if (valid) { const list = tableList.value .filter((ele: any) => { @@ -242,8 +242,17 @@ const save = async (formEl: FormInstance | undefined) => { }) if (checkList.value.length > 30) { - ElMessage.error(t('common.limited_to_30')) - return + const excessive = await ElMessageBox.confirm(t('common.excessive_tables_selected'), { + tip: t('common.to_continue_saving', { msg: checkList.value.length }), + confirmButtonText: t('common.save'), + cancelButtonText: t('common.cancel'), + confirmButtonType: 'primary', + type: 'warning', + customClass: 'confirm-with_icon', + autofocus: false, + }) + + if (excessive !== 'confirm') return } saveLoading.value = true