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