From 41d308493b0fa52eabe32cde36a0ab2f3552d491 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 26 Aug 2021 18:14:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=9D=E5=AD=98=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E6=89=93=E5=BC=80=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/detail/component/ApiCaseFailureResult.vue | 4 ++-- .../detail/component/ApiScenarioFailureResult.vue | 4 ++-- .../report/detail/component/FunctionalCases.vue | 4 ++-- .../report/detail/component/FunctionalIssueList.vue | 2 +- .../report/detail/component/LoadFailureResult.vue | 4 ++-- .../track/report/components/TestPlanDbReport.vue | 12 +++++++++--- .../track/report/components/TestPlanReportReview.vue | 8 +++++--- frontend/src/network/load-test.js | 10 +++++----- 8 files changed, 28 insertions(+), 20 deletions(-) diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue index d6c3632fb2..2ac9202656 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiCaseFailureResult.vue @@ -110,9 +110,9 @@ export default { getScenarioApiCase() { if (this.isTemplate || this.isDb) { if (this.isAll) { - this.apiCases = this.report.apiAllCases; + this.apiCases = this.report.apiAllCases ? this.report.apiAllCases : []; } else { - this.apiCases = this.report.apiFailureCases; + this.apiCases = this.report.apiFailureCases ? this.report.apiFailureCases : []; } } else if (this.isShare) { if (this.isAll) { diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue index c7199311fe..54256dceb5 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue @@ -106,9 +106,9 @@ export default { getScenarioApiCase() { if (this.isTemplate || this.isDb) { if (this.isAll) { - this.scenarioCases = this.report.scenarioAllCases; + this.scenarioCases = this.report.scenarioAllCases ? this.report.scenarioAllCases : []; } else { - this.scenarioCases = this.report.scenarioFailureCases; + this.scenarioCases = this.report.scenarioFailureCases ? this.report.scenarioFailureCases : []; } } else if (this.isShare) { if (this.isAll) { diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/FunctionalCases.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/FunctionalCases.vue index d0227125b9..8f3ff1cd65 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/FunctionalCases.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/FunctionalCases.vue @@ -106,9 +106,9 @@ export default { getFunctionalTestCase() { if (this.isTemplate || this.isDb) { if (this.isAll) { - this.testCases = this.report.functionAllCases; + this.testCases = this.report.functionAllCases ? this.report.functionAllCases : []; } else { - this.testCases = this.report.functionFailureCases; + this.testCases = this.report.functionFailureCases ? this.report.functionFailureCases : []; } } else if (this.isShare) { if (this.isAll) { diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/FunctionalIssueList.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/FunctionalIssueList.vue index 067e4d0e64..bf652ba69a 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/FunctionalIssueList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/FunctionalIssueList.vue @@ -87,7 +87,7 @@ export default { methods: { getIssues() { if (this.isTemplate || this.isDb) { - this.data = this.report.issueList; + this.data = this.report.issueList ? this.report.issueList : []; } else if (this.isShare) { this.result = getShareIssuesByPlanId(this.shareId, this.planId, (data) => { this.data = data; diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadFailureResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadFailureResult.vue index 7ee3640066..950410ba7f 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadFailureResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadFailureResult.vue @@ -88,9 +88,9 @@ export default { getFailureTestCase() { if (this.isTemplate || this.isDb) { if (this.isAll) { - this.loadTestCases = this.report.loadAllCases; + this.loadTestCases = this.report.loadAllCases ? this.report.loadAllCases : []; } else { - this.loadTestCases = this.report.loadFailureCases; + this.loadTestCases = this.report.loadFailureCases ? this.report.loadFailureCases : []; } } else if (this.isShare) { if (this.isAll) { diff --git a/frontend/src/business/components/track/report/components/TestPlanDbReport.vue b/frontend/src/business/components/track/report/components/TestPlanDbReport.vue index 73c74c7333..5165725bcd 100644 --- a/frontend/src/business/components/track/report/components/TestPlanDbReport.vue +++ b/frontend/src/business/components/track/report/components/TestPlanDbReport.vue @@ -23,7 +23,7 @@
- +
@@ -43,7 +43,8 @@ export default { result: {}, showDialog: false, report: {}, - isTestManagerOrTestUser: false + isTestManagerOrTestUser: false, + showReport: false } }, mounted() { @@ -61,7 +62,12 @@ export default { // this.handleClose(); // }, open(report) { - this.report = report; + this.showReport = false; + // 每次都重新获取 + this.$nextTick(() => { + this.showReport = true; + this.report = report; + }); this.showDialog = true; // this.listenGoBack(); }, diff --git a/frontend/src/business/components/track/report/components/TestPlanReportReview.vue b/frontend/src/business/components/track/report/components/TestPlanReportReview.vue index d4ecee8114..e19ca5d648 100644 --- a/frontend/src/business/components/track/report/components/TestPlanReportReview.vue +++ b/frontend/src/business/components/track/report/components/TestPlanReportReview.vue @@ -23,7 +23,7 @@
- +
@@ -43,7 +43,8 @@ export default { result: {}, showDialog: false, plan: {}, - isTestManagerOrTestUser: false + isTestManagerOrTestUser: false, + showReport: false } }, mounted() { @@ -61,9 +62,10 @@ export default { // this.handleClose(); // }, open(plan) { + this.showReport = false; // 每次都重新获取 - this.plan = {id: null} this.$nextTick(() => { + this.showReport = true; this.plan = plan; }); this.showDialog = true; diff --git a/frontend/src/network/load-test.js b/frontend/src/network/load-test.js index 50e9452151..9ad94d82a1 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) : new Promise(()=>{}); + 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) : new Promise(()=>{}); + 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) : new Promise(()=>{}); + 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) : new Promise(()=>{}); + 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) : new Promise(()=>{}); + return resourceId ? baseGet('/share/metric/query/' + shareId + '/' + resourceId, callback) : new Promise(() => {}); }