fix(任务中心) 修复从任务中心打不开性能报告问题

This commit is contained in:
fit2-zhao 2021-09-22 17:40:32 +08:00 committed by fit2-zhao
parent 2bbb35f568
commit 35a8536d90
2 changed files with 13 additions and 10 deletions

View File

@ -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);
}
}
};

View File

@ -32,7 +32,7 @@
<ms-api-report-detail :reportId="reportId" v-if="reportType === 'SCENARIO'"/>
<performance-report-view :reportId="reportId" v-if="reportType === 'PERFORMANCE'"/>
<performance-report-view :perReportId="reportId" v-if="reportType === 'PERFORMANCE'"/>
</el-card>
<el-card style="width: 550px;float: right">
@ -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("当前任务已停止,无法查看报告");