diff --git a/frontend/src/business/components/api/automation/scenario/EnvSelect.vue b/frontend/src/business/components/api/automation/scenario/EnvSelect.vue index 61c2bee5b1..2c1e25a4dc 100644 --- a/frontend/src/business/components/api/automation/scenario/EnvSelect.vue +++ b/frontend/src/business/components/api/automation/scenario/EnvSelect.vue @@ -57,7 +57,6 @@ export default { data() { return { data: [], - // result: {}, projects: [], environments: [], permissionProjectIds:[], @@ -159,122 +158,6 @@ export default { this.$emit('setProjectEnvMap', map); this.$emit('close'); }, - getApiInfo(request) { - if (request.id && request.referenced === 'REF') { - let requestResult = request.requestResult; - let url = request.refType && request.refType === 'CASE' ? "/api/testcase/get/" : "/api/definition/get/"; - let enable = request.enable; - this.$get(url + request.id, response => { - if (response.data) { - Object.assign(request, JSON.parse(response.data.request)); - request.name = response.data.name; - request.enable = enable; - if (response.data.path && response.data.path != null) { - request.path = response.data.path; - request.url = response.data.url; - this.setUrl(request.path); - } - if (response.data.method && response.data.method != null) { - request.method = response.data.method; - } - request.requestResult = requestResult; - request.id = response.data.id; - request.disabled = true; - request.root = true; - if (!request.projectId) { - request.projectId = response.data.projectId; - } - this.reload(); - this.sort(); - } else { - request.referenced = "Deleted"; - } - }) - } - }, - getScenario(scenario) { - this.result = this.$get("/api/automation/getApiScenario/" + scenario.id, response => { - if (response.data) { - scenario.loaded = true; - let obj = {}; - if (response.data.scenarioDefinition) { - obj = JSON.parse(response.data.scenarioDefinition); - scenario.hashTree = obj.hashTree; - } - //scenario.disabled = true; - scenario.name = response.data.name; - if (!scenario.projectId) { - scenario.projectId = response.data.projectId; - } - scenario.headers = obj.headers; - scenario.variables = obj.variables; - scenario.environmentMap = obj.environmentMap; - this.$emit('refReload'); - } else { - scenario.referenced = "Deleted"; - } - }) - }, - recursiveSorting(arr) { - for (let i in arr) { - if (arr[i].referenced === 'REF') { - // 分场景和接口 - if (arr[i].type === "HTTPSamplerProxy") { - // 获取源头内容 - this.getApiInfo(arr[i]); - // 校验是否是全路径 - if (!arr[i].url || (!arr[i].url.startsWith("http://") && !arr[i].url.startsWith("https://"))) { - this.isFullUrl = false; - } - } else if (arr[i].type === "scenario") { - this.getScenario(arr[i]); - } - - } else { - if (arr[i].type === "HTTPSamplerProxy") { - // 校验是否是全路径 - if (arr[i].enable) { - if (!arr[i].url || (!arr[i].url.startsWith("http://") && !arr[i].url.startsWith("https://"))) { - this.isFullUrl = false; - } - } - } - } - if (arr[i].hashTree != undefined && arr[i].hashTree.length > 0) { - this.recursiveSorting(arr[i].hashTree); - } - } - }, - checkFullUrl(scenarioDefinition) { - for (let i in scenarioDefinition) { - // 设置项目ID - let request = scenarioDefinition[i]; - if (request.referenced === 'REF') { - if (request.type === "HTTPSamplerProxy") { - this.getApiInfo(request); - // 校验是否是全路径 - if (!request.url || (!request.url.startsWith("http://") && !request.url.startsWith("https://"))) { - this.isFullUrl = false; - } - } else if (request.type === "scenario") { - this.getScenario(request); - } - } else { - if (request.type === "HTTPSamplerProxy") { - // 校验是否是全路径 - - if (request.enable) { - if (!request.url || (!request.url.startsWith("http://") && !request.url.startsWith("https://"))) { - this.isFullUrl = false; - } - } - } - } - if (scenarioDefinition[i].hashTree != undefined && scenarioDefinition[i].hashTree.length > 0) { - this.recursiveSorting(scenarioDefinition[i].hashTree); - } - } - }, checkEnv(data) { let sign = true; this.isFullUrl = true; diff --git a/frontend/src/business/components/track/plan/common/EnvPopover.vue b/frontend/src/business/components/track/plan/common/EnvPopover.vue deleted file mode 100644 index 7b11d53566..0000000000 --- a/frontend/src/business/components/track/plan/common/EnvPopover.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - 环境列表 - 环境组 - - - - - - {{ $t('api_test.definition.request.run_env') }} - - - - - - - - diff --git a/frontend/src/business/components/track/plan/common/EnvSelect.vue b/frontend/src/business/components/track/plan/common/EnvSelect.vue deleted file mode 100644 index cbdfd95f87..0000000000 --- a/frontend/src/business/components/track/plan/common/EnvSelect.vue +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - {{ $t('api_test.environment.environment_config') }} - - - - - {{ $t('api_test.environment.environment_config') }} - - - - - - {{ getProjectName(pe.id) }} - - - - - - - 确 定 - - - - - - - -