From 5bf126fa2e2612cde0da4fb8228471c51a93fb13 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 25 Nov 2020 17:31:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E5=AF=BC=E5=87=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/report/ApiReportViewDetail.vue | 20 ++++++------------- .../components/report/MsReportTitle.vue | 4 +--- .../report/PerformanceReportView.vue | 2 +- .../comonents/report/TestCaseReportView.vue | 4 ++-- frontend/src/common/js/utils.js | 14 +++++++++++++ 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/frontend/src/business/components/api/report/ApiReportViewDetail.vue b/frontend/src/business/components/api/report/ApiReportViewDetail.vue index a00b2b446a..5685063904 100644 --- a/frontend/src/business/components/api/report/ApiReportViewDetail.vue +++ b/frontend/src/business/components/api/report/ApiReportViewDetail.vue @@ -46,10 +46,9 @@ import MsScenarioResults from "./components/ScenarioResults"; import MsContainer from "@/business/components/common/components/MsContainer"; import MsMainContainer from "@/business/components/common/components/MsMainContainer"; import MsApiReportExport from "./ApiReportExport"; -import {exportPdf} from "@/common/js/utils"; -import html2canvas from "html2canvas"; import MsApiReportViewHeader from "./ApiReportViewHeader"; import {RequestFactory} from "../test/model/ScenarioModel"; +import {windowPrint} from "../../../../common/js/utils"; export default { name: "MsApiReportViewDetail", @@ -154,23 +153,16 @@ export default { this.scenarioName = requestResult.scenarioName; }); }, - handleExport(name) { - this.loading = true; + handleExport() { this.reportExportVisible = true; let reset = this.exportReportReset; - - this.$nextTick(function () { - html2canvas(document.getElementById('apiTestReport'), { - // scale: 2, - }).then(function (canvas) { - exportPdf(name, [canvas]); - reset(); - }); + this.$nextTick(() => { + windowPrint('apiTestReport', 0.57); + reset(); }); }, exportReportReset() { - this.reportExportVisible = false; - this.loading = false; + this.$router.go(0); } }, diff --git a/frontend/src/business/components/common/components/report/MsReportTitle.vue b/frontend/src/business/components/common/components/report/MsReportTitle.vue index 8b58a77e22..fc661d81ba 100644 --- a/frontend/src/business/components/common/components/report/MsReportTitle.vue +++ b/frontend/src/business/components/common/components/report/MsReportTitle.vue @@ -9,9 +9,7 @@
-
- -
+
diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 0d105c2879..106a75fb54 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -272,7 +272,7 @@ export default { this.$nextTick(function () { html2canvas(document.getElementById('performanceReportExport'), { - // scale: 2 + scale: 2 }).then(function (canvas) { exportPdf(name, [canvas]); reset(); diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue index d4d0f49b29..04fdb70864 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue @@ -211,7 +211,7 @@ this.$nextTick(function () { html2canvas(document.getElementById('testCaseReportExport'), { - // scale: 2 + scale: 2 }).then(function(canvas) { exportPdf(name, [canvas]); reset(); @@ -225,7 +225,7 @@ }, } } - +cd