From 509e5c9fbbe360f17ab7652c0ba5f1eae5583811 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Tue, 18 Aug 2020 15:56:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(LDAP):=20=E6=B5=8B=E8=AF=95=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 1 + .../components/api/report/ApiReportView.vue | 39 +- .../common/components/MsPieChart.vue | 3 +- .../report/PerformanceReportView.vue | 516 +++++++++--------- .../ExportTestCaseReport.vue | 15 + .../TestResultChartComponent.vue | 2 + .../comonents/report/TestCaseReportView.vue | 321 ++++++----- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 10 files changed, 510 insertions(+), 390 deletions(-) create mode 100644 frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/ExportTestCaseReport.vue diff --git a/frontend/package.json b/frontend/package.json index 5d19b7cda7..b6e1596b4e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -38,6 +38,7 @@ "babel-eslint": "^10.0.3", "eslint": "^5.16.0", "eslint-plugin-vue": "^5.0.0", + "file-writer": "^1.0.2", "vue-template-compiler": "^2.6.10", "vue2-ace-editor": "0.0.15" }, diff --git a/frontend/src/business/components/api/report/ApiReportView.vue b/frontend/src/business/components/api/report/ApiReportView.vue index df1037b4c1..39b973d347 100644 --- a/frontend/src/business/components/api/report/ApiReportView.vue +++ b/frontend/src/business/components/api/report/ApiReportView.vue @@ -4,9 +4,17 @@ - {{ report.projectName }} / - {{ report.testName }} - {{ report.createTime | timestampFormatDate }} + + + {{ report.projectName }} / + {{ report.testName }} + {{ report.createTime | timestampFormatDate }} + + {{$t('test_track.plan_view.export_report')}} + + + @@ -43,6 +51,8 @@ import MsMetricChart from "./components/MetricChart"; import MsScenarioResults from "./components/ScenarioResults"; import {Scenario} from "../test/model/ScenarioModel"; + import writer from "file-writer"; + import ResumeCss from "../../../../common/css/main.css"; export default { name: "MsApiReportView", @@ -62,6 +72,29 @@ }, methods: { + handleExport(name) { + let html = this.getHtml(); + writer(`${name}.html`, html, 'utf-8'); + }, + getHtml() { + const template = this.$refs.resume.innerHTML + let html = ` + + + + + html + + + + + + ${template} + + + ` + return html + }, init() { this.loading = true; this.report = {}; diff --git a/frontend/src/business/components/common/components/MsPieChart.vue b/frontend/src/business/components/common/components/MsPieChart.vue index 009fbbb822..1ee8438c17 100644 --- a/frontend/src/business/components/common/components/MsPieChart.vue +++ b/frontend/src/business/components/common/components/MsPieChart.vue @@ -43,7 +43,8 @@ type: 'pie', radius: ['40%', '70%'], // roseType: 'angle', - data: this.data + data: this.data, + animation: false } ] }, diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 44e9018f43..3d7eec7553 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -22,9 +22,10 @@ @click="rerun(testId)"> {{ $t('report.test_execute_again') }} - @@ -44,24 +45,26 @@ + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - @@ -79,250 +82,275 @@ diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/ExportTestCaseReport.vue b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/ExportTestCaseReport.vue new file mode 100644 index 0000000000..b03c99102d --- /dev/null +++ b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/ExportTestCaseReport.vue @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TestResultChartComponent.vue b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TestResultChartComponent.vue index 24bd94fc31..c784c15b62 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TestResultChartComponent.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/TemplateComponent/TestResultChartComponent.vue @@ -66,6 +66,8 @@ this.charData.push(data); }); this.reload(); + + }, reload() { this.isShow = false; 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 47e43d6537..1017ff6167 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 @@ -13,18 +13,25 @@ - {{$t('test_track.return')}} - + {{$t('test_track.return')}} + {{report.name}} - {{$t('commons.save')}} - {{$t('test_track.plan_view.edit_component')}} + + {{$t('commons.save')}} + + + {{$t('test_track.plan_view.edit_component')}} + + + {{$t('test_track.plan_view.export_report')}} + - + @@ -41,154 +48,184 @@