fix(接口测试): 修复场景定时任务选择环境和资源池后不回显的缺陷

--bug=1012262 --user=王孝刚
【接口测试】场景设置定时任务-运行环境和资源池都选择,保存后再次查看,看不到所选运行环境和资源池
https://www.tapd.cn/55049933/s/1137550
This commit is contained in:
wxg0103 2022-04-18 11:31:00 +08:00 committed by 刘瑞斌
parent 9c5d8d69dd
commit c979d8d047
2 changed files with 14 additions and 5 deletions

View File

@ -179,6 +179,7 @@ public class ScheduleService {
schedule.setUserId(SessionUtils.getUser().getId()); schedule.setUserId(SessionUtils.getUser().getId());
schedule.setProjectId(request.getProjectId()); schedule.setProjectId(request.getProjectId());
schedule.setWorkspaceId(request.getWorkspaceId()); schedule.setWorkspaceId(request.getWorkspaceId());
schedule.setConfig(request.getConfig());
return schedule; return schedule;
} }

View File

@ -49,7 +49,7 @@
<env-popover :project-ids="projectIds" <env-popover :project-ids="projectIds"
:placement="'bottom-start'" :placement="'bottom-start'"
:project-list="projectList" :project-list="projectList"
:project-env-map="projectEnvListMap" :env-map="projectEnvListMap"
:environment-type.sync="runConfig.environmentType" :environment-type.sync="runConfig.environmentType"
:group-id="runConfig.environmentGroupId" :group-id="runConfig.environmentGroupId"
:has-option-group="true" :has-option-group="true"
@ -190,13 +190,13 @@ export default {
onSampleError: false, onSampleError: false,
runWithinResourcePool: false, runWithinResourcePool: false,
resourcePoolId: null, resourcePoolId: null,
envMap: new Map, envMap: {},
environmentGroupId: "", environmentGroupId: "",
environmentType: ENV_TYPE.JSON environmentType: ENV_TYPE.JSON
}, },
projectList: [], projectList: [],
projectIds: new Set(), projectIds: new Set(),
projectEnvListMap: {}, projectEnvListMap: new Map,
} }
}, },
methods: { methods: {
@ -325,8 +325,16 @@ export default {
if (response.data != null) { if (response.data != null) {
this.schedule = response.data; this.schedule = response.data;
if (response.data.config) { if (response.data.config) {
this.runConfig = JSON.parse(response.data.config); let data = JSON.parse(response.data.config);
this.runConfig.envMap = new Map; this.runConfig.environmentGroupId = data.environmentGroupId;
this.runConfig.environmentType = data.environmentType;
if (data.envMap) {
this.projectEnvListMap = objToStrMap(data.envMap);
} else {
this.projectEnvListMap = new Map;
}
this.runConfig.runWithinResourcePool = data.runWithinResourcePool;
this.runConfig.resourcePoolId = data.resourcePoolId;
} }
} else { } else {
this.schedule = { this.schedule = {