From 35a8536d90235c4487910c04a05e2b9297ccddfe Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 22 Sep 2021 17:40:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83)=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=8E=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=89=93=E4=B8=8D=E5=BC=80=E6=80=A7=E8=83=BD=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/report/PerformanceReportView.vue | 9 +++++++++ .../src/business/components/task/TaskCenter.vue | 14 ++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 2e8879ae4a..d7a053d1d1 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -155,6 +155,9 @@ export default { MsReportTestDetails, MsPerformancePressureConfig }, + props: { + perReportId: String + }, data() { return { result: {}, @@ -414,6 +417,9 @@ export default { created() { this.isReadOnly = !hasPermission('PROJECT_PERFORMANCE_REPORT:READ+DELETE'); this.reportId = this.$route.path.split('/')[4]; + if (!this.reportId && this.perReportId) { + this.reportId = this.perReportId; + } this.getReport(this.reportId); }, watch: { @@ -428,6 +434,9 @@ export default { // console.log("close socket."); this.websocket.close(); //离开路由之后断开websocket连接 } + }, + perReportId() { + this.getReport(this.perReportId); } } }; diff --git a/frontend/src/business/components/task/TaskCenter.vue b/frontend/src/business/components/task/TaskCenter.vue index c624aeb8ae..fd99bbf481 100644 --- a/frontend/src/business/components/task/TaskCenter.vue +++ b/frontend/src/business/components/task/TaskCenter.vue @@ -32,7 +32,7 @@ - + @@ -237,7 +237,7 @@ export default { let taskTotal = e.data; this.runningTotal = taskTotal; this.initIndex++; - if (this.taskVisible && this.initEnd) { + if (this.taskVisible && this.initEnd) { setTimeout(() => { this.initEnd = false; this.init(); @@ -307,14 +307,8 @@ export default { this.size = 1400; this.reportId = row.id; this.reportType = row.executionModule; - switch (row.executionModule) { - case "SCENARIO": - break; - case "PERFORMANCE": - break; - case "API": - this.getExecResult(row.id); - break; + if (row.executionModule === "API") { + this.getExecResult(row.id); } } else if (status === 'stop') { this.$warning("当前任务已停止,无法查看报告");