From 4afdfcf3f41d8842efd7cfe0b82fa5b0a2ebe075 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 1 Apr 2024 21:20:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E7=BD=AEsql=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E6=95=B0=E6=8D=AE=E6=B2=A1=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api-test/components/quoteSqlSourceDrawer.vue | 15 +++++++++++++-- .../envParams/popUp/addDatabaseModal.vue | 8 +++++++- .../environmental/locale/en-US.ts | 1 + .../environmental/locale/zh-CN.ts | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue b/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue index 86be8e2f04..9a97a092ad 100644 --- a/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue +++ b/frontend/src/views/api-test/components/quoteSqlSourceDrawer.vue @@ -38,6 +38,7 @@ import type { MsTableColumn } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; + import { getEnvironment } from '@/api/modules/api-test/common'; import { useI18n } from '@/hooks/useI18n'; import { EnvConfig } from '@/models/projectManagement/environmental'; @@ -109,14 +110,24 @@ watch( () => currentEnvConfig?.value, (config) => { - if (config) { - propsRes.value.data = cloneDeep(config.dataSources) as any[]; + if (config && config.id) { + // eslint-disable-next-line no-use-before-define + initEnvironment(config.id); } }, { immediate: true, } ); + async function initEnvironment(envId: string) { + try { + const res = await getEnvironment(envId); + propsRes.value.data = cloneDeep(res.dataSources) as any[]; + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + } + } function searchDataSource() { if (keyword.value.trim() !== '') { diff --git a/frontend/src/views/project-management/environmental/components/envParams/popUp/addDatabaseModal.vue b/frontend/src/views/project-management/environmental/components/envParams/popUp/addDatabaseModal.vue index c24694d1f8..6ff1c72a75 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/popUp/addDatabaseModal.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/popUp/addDatabaseModal.vue @@ -33,7 +33,13 @@ :placeholder="t('project.environmental.database.namePlaceholder')" /> - +