fix(接口测试): 解决场景版本对比关闭窗口编辑页面不能编辑问题--github#10216

--bug=1010099--user=郭雨琦【ID1010099】【接口测试】github#10216,进行版本对比后,关闭对比窗口,当前场景用例的请求参数栏无法进行编辑
This commit is contained in:
guoyuqi 2022-01-28 16:20:31 +08:00 committed by CountryBuilder
parent 780f51659a
commit 4ca70d0105
1 changed files with 14 additions and 6 deletions

View File

@ -344,15 +344,16 @@
:fullscreen="true"
:visible.sync="dialogVisible"
:destroy-on-close="true"
@close="closeDiff"
width="100%"
>
<scenario-diff
v-if="dialogVisible"
:old-data="currentScenario"
:old-data="oldData"
:new-data="newData"
:custom-num="customNum"
:module-options="moduleOptions"
:old-scenario-definition="scenarioDefinition"
:old-scenario-definition="oldScenarioDefinition"
:new-scenario-definition="newScenarioDefinition"
:project-env-map="projectEnvMap"
:new-project-env-map="newProjectEnvMap"
@ -521,8 +522,10 @@ export default {
executeType: "",
versionData: [],
newData: [],
oldData:[],
dialogVisible: false,
newScenarioDefinition: [],
oldScenarioDefinition:[],
currentItem: {},
pluginDelStep: false
}
@ -1473,6 +1476,7 @@ export default {
}
this.dataProcessing(obj.hashTree);
this.scenarioDefinition = obj.hashTree;
this.oldScenarioDefinition = obj.hashTree;
}
}
if (this.currentScenario.copy) {
@ -1780,11 +1784,11 @@ export default {
this.newOnSampleError = obj.onSampleError;
}
}
for (let i = 0; i < this.scenarioDefinition.length; i++) {
this.scenarioDefinition[i].disabled = true;
}
this.newScenarioDefinition = obj.hashTree;
this.newScenarioDefinition = obj.hashTree;
for (let i = 0; i < this.oldScenarioDefinition.length; i++) {
this.oldScenarioDefinition[i].disabled = true;
}
if (response.data.environmentJson) {
this.newProjectEnvMap = objToStrMap(JSON.parse(response.data.environmentJson));
} else {
@ -1795,6 +1799,7 @@ export default {
}
res.data.userName = response.data.userName
this.dealWithTag(res.data);
this.oldData = this.currentScenario;
this.newData = res.data;
this.closeExpansion()
this.dialogVisible = true;
@ -1802,6 +1807,9 @@ export default {
});
})
},
closeDiff(){
this.oldScenarioDefinition = []
},
dealWithTag(newScenario){
if(newScenario.tags){
if(Object.prototype.toString.call(newScenario.tags)==="[object String]"){