From b50a410a82fd89160bb4909815c4ff980e7ad4ff Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 22 Jul 2025 17:26:31 +0800 Subject: [PATCH] fix: bug fix --- frontend/src/i18n/en.json | 3 +- frontend/src/i18n/zh-CN.json | 3 +- frontend/src/views/system/embedded/DsCard.vue | 1 - frontend/src/views/system/embedded/index.vue | 72 ++++++++++++------- 4 files changed, 52 insertions(+), 27 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 5c803f1c..9d169cbd 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -435,7 +435,8 @@ "code_to_embed": "Copy the following code to embed", "floating_window_mode": "Floating window mode", "copy_successful": "Copy successful", - "copy_failed": "Copy failed" + "copy_failed": "Copy failed", + "open_the_query": "Public data sources allow all users to open the query; private data sources allow logged-in users to open the query" }, "chat": { "type": "Chart Type", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index c0665465..27fbb5ca 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -447,7 +447,8 @@ "code_to_embed": "复制以下代码进行嵌入", "floating_window_mode": "浮窗模式", "copy_successful": "复制成功", - "copy_failed": "复制失败" + "copy_failed": "复制失败", + "open_the_query": "公共的数据源,允许所有用户开启问数;私有数据源,登录状态的用户可以开启问数" }, "chat": { "type": "图表类型", diff --git a/frontend/src/views/system/embedded/DsCard.vue b/frontend/src/views/system/embedded/DsCard.vue index acec32e2..7c9aa068 100644 --- a/frontend/src/views/system/embedded/DsCard.vue +++ b/frontend/src/views/system/embedded/DsCard.vue @@ -174,7 +174,6 @@ const handlePublic = () => { .methods { align-items: center; - display: none; .more { position: relative; diff --git a/frontend/src/views/system/embedded/index.vue b/frontend/src/views/system/embedded/index.vue index 59c25781..28a21b2c 100644 --- a/frontend/src/views/system/embedded/index.vue +++ b/frontend/src/views/system/embedded/index.vue @@ -28,7 +28,7 @@ const dsFormRef = ref() const urlFormRef = ref() const dialogTitle = ref('') const embeddedList = ref([]) -const systemCredentials = ['localStorage', 'cookie', 'sessionStorage'] +const systemCredentials = ['localStorage', 'custom', 'cookie', 'sessionStorage'] const credentials = ['header', 'cookie', 'param'] const workspaces = ref([]) @@ -133,6 +133,21 @@ const beforeClose = () => { ruleConfigvVisible.value = false activeStep.value = 0 isCreate.value = false + Object.assign(currentEmbedded, cloneDeep(defaultEmbedded)) + Object.assign(dsForm, cloneDeep(defaultForm)) + Object.assign(urlForm, cloneDeep(defaultUrlForm)) + + if (embeddedFormRef.value) { + embeddedFormRef.value.clearValidate() + } + + if (dsFormRef.value) { + dsFormRef.value.clearValidate() + } + + if (urlFormRef.value) { + urlFormRef.value.clearValidate() + } } const handleActive = (row: any) => { @@ -210,14 +225,6 @@ const rules = { trigger: 'blur', }, ], - description: [ - { - required: true, - message: - t('datasource.please_enter') + t('common.empty') + t('embedded.application_description'), - trigger: 'blur', - }, - ], domain: [ { required: true, @@ -287,14 +294,6 @@ const urlRules = { trigger: 'blur', }, ], - - target_val: [ - { - required: true, - message: t('datasource.please_enter') + t('common.empty') + t('embedded.target_credential'), - trigger: 'blur', - }, - ], } const preview = () => { @@ -380,6 +379,7 @@ const copyCode = () => { style="width: 240px; margin-right: 12px" :placeholder="$t('dashboard.search')" @keyup.enter="handleSearch" + clearable @blur="handleSearch" >