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