From 468491bffe20c0a858c7e2b6683454116b70a740 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 10 Mar 2020 15:35:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=88=97=E8=A1=A8=E8=B7=AF=E7=94=B1=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/components/report/RecentReport.vue | 2 +- .../performance/components/report/ReportView.vue | 13 ++++++++++++- .../src/performance/components/router/router.js | 9 +-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/frontend/src/performance/components/report/RecentReport.vue b/frontend/src/performance/components/report/RecentReport.vue index 7c856588ad..a099a69780 100644 --- a/frontend/src/performance/components/report/RecentReport.vue +++ b/frontend/src/performance/components/report/RecentReport.vue @@ -5,7 +5,7 @@ {{$t('load_test.recent')}} + :index="'/reportView/' + p.id" :route="{path: '/reportView/' + p.id}"> {{ p.name }} diff --git a/frontend/src/performance/components/report/ReportView.vue b/frontend/src/performance/components/report/ReportView.vue index 0575842e74..502fe5d72a 100644 --- a/frontend/src/performance/components/report/ReportView.vue +++ b/frontend/src/performance/components/report/ReportView.vue @@ -32,7 +32,7 @@ - + @@ -91,6 +91,17 @@ this.reportId = this.$route.path.split('/')[2]; this.initBreadcrumb(); }, + watch: { + '$route'(to) { + let reportId = to.path.split('/')[2]; // find testId + this.$get("report/test/pro/info/" + reportId, response => { + let data = response.data; + this.reportName = data.name; + this.testName = data.testName; + this.projectName = data.projectName; + }); + } + } } diff --git a/frontend/src/performance/components/router/router.js b/frontend/src/performance/components/router/router.js index 8334d96200..6b6524071f 100644 --- a/frontend/src/performance/components/router/router.js +++ b/frontend/src/performance/components/router/router.js @@ -119,16 +119,9 @@ const router = new VueRouter({ }, { path: "/reportView/:reportId", - name: "ReportView", + name: "reportView", components: { content: ReportView - }, - props: { - content: (route) => { - return { - ...route.params - } - } } }, ]