From a5de8cebbb878f36c8020c710d698b327f92c6f6 Mon Sep 17 00:00:00 2001 From: haifeng414 Date: Mon, 17 Feb 2020 16:55:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=97=E8=A1=A8=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E5=90=8D=E7=A7=B0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtLoadTestMapper.java | 5 +++-- .../base/mapper/ext/ExtLoadTestMapper.xml | 7 ++++++- .../request/testplan/QueryTestPlanRequest.java | 11 +++++++++++ .../java/io/metersphere/service/LoadTestService.java | 2 +- .../performance/components/testPlan/AllTestPlan.vue | 12 ++++++++---- 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java index 79129dca69..48aab649ad 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java @@ -1,10 +1,11 @@ package io.metersphere.base.mapper.ext; +import io.metersphere.controller.request.testplan.QueryTestPlanRequest; import io.metersphere.dto.LoadTestDTO; +import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.Map; public interface ExtLoadTestMapper { - List list(Map params); + List list(@Param("request") QueryTestPlanRequest params); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml index 9257708443..946015b527 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml @@ -7,10 +7,15 @@ - select load_test.*, project.name as project_name from load_test left join project on load_test.project_id = project.id + + + and load_test.name like CONCAT('%', #{request.name},'%') + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java b/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java index 0adcdca228..263690c957 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testplan/QueryTestPlanRequest.java @@ -1,4 +1,15 @@ package io.metersphere.controller.request.testplan; public class QueryTestPlanRequest extends TestPlanRequest { + private String name; + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } } diff --git a/backend/src/main/java/io/metersphere/service/LoadTestService.java b/backend/src/main/java/io/metersphere/service/LoadTestService.java index 99f5a36153..97a8d990ba 100644 --- a/backend/src/main/java/io/metersphere/service/LoadTestService.java +++ b/backend/src/main/java/io/metersphere/service/LoadTestService.java @@ -63,7 +63,7 @@ public class LoadTestService { } public List list(QueryTestPlanRequest request) { - return extLoadTestMapper.list(null); + return extLoadTestMapper.list(request); } public void delete(DeleteTestPlanRequest request) { diff --git a/frontend/src/performance/components/testPlan/AllTestPlan.vue b/frontend/src/performance/components/testPlan/AllTestPlan.vue index f6ce5fa241..65d0e6080f 100644 --- a/frontend/src/performance/components/testPlan/AllTestPlan.vue +++ b/frontend/src/performance/components/testPlan/AllTestPlan.vue @@ -6,8 +6,8 @@ 测试 - + @@ -97,8 +97,9 @@ }, methods: { initTableData() { - /// todo: 查询参数 - let param = {}; + let param = { + name: this.condition + }; this.$post(this.buildPagePath(this.queryPath), param).then(response => { if (response.data.success) { @@ -110,6 +111,9 @@ } }) }, + search() { + this.initTableData(); + }, buildPagePath(path) { return path + "/" + this.currentPage + "/" + this.pageSize; },