From 998750d77f728a3a4498df66d4c7fd7ec3fe1608 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 4 Aug 2020 17:35:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/service/PerformanceTestService.java | 12 +++++++----- ..._modify_schedule.sql => V10__modify_schedule.sql} | 0 ...V10__add_test_case.sql => V11__add_test_case.sql} | 0 .../components/api/home/ApiTestScheduleList.vue | 6 +++--- .../performance/home/PerformanceTestHome.vue | 5 +++++ 5 files changed, 15 insertions(+), 8 deletions(-) rename backend/src/main/resources/db/migration/{V9__modify_schedule.sql => V10__modify_schedule.sql} (100%) rename backend/src/main/resources/db/migration/{V10__add_test_case.sql => V11__add_test_case.sql} (100%) diff --git a/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java b/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java index 380b5bbaa1..6625dc899b 100644 --- a/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java +++ b/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java @@ -424,11 +424,13 @@ public class PerformanceTestService { List resourceIds = schedules.stream() .map(Schedule::getResourceId) .collect(Collectors.toList()); - LoadTestExample example = new LoadTestExample(); - example.createCriteria().andIdIn(resourceIds); - List loadTests = loadTestMapper.selectByExample(example); - Map loadTestMap = loadTests.stream().collect(Collectors.toMap(LoadTest::getId, LoadTest::getName)); - scheduleService.build(loadTestMap, schedules); + if (!resourceIds.isEmpty()) { + LoadTestExample example = new LoadTestExample(); + example.createCriteria().andIdIn(resourceIds); + List loadTests = loadTestMapper.selectByExample(example); + Map loadTestMap = loadTests.stream().collect(Collectors.toMap(LoadTest::getId, LoadTest::getName)); + scheduleService.build(loadTestMap, schedules); + } return schedules; } } diff --git a/backend/src/main/resources/db/migration/V9__modify_schedule.sql b/backend/src/main/resources/db/migration/V10__modify_schedule.sql similarity index 100% rename from backend/src/main/resources/db/migration/V9__modify_schedule.sql rename to backend/src/main/resources/db/migration/V10__modify_schedule.sql diff --git a/backend/src/main/resources/db/migration/V10__add_test_case.sql b/backend/src/main/resources/db/migration/V11__add_test_case.sql similarity index 100% rename from backend/src/main/resources/db/migration/V10__add_test_case.sql rename to backend/src/main/resources/db/migration/V11__add_test_case.sql diff --git a/frontend/src/business/components/api/home/ApiTestScheduleList.vue b/frontend/src/business/components/api/home/ApiTestScheduleList.vue index 3dc5d2e9af..1495f1e11a 100644 --- a/frontend/src/business/components/api/home/ApiTestScheduleList.vue +++ b/frontend/src/business/components/api/home/ApiTestScheduleList.vue @@ -63,7 +63,7 @@ }, link(row) { this.$router.push({ - path: this.operators.linkUrl + '?id=' + row.resourceId, + path: this.operators.linkUrl + row.resourceId, }) }, update(schedule) { @@ -76,12 +76,12 @@ case SCHEDULE_TYPE.API_TEST: this.operators.listUrl = '/api/list/schedule'; this.operators.updateUrl = '/api/schedule/update'; - this.operators.linkUrl = '/api/test/edit'; + this.operators.linkUrl = '/api/test/edit?id='; break; case SCHEDULE_TYPE.PERFORMANCE_TEST: this.operators.listUrl = '/performance/list/schedule'; this.operators.updateUrl = '/performance/schedule/update'; - this.operators.linkUrl = '/performance//test/edit'; + this.operators.linkUrl = '/performance/test/edit/'; break; default: break; diff --git a/frontend/src/business/components/performance/home/PerformanceTestHome.vue b/frontend/src/business/components/performance/home/PerformanceTestHome.vue index eb1d86f900..b439c7cd1c 100644 --- a/frontend/src/business/components/performance/home/PerformanceTestHome.vue +++ b/frontend/src/business/components/performance/home/PerformanceTestHome.vue @@ -13,6 +13,9 @@ + + + @@ -25,10 +28,12 @@ import MsPerformanceTestRecentList from "./PerformanceTestRecentList" import MsPerformanceReportRecentList from "./PerformanceReportRecentList" import MsTestHeatmap from "../../common/components/MsTestHeatmap"; + import MsApiTestScheduleList from "../../api/home/ApiTestScheduleList"; export default { name: "PerformanceTestHome", components: { + MsApiTestScheduleList, MsTestHeatmap, MsMainContainer, MsContainer,