fix(接口自动化): 场景步骤协议展示及另存为新接口问题修复

This commit is contained in:
fit2-zhao 2021-03-23 18:20:31 +08:00
parent 478c98ac21
commit 4640746de5
3 changed files with 19 additions and 3 deletions

View File

@ -244,6 +244,9 @@
});
},
list(data) {
if (data.protocol === "dubbo://") {
data.protocol = "DUBBO";
}
let url = "/api/module/list/" + getCurrentProjectID() + "/" + data.protocol;
this.result = this.$get(url, response => {
if (response.data != undefined && response.data != null) {

View File

@ -6,7 +6,7 @@
<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.method}}</el-tag>
<el-tag size="mini" v-if="data.method">{{getMethod()}}</el-tag>
</slot>
<span>
@ -125,6 +125,17 @@
//this.$set(this.data, 'active', !this.data.active);
this.$emit('active');
},
getMethod() {
if (this.data.protocol === "HTTP") {
return this.data.method;
}
else if (this.data.protocol === "dubbo://") {
return "DUBBO";
}
else {
return this.data.protocol;
}
},
copyRow() {
this.$emit('copy');
},

View File

@ -13,7 +13,7 @@
</el-dropdown-menu>
</el-dropdown>
<ms-variable-list ref="scenarioParameters"/>
<ms-add-basis-api ref="api"/>
<ms-add-basis-api :currentProtocol="currentProtocol" ref="api"/>
</div>
</template>
@ -32,6 +32,7 @@
data() {
return {
allSamplers: ELEMENTS.get('AllSamplerProxy'),
currentProtocol: "HTTP",
}
},
methods: {
@ -63,7 +64,8 @@
}
});
},
saveAsApi(){
saveAsApi() {
this.currentProtocol = this.data.protocol;
this.$refs.api.open(this.data);
}
}