From 9cc2a9d9f1adf45ea7e85b3d59950bb7784e0ba4 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 22 Apr 2020 10:30:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=BF=90=E8=A1=8C=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=9A=84log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/PerformanceReportView.vue | 64 +++++++++++++------ 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 58a63cc689..7e3b1e3023 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -49,6 +49,13 @@ + + + + {{item}} + + + @@ -79,15 +86,18 @@ startTime: '0', endTime: '0', minutes: '0', - seconds: '0' + seconds: '0', + title: 'Logging', + testLogging: null, + showTestLogging: false, } }, methods: { initBreadcrumb() { - if(this.reportId){ + if (this.reportId) { this.result = this.$get("/performance/report/test/pro/info/" + this.reportId, res => { let data = res.data; - if(data){ + if (data) { this.reportName = data.name; this.testName = data.testName; this.projectName = data.projectName; @@ -96,10 +106,10 @@ } }, initReportTimeInfo() { - if(this.reportId){ + if (this.reportId) { this.result = this.$get("/performance/report/content/report_time/" + this.reportId, res => { let data = res.data; - if(data){ + if (data) { this.startTime = data.startTime; this.endTime = data.endTime; let duration = data.duration; @@ -108,6 +118,11 @@ } }) } + }, + getLog(testId) { + this.$get('/performance/log/' + testId, response => { + this.testLogging = response.data; + }) } }, mounted() { @@ -115,16 +130,25 @@ this.$get("/performance/report/" + this.reportId, res => { let data = res.data; this.status = data.status; - if (data.status === "Error") { - this.$message({ - type: 'warning', - message: "报告生成错误,无法查看!" - }); - } else if (data.status === "Starting") { - this.$message({ - type: 'info', - message: "报告生成中...." - }); + switch (data.status) { + case 'Error': + this.$message({ + type: 'warning', + message: "报告生成错误,无法查看!" + }); + break; + case 'Starting': + this.$message({ + type: 'info', + message: "报告生成中...." + }); + break; + case 'Running': + this.showTestLogging = true; + this.getLog(data.testId); + break; + default: + break; } }) this.initBreadcrumb(); @@ -133,10 +157,10 @@ watch: { '$route'(to) { let reportId = to.path.split('/')[4]; - if(reportId){ + if (reportId) { this.$get("/performance/report/test/pro/info/" + reportId, response => { let data = response.data; - if(data){ + if (data) { this.reportName = data.name; this.testName = data.testName; this.projectName = data.projectName; @@ -144,7 +168,7 @@ }); this.result = this.$get("/performance/report/content/report_time/" + this.reportId, res => { let data = res.data; - if(data){ + if (data) { this.startTime = data.startTime; this.endTime = data.endTime; let duration = data.duration; @@ -170,4 +194,8 @@ display: block; color: #5C7878; } + + .logging-content { + white-space: pre-line; + }