fix(性能测试): 性能测试导出报告时支持新版错误记录页面

This commit is contained in:
song-tianyang 2023-10-18 13:11:13 +08:00 committed by 刘瑞斌
parent c9bf47b03d
commit 58758ffd90
3 changed files with 22 additions and 5 deletions

View File

@ -26,6 +26,13 @@
</template>
<ms-report-request-statistics :report="report" ref="requestStatistics"/>
</el-card>
<el-card v-if="haveErrorSamples" id="errorSamples" title="'errorSamples'">
<template v-slot:header>
<span class="title">{{ $t('report.test_error_log') }}</span>
</template>
<samples-tabs ref="errorSamples" :samples="errorSamples"/>
</el-card>
<el-card id="errorLog" title="'errorLog'">
<template v-slot:header>
<span class="title">{{ $t('report.test_error_log') }}</span>
@ -52,11 +59,13 @@ import MsReportExportTemplate from "metersphere-frontend/src/components/report/M
import MsReportTestDetails from "./components/TestDetails";
import MonitorCard from "./components/MonitorCard";
import MsTag from "metersphere-frontend/src/components/MsTag";
import SamplesTabs from "@/business/report/components/samples/SamplesTabs.vue";
export default {
name: "MsPerformanceReportExport",
components: {
SamplesTabs,
MonitorCard,
MsReportExportTemplate,
MsReportTitle,
@ -66,7 +75,7 @@ export default {
MsReportTestOverview,
MsTag,
},
props: ['report', 'title', 'projectEnvMap']
props: ['report', 'title', 'projectEnvMap', 'haveErrorSamples', 'errorSamples']
}
</script>

View File

@ -124,6 +124,7 @@
</div>
<ms-performance-report-export :title="reportName" id="performanceReportExport" v-show="reportExportVisible"
:error-samples="errorSamples" :have-error-samples="haveErrorSamples"
:project-env-map="allProjectEnvMap"
:report="report"/>
@ -389,6 +390,9 @@ export default {
this.$nextTick(function () {
setTimeout(() => {
let ids = ['testOverview', 'testDetails', 'requestStatistics', 'errorLog', 'monitorCard'];
if (this.haveErrorSamples) {
ids = ['testOverview', 'testDetails', 'requestStatistics', 'errorSamples', 'monitorCard'];
}
let promises = [];
ids.forEach(id => {
let promise = html2canvas(document.getElementById(id), {scale: 2});

View File

@ -50,14 +50,18 @@ export default {
datetimeFormat,
handleClose(done) {
this.activeName = '1';
this.sampleRecord = [];
done();
},
openRecord(samples) {
this.sampleRecord = [];
samples.forEach(sample => {
this.sampleRecord.push(sample);
});
this.drawer = true;
this.$nextTick(() => {
samples.forEach(sample => {
this.sampleRecord.push(sample);
});
this.drawer = true;
})
},
},
}