From 0675e591e3e6183fff00ca05803b727f2c56d13b Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 26 Aug 2021 16:48:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=8A=A5=E5=91=8A=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E9=83=BD=E9=87=8D=E6=96=B0=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtTestPlanApiCaseMapper.xml | 7 ++++--- .../base/mapper/ext/ExtTestPlanTestCaseMapper.xml | 1 + .../io/metersphere/track/service/TestPlanService.java | 4 ++++ .../comonents/functional/FunctionalTestCaseList.vue | 4 +++- .../comonents/report/detail/TestPlanReportContent.vue | 2 +- .../track/report/components/TestPlanReportReview.vue | 6 +++++- frontend/src/common/js/default-table-header.js | 1 - frontend/src/network/load-test.js | 10 +++++----- 8 files changed, 23 insertions(+), 12 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml index 429d773f17..c784654ec5 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml @@ -262,9 +262,10 @@ api_test_case c on t.api_case_id = c.id and t.test_plan_id = #{planId} - - and t.status = 'error' - + + and t.status = 'error' + + and c.status != 'Trash' where t.test_plan_id = #{planId}; diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml index 2459cfc972..5d86e28ee0 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml @@ -477,6 +477,7 @@ and tptc.status = 'Failure' + and tc.status != 'Trash' where tptc.plan_id = #{planId} order by tptc.update_time desc diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index bd722b199a..2fb42eff03 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -239,6 +239,10 @@ public class TestPlanService { } // 非已结束->已结束,更新结束时间 } + if (StringUtils.isNotBlank(testPlan.getStatus()) && testPlan.getStatus().equals(TestPlanStatus.Prepare.name())) { + testPlan.setActualStartTime(null); + testPlan.setActualEndTime(null); + } int i; if (testPlan.getName() == null) {// 若是点击该测试计划,则仅更新了updateTime,其它字段全为null,使用updateByPrimaryKeySelective diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue index 288964ccbd..23c2444d96 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue @@ -470,7 +470,9 @@ export default { this.$set(this.tableData[i], "issuesContent", JSON.parse(this.tableData[i].issues)); } } - this.$refs.table.clear(); + if (this.$refs.table) { + this.$refs.table.clear(); + } checkTableRowIsSelected(this, this.$refs.table); }); } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent.vue index 4ad8a86e2f..4766e95c2f 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent.vue @@ -3,7 +3,7 @@ + v-if="!isTemplate && !isShare"/> diff --git a/frontend/src/business/components/track/report/components/TestPlanReportReview.vue b/frontend/src/business/components/track/report/components/TestPlanReportReview.vue index 2da7d26d69..d4ecee8114 100644 --- a/frontend/src/business/components/track/report/components/TestPlanReportReview.vue +++ b/frontend/src/business/components/track/report/components/TestPlanReportReview.vue @@ -61,7 +61,11 @@ export default { // this.handleClose(); // }, open(plan) { - this.plan = plan; + // 每次都重新获取 + this.plan = {id: null} + this.$nextTick(() => { + this.plan = plan; + }); this.showDialog = true; // this.listenGoBack(); }, diff --git a/frontend/src/common/js/default-table-header.js b/frontend/src/common/js/default-table-header.js index 7f6ea8e44c..1ae25e6375 100644 --- a/frontend/src/common/js/default-table-header.js +++ b/frontend/src/common/js/default-table-header.js @@ -136,7 +136,6 @@ export let CUSTOM_TABLE_HEADER = { {id: 'priority', key: '3', label: 'test_track.case.priority'}, {id: 'path', key: '4', label: 'api_test.definition.api_path'}, {id: 'createUser', key: '5', label: 'api_test.creator'}, - {id: 'custom', key: '6', label: 'api_test.definition.api_last_time'}, {id: 'tags', key: '7', label: 'commons.tag'}, {id: 'execResult', key: '8', label: 'test_track.plan.execute_result'}, {id: 'maintainer', key: '9', label: 'api_test.definition.request.responsible'}, diff --git a/frontend/src/network/load-test.js b/frontend/src/network/load-test.js index 4f21ee0753..50e9452151 100644 --- a/frontend/src/network/load-test.js +++ b/frontend/src/network/load-test.js @@ -71,10 +71,10 @@ export function getSharePerformanceReportResponseCodeChart(shareId, reportId, ca } export function getPerformanceReportDetailContent(reportKey, reportId, callback) { - return reportId ? baseGet('/performance/report/content/' + reportKey + '/' + reportId, callback) : {}; + return reportId ? baseGet('/performance/report/content/' + reportKey + '/' + reportId, callback) : new Promise(()=>{}); } export function getSharePerformanceReportDetailContent(shareId, reportKey, reportId, callback) { - return reportId ? baseGet('/share/performance/report/content/' + shareId + '/' + reportKey + '/' + reportId, callback) : {}; + return reportId ? baseGet('/share/performance/report/content/' + shareId + '/' + reportKey + '/' + reportId, callback) : new Promise(()=>{}); } export function getPerformanceReportContent(reportId, callback) { @@ -113,15 +113,15 @@ export function getSharePerformanceReportLogResourceDetail(shareId, reportId, re } export function getPerformanceMetricQueryResource(resourceId, callback) { - return resourceId ? baseGet('/metric/query/resource/' + resourceId, callback) : {}; + return resourceId ? baseGet('/metric/query/resource/' + resourceId, callback) : new Promise(()=>{}); } export function getSharePerformanceMetricQueryResource(shareId, resourceId, callback) { - return resourceId ? baseGet('/share/metric/query/resource/' + shareId + '/' + resourceId, callback) : {}; + return resourceId ? baseGet('/share/metric/query/resource/' + shareId + '/' + resourceId, callback) : new Promise(()=>{}); } export function getPerformanceMetricQuery(resourceId, callback) { return resourceId ? baseGet('/metric/query/' + resourceId, callback) : {}; } export function getSharePerformanceMetricQuery(shareId, resourceId, callback) { - return resourceId ? baseGet('/share/metric/query/' + shareId + '/' + resourceId, callback) : {}; + return resourceId ? baseGet('/share/metric/query/' + shareId + '/' + resourceId, callback) : new Promise(()=>{}); }