refactor(接口测试): 不同请求颜色区分

This commit is contained in:
chenjianxing 2020-10-14 12:40:50 +08:00
parent 08b973c03e
commit d58990bb16
1 changed files with 13 additions and 2 deletions

View File

@ -9,7 +9,7 @@
<div class="request-type"> <div class="request-type">
{{ request.showType() }} {{ request.showType() }}
</div> </div>
<div class="request-method"> <div class="request-method" :style="{'color': getColor(request.enable, request.showMethod())}">
{{ request.showMethod() }} {{ request.showMethod() }}
</div> </div>
<div class="request-name"> <div class="request-name">
@ -85,7 +85,13 @@ export default {
selected: 0, selected: 0,
visible: false, visible: false,
types: RequestFactory.TYPES, types: RequestFactory.TYPES,
type: "" type: "",
methodColorMap: new Map([
['GET', "#61AFFE"], ['POST', '#49CC90'], ['PUT', '#fca130'],
['PATCH', '#E2EE11'], ['DELETE', '#f93e3d'], ['OPTIONS', '#0EF5DA'],
['HEAD', '#8E58E7'], ['CONNECT', '#90AFAE'],
['DUBBO', '#C36EEF'],['SQL', '#0AEAD4'],['TCP', '#0A52DF'],
])
} }
}, },
@ -156,6 +162,11 @@ export default {
break; break;
} }
}, },
getColor(enable, method) {
if (enable) {
return this.methodColorMap.get(method);
}
},
select(request) { select(request) {
if (!request) { if (!request) {
return; return;