From aaeacb0b113b6d678a6b697c9b8ca4edd6a088a0 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 8 Nov 2022 14:20:18 +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=98=BE=E7=A4=BA=E6=8A=A5=E5=91=8A=E6=97=B6?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AF=A6=E6=83=85=E7=A9=BA=E7=99=BD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/components/MonitorCard.vue | 2 +- .../report/components/TestDetails.vue | 20 +++++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/performance-test/frontend/src/business/report/components/MonitorCard.vue b/performance-test/frontend/src/business/report/components/MonitorCard.vue index cf3f254ae8..fe9eab6d2b 100644 --- a/performance-test/frontend/src/business/report/components/MonitorCard.vue +++ b/performance-test/frontend/src/business/report/components/MonitorCard.vue @@ -7,7 +7,7 @@ @change="getResource(currentInstance)"> {{ item.ip }} {{ item.name }} diff --git a/performance-test/frontend/src/business/report/components/TestDetails.vue b/performance-test/frontend/src/business/report/components/TestDetails.vue index c7a915e4b4..4dcd886716 100644 --- a/performance-test/frontend/src/business/report/components/TestDetails.vue +++ b/performance-test/frontend/src/business/report/components/TestDetails.vue @@ -339,7 +339,6 @@ export default { children: 'children', label: 'label' }, - init: false, refresh: true, tableData: [], baseOption: { @@ -471,7 +470,6 @@ export default { }, handleGetCheckOptions(data, reportKey) { if (!data || data.length === 0) { - this.init = false; return; } let yAxisIndex0List = data.filter(m => m.yAxis2 === -1).map(m => m.groupName); @@ -479,8 +477,6 @@ export default { this.checkOptions[reportKey] = ['ALL'].concat(yAxisIndex0List); }, getTotalChart() { - this.result.loading = true; - this.totalOption = {}; this.seriesData = []; this.baseOption.yAxis = []; @@ -497,11 +493,9 @@ export default { for (let name in this.checkList) { promises.push(this.getChart(name, this.checkList[name])); } - Promise.all(promises).then((res) => { + this.result.loading = Promise.all(promises).then((res) => { this.handleGetTotalChart(res); - }).catch(() => { - this.result.loading = false; - }); + }) } }, handleTemplateGetTotalChart() { @@ -695,11 +689,14 @@ export default { return Array.from(new Set(arr)); } }, + created() { + this.id = this.$route.path.split('/')[4]; + this.initTableData(); + }, watch: { '$route'(to) { - if (to.name === "perReportView") { + if (to.path.startsWith("/performance/report/view/")) { this.id = to.path.split('/')[4]; - this.init = false; this.initTableData(); } }, @@ -710,9 +707,6 @@ export default { } let status = val.status; this.id = val.id; - if (this.init) { - return; - } if (status === "Running") { this.getTotalChart(); } else if (status === "Completed") {