From 1552c23b34e34bba770aff21497c25338691a879 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 18 Jan 2022 19:39:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94):=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=89=88=E6=9C=AC=E5=90=8D=E7=A7=B0=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=BA=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 增加版本名称操作人时间 --- .../automation/scenario/EditApiScenario.vue | 54 +- .../api/automation/version/ScenarioDiff.vue | 641 +++++++++--------- .../complete/version/DubboApiVersionDiff.vue | 204 +++--- .../complete/version/HttpApiVersionDiff.vue | 462 +++++++------ .../complete/version/SQLApiVersionDiff.vue | 206 +++--- .../complete/version/TCPApiVersionDiff.vue | 308 +++++---- .../performance/test/DiffVersion.vue | 12 +- 7 files changed, 975 insertions(+), 912 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 3626c3d247..d0597143cb 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -354,7 +354,8 @@ :new-scenario-definition="newScenarioDefinition" :project-env-map="projectEnvMap" :new-project-env-map="newProjectEnvMap" - :type="type" + :project-list="projectList" + :type ="type" > @@ -1740,33 +1741,38 @@ export default { }); }, compare(row) { - this.$get('/api/automation/get/' + row.id + "/" + this.currentScenario.refId, response => { - this.$get("/api/automation/getApiScenario/" + response.data.id, res => { - if (res.data) { - if (res.data.scenarioDefinition != null) { - let obj = JSON.parse(res.data.scenarioDefinition); - if (obj) { - if (obj.hashTree) { - for (let i = 0; i < obj.hashTree.length; i++) { - obj.hashTree[i].disabled = true; + this.$get('/api/automation/get/' + row.id+"/"+this.currentScenario.refId, response => { + this.$get("/api/automation/getApiScenario/" + response.data.id, res => { + if (res.data) { + if(res.data.scenarioDefinition != null){ + let obj = JSON.parse(res.data.scenarioDefinition); + if(obj){ + if(obj.hashTree){ + for (let i = 0; i < obj.hashTree.length; i++) { + obj.hashTree[i].disabled = true; + if (!obj.hashTree[i].requestResult) { + obj.hashTree[i].requestResult = [{responseResult: {}}]; + } + } + } + for (let i = 0; i < this.scenarioDefinition.length; i++) { + this.scenarioDefinition[i].disabled = true; + } + this.newScenarioDefinition = obj.hashTree; + + if (response.data.environmentJson) { + this.newProjectEnvMap = objToStrMap(JSON.parse(response.data.environmentJson)); + } else { + // 兼容历史数据 + this.newProjectEnvMap.set(this.projectId, obj.environmentId); } } - for (let i = 0; i < this.scenarioDefinition.length; i++) { - this.scenarioDefinition[i].disabled = true; - } - this.newScenarioDefinition = obj.hashTree; - if (response.data.environmentJson) { - this.newProjectEnvMap = objToStrMap(JSON.parse(response.data.environmentJson)); - } else { - // 兼容历史数据 - this.newProjectEnvMap.set(this.projectId, obj.environmentId); - } } + res.data.userName = response.data.userName + this.newData = res.data; + this.dialogVisible = true; } - this.newData = res.data; - this.dialogVisible = true; - } - }); + }); }) }, checkout(row) { diff --git a/frontend/src/business/components/api/automation/version/ScenarioDiff.vue b/frontend/src/business/components/api/automation/version/ScenarioDiff.vue index 1893edd58e..4b9a8c99d4 100644 --- a/frontend/src/business/components/api/automation/version/ScenarioDiff.vue +++ b/frontend/src/business/components/api/automation/version/ScenarioDiff.vue @@ -1,149 +1,158 @@