fix(接口测试): 修复场景自定义sql请求环境显示为id的缺陷
--bug=1025017 --user=王孝刚 【接口测试】场景导出导入后-运行环境显示错误 https://www.tapd.cn/55049933/s/1358378
This commit is contained in:
parent
9c9b959501
commit
81f508da6e
|
@ -273,10 +273,12 @@ export default {
|
||||||
let currentEnvironment = {};
|
let currentEnvironment = {};
|
||||||
this.result = getEnvironmentByProjectId(id).then((response) => {
|
this.result = getEnvironmentByProjectId(id).then((response) => {
|
||||||
this.environments = response.data;
|
this.environments = response.data;
|
||||||
|
let hasEnvironment = false;
|
||||||
this.environments.forEach((environment) => {
|
this.environments.forEach((environment) => {
|
||||||
parseEnvironment(environment);
|
parseEnvironment(environment);
|
||||||
// 找到原始环境和数据源名称
|
// 找到原始环境和数据源名称
|
||||||
if (environment.id === this.request.environmentId && environment.id !== envId) {
|
if (environment.id === this.request.environmentId && environment.id !== envId) {
|
||||||
|
hasEnvironment = true;
|
||||||
if (environment.config && environment.config.databaseConfigs) {
|
if (environment.config && environment.config.databaseConfigs) {
|
||||||
environment.config.databaseConfigs.forEach((item) => {
|
environment.config.databaseConfigs.forEach((item) => {
|
||||||
if (item.id === this.request.dataSourceId) {
|
if (item.id === this.request.dataSourceId) {
|
||||||
|
@ -290,6 +292,9 @@ export default {
|
||||||
this.environments = [currentEnvironment];
|
this.environments = [currentEnvironment];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!hasEnvironment) {
|
||||||
|
this.request.environmentId = "";
|
||||||
|
}
|
||||||
this.initDataSource(envId, currentEnvironment, targetDataSourceName);
|
this.initDataSource(envId, currentEnvironment, targetDataSourceName);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -113,7 +113,5 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
:deep(.ace_text-layer){
|
|
||||||
padding:0px !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -415,10 +415,12 @@ export default {
|
||||||
}
|
}
|
||||||
getEnvironmentByProjectId(id).then((response) => {
|
getEnvironmentByProjectId(id).then((response) => {
|
||||||
this.environments = response.data;
|
this.environments = response.data;
|
||||||
|
let hasEnvironment = false;
|
||||||
this.environments.forEach((environment) => {
|
this.environments.forEach((environment) => {
|
||||||
parseEnvironment(environment);
|
parseEnvironment(environment);
|
||||||
// 找到原始环境和数据源名称
|
// 找到原始环境和数据源名称
|
||||||
if (environment.id === this.request.environmentId && environment.id !== envId) {
|
if (environment.id === this.request.environmentId && environment.id !== envId) {
|
||||||
|
hasEnvironment = true;
|
||||||
if (environment.config && environment.config.databaseConfigs) {
|
if (environment.config && environment.config.databaseConfigs) {
|
||||||
environment.config.databaseConfigs.forEach((item) => {
|
environment.config.databaseConfigs.forEach((item) => {
|
||||||
if (item.id === this.request.dataSourceId) {
|
if (item.id === this.request.dataSourceId) {
|
||||||
|
@ -434,6 +436,9 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!hasEnvironment) {
|
||||||
|
this.request.environmentId = "";
|
||||||
|
}
|
||||||
this.initDataSource(envId, currentEnvironment, targetDataSourceName);
|
this.initDataSource(envId, currentEnvironment, targetDataSourceName);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -115,7 +115,5 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
:deep(.ace_text-layer){
|
|
||||||
padding:0px !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue