From 437c1e28bdb64bc70b0ff77e9ee6b4f59c1d0424 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 7 Apr 2021 17:34:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A5=E5=91=8A=E5=AF=B9=E6=AF=94=E6=97=B6?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=BC=93=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/PerformanceReportView.vue | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index d7934bc6b2..dc5f76438a 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -317,6 +317,28 @@ export default { }, compareReports() { this.$refs.compareReports.open(this.report); + }, + getReport(reportId) { + this.result = this.$get("/performance/report/" + reportId, res => { + let data = res.data; + if (data) { + this.status = data.status; + this.$set(this.report, "id", data.id); + this.$set(this.report, "status", data.status); + this.$set(this.report, "testId", data.testId); + this.$set(this.report, "name", data.name); + this.$set(this.report, "createTime", data.createTime); + this.$set(this.report, "loadConfiguration", data.loadConfiguration); + this.checkReportStatus(data.status); + if (this.status === "Completed" || this.status === "Running") { + this.initReportTimeInfo(); + } + this.initBreadcrumb(); + this.initWebSocket(); + } else { + this.$error(this.$t('report.not_exist')) + } + }); } }, created() { @@ -325,27 +347,7 @@ export default { this.isReadOnly = true; } this.reportId = this.$route.path.split('/')[4]; - this.result = this.$get("/performance/report/" + this.reportId, res => { - let data = res.data; - if (data) { - this.status = data.status; - this.$set(this.report, "id", this.reportId); - this.$set(this.report, "status", data.status); - this.$set(this.report, "testId", data.testId); - this.$set(this.report, "name", data.name); - this.$set(this.report, "createTime", data.createTime); - this.$set(this.report, "loadConfiguration", data.loadConfiguration); - this.checkReportStatus(data.status); - if (this.status === "Completed" || this.status === "Running") { - this.initReportTimeInfo(); - } - this.initBreadcrumb(); - this.initWebSocket(); - } else { - this.$error(this.$t('report.not_exist')) - } - }); - + this.getReport(this.reportId); }, watch: { '$route'(to) { @@ -354,14 +356,10 @@ export default { if (!checkoutTestManagerOrTestUser()) { this.isReadOnly = true; } - let reportId = to.path.split('/')[4]; - this.reportId = reportId; + this.reportId = to.path.split('/')[4]; + this.getReport(this.reportId); this.initBreadcrumb((response) => { let data = response.data; - - this.$set(this.report, "id", reportId); - this.$set(this.report, "status", data.status); - this.checkReportStatus(data.status); this.initReportTimeInfo(); });