From 2b4f8266fbda0f23f14df9152f5818793a632c84 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 25 Nov 2020 17:24:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E5=85=B3=E8=81=94=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/plan/view/comonents/TestCaseRelevance.vue | 10 ++++++++++ .../review/view/components/TestReviewRelevance.vue | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue index 9f7b8bfa66..d1dc718c3b 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue @@ -215,6 +215,16 @@ item.checked = false; }); flag ? this.testCases = tableData : this.testCases = this.testCases.concat(tableData); + // 去重处理 + let hash = {} + this.testCases = this.testCases.reduce((item, next) => { + if (!hash[next.id]) { + hash[next.id] = true + item.push(next) + } + return item + }, []) + this.lineStatus = tableData.length === 50 && this.testCases.length < this.total; }); } diff --git a/frontend/src/business/components/track/review/view/components/TestReviewRelevance.vue b/frontend/src/business/components/track/review/view/components/TestReviewRelevance.vue index 9c965c1fb1..d232be36e1 100644 --- a/frontend/src/business/components/track/review/view/components/TestReviewRelevance.vue +++ b/frontend/src/business/components/track/review/view/components/TestReviewRelevance.vue @@ -219,6 +219,15 @@ item.checked = false; }); flag ? this.testReviews = tableData : this.testReviews = this.testReviews.concat(tableData); + // 去重处理 + let hash = {} + this.testReviews = this.testReviews.reduce((item, next) => { + if (!hash[next.id]) { + hash[next.id] = true + item.push(next) + } + return item + }, []) this.lineStatus = tableData.length === 50 && this.testReviews.length < this.total; }); From 5bf126fa2e2612cde0da4fb8228471c51a93fb13 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 25 Nov 2020 17:31:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=BC=82=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