chore: sync

This commit is contained in:
guoyuqi 2021-11-18 20:18:27 +08:00 committed by xiaomeinvG
parent d88fd1c25a
commit 25f76e9b93
3 changed files with 54 additions and 3 deletions

View File

@ -471,6 +471,7 @@ export default {
change = change + 1;
this.$store.state.scenarioMap.set(this.currentScenario.id, change);
}
},
deep: true
},
@ -1379,7 +1380,7 @@ export default {
this.onSampleError = obj.onSampleError;
}
this.dataProcessing(obj.hashTree);
this.addNum(obj.hashTree);
this.scenarioDefinition = obj.hashTree;
}
}
@ -1635,6 +1636,56 @@ export default {
});
}
}
},
addNum(hashTree){
for (let i = 0; i < hashTree.length; i++) {
let data = hashTree[i];
if(!data.num){
if(data.refType){
if(data.refType==='API'){
let promise = this.getApiDefinitionNumById(data.id);
promise.then(result =>{
this.$set(data,'num',result);
});
}else if(data.refType==='CASE'){
let promise = this.getApiTestCaseNumById(data.id);
promise.then(result =>{
this.$set(data,'num',result);
});
}
}else {
let promise = this.getScenarioNumById(data.id);
promise.then(result =>{
this.$set(data,'num',result);
});
}
}
}
},
getApiDefinitionNumById(id){
return new Promise((resolve) => {
let url = '/api/definition/get/'+id;
this.$get(url, response => {
resolve(response.data.num);
});
});
},
getApiTestCaseNumById(id){
return new Promise((resolve) => {
let url = '/api/testcase/findById/'+id;
this.$get(url, response => {
resolve(response.data.num);
});
});
},
getScenarioNumById(id){
return new Promise((resolve) => {
let url = '/api/automation/getApiScenario/'+id;
this.$get(url, response => {
resolve(response.data.num);
});
});
}
}
}

View File

@ -6,7 +6,6 @@
<div class="el-step__icon-inner">{{ data.index }}</div>
</div>
<el-tag class="ms-left-btn" size="small" :style="{'color': color, 'background-color': backgroundColor}">{{ title }}</el-tag>
<el-tag size="mini" v-if="data.method && !data.pluginId">{{ getMethod() }}</el-tag>
</slot>
<slot name="behindHeaderLeft" v-if="!isMax"></slot>
<span>
@ -22,6 +21,7 @@
<el-tooltip placement="top" :content="data.name">
<span>{{ data.name }}</span>
</el-tooltip>
<el-tag size="mini" v-if="data.method && !data.pluginId">{{ getMethod() }}</el-tag>
</span>
</slot>

View File

@ -608,7 +608,7 @@ export default {
}
.ms-tag {
margin-left: 10px;
margin-left: 0px;
}
.ms-step-debug-code {