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, MsReportTestDetails,
MsPerformancePressureConfig MsPerformancePressureConfig
}, },
props: {
perReportId: String
},
data() { data() {
return { return {
result: {}, result: {},
@ -414,6 +417,9 @@ export default {
created() { created() {
this.isReadOnly = !hasPermission('PROJECT_PERFORMANCE_REPORT:READ+DELETE'); this.isReadOnly = !hasPermission('PROJECT_PERFORMANCE_REPORT:READ+DELETE');
this.reportId = this.$route.path.split('/')[4]; this.reportId = this.$route.path.split('/')[4];
if (!this.reportId && this.perReportId) {
this.reportId = this.perReportId;
}
this.getReport(this.reportId); this.getReport(this.reportId);
}, },
watch: { watch: {
@ -428,6 +434,9 @@ export default {
// console.log("close socket."); // console.log("close socket.");
this.websocket.close(); //websocket 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'"/> <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>
<el-card style="width: 550px;float: right"> <el-card style="width: 550px;float: right">
@ -237,7 +237,7 @@ export default {
let taskTotal = e.data; let taskTotal = e.data;
this.runningTotal = taskTotal; this.runningTotal = taskTotal;
this.initIndex++; this.initIndex++;
if (this.taskVisible && this.initEnd) { if (this.taskVisible && this.initEnd) {
setTimeout(() => { setTimeout(() => {
this.initEnd = false; this.initEnd = false;
this.init(); this.init();
@ -307,14 +307,8 @@ export default {
this.size = 1400; this.size = 1400;
this.reportId = row.id; this.reportId = row.id;
this.reportType = row.executionModule; this.reportType = row.executionModule;
switch (row.executionModule) { if (row.executionModule === "API") {
case "SCENARIO": this.getExecResult(row.id);
break;
case "PERFORMANCE":
break;
case "API":
this.getExecResult(row.id);
break;
} }
} else if (status === 'stop') { } else if (status === 'stop') {
this.$warning("当前任务已停止,无法查看报告"); this.$warning("当前任务已停止,无法查看报告");