diff --git a/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue b/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue index 84ce0cdd70..c76a5eef13 100644 --- a/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue +++ b/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue @@ -193,7 +193,10 @@ export default { } if (this.currentProtocol != null) { this.condition.protocol = this.currentProtocol; + }else{ + this.condition.protocol = "HTTP"; } + let url = '/api/definition/list/'; if (this.isTestPlan) { url = '/api/definition/list/relevance/'; diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index e7abd10448..0688bfe066 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -341,10 +341,10 @@ } if (this.condition.projectId) { this.result = this.$post("/api/definition/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => { + this.genProtocalFilter(this.condition.protocol); this.total = response.data.itemCount; this.tableData = response.data.listObject; this.unSelection = response.data.listObject.map(s => s.id); - this.tableData.forEach(item => { if (item.tags && item.tags.length > 0) { item.tags = JSON.parse(item.tags); @@ -353,6 +353,48 @@ }); } }, + genProtocalFilter(protocalType){ + if(protocalType === "HTTP"){ + this.methodFilters = [ + {text: 'GET', value: 'GET'}, + {text: 'POST', value: 'POST'}, + {text: 'PUT', value: 'PUT'}, + {text: 'PATCH', value: 'PATCH'}, + {text: 'DELETE', value: 'DELETE'}, + {text: 'OPTIONS', value: 'OPTIONS'}, + {text: 'HEAD', value: 'HEAD'}, + {text: 'CONNECT', value: 'CONNECT'}, + ]; + }else if(protocalType === "TCP"){ + this.methodFilters = [ + {text: 'TCP', value: 'TCP'}, + ]; + }else if(protocalType === "SQL"){ + this.methodFilters = [ + {text: 'SQL', value: 'SQL'}, + ]; + }else if(protocalType === "DUBBO"){ + this.methodFilters = [ + {text: 'DUBBO', value: 'DUBBO'}, + {text: 'dubbo://', value: 'dubbo://'}, + ]; + }else{ + this.methodFilters = [ + {text: 'GET', value: 'GET'}, + {text: 'POST', value: 'POST'}, + {text: 'PUT', value: 'PUT'}, + {text: 'PATCH', value: 'PATCH'}, + {text: 'DELETE', value: 'DELETE'}, + {text: 'OPTIONS', value: 'OPTIONS'}, + {text: 'HEAD', value: 'HEAD'}, + {text: 'CONNECT', value: 'CONNECT'}, + {text: 'DUBBO', value: 'DUBBO'}, + {text: 'dubbo://', value: 'dubbo://'}, + {text: 'SQL', value: 'SQL'}, + {text: 'TCP', value: 'TCP'}, + ]; + } + }, getMaintainerOptions() { let workspaceId = localStorage.getItem(WORKSPACE_ID); this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {