From c54d119b1abd7b0898ca647e63fce846d677001e Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 9 Oct 2023 16:37:54 +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=88=87=E6=8D=A2=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1031220 --user=王孝刚 【接口测试】github#26909,接口自动化内切换环境 ,SQL步骤的数据源切换错误 https://www.tapd.cn/55049933/s/1423509 --- .../scenario/common/JDBCProcessorContent.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue b/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue index da0bc4adae..9f3b2e68cb 100644 --- a/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue +++ b/api-test/frontend/src/business/automation/scenario/common/JDBCProcessorContent.vue @@ -39,7 +39,7 @@ - + { + if (item.id === dataSourceId) { + this.request.targetDataSourceName = item.name; + } + }); + this.reload(); + }, remove(row) { let index = this.request.hashTree.indexOf(row); this.request.hashTree.splice(index, 1); @@ -294,12 +302,13 @@ export default { this.environments.forEach((environment) => { parseEnvironment(environment); // 找到原始环境和数据源名称 - if (environment.id === this.request.environmentId && environment.id !== envId) { + if (environment.id === this.request.environmentId) { hasEnvironment = true; if (environment.config && environment.config.databaseConfigs) { environment.config.databaseConfigs.forEach((item) => { if (item.id === this.request.dataSourceId) { targetDataSourceName = item.name; + this.request.targetDataSourceName = item.name; } }); } @@ -334,6 +343,9 @@ export default { } }, initDataSource(envId, currentEnvironment, targetDataSourceName) { + if (!targetDataSourceName) { + targetDataSourceName = this.request.targetDataSourceName; + } this.databaseConfigsOptions = []; if (envId) { this.request.environmentId = envId;