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 01/12] =?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 @@ - - -
- ${template} -
- - ` - return html - }, init() { this.loading = true; this.report = {}; diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 3d7eec7553..80a7f3e0de 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -129,29 +129,6 @@ } }, methods: { - exports(name) { - let html = this.getHtml(); - writer(`${name}.html`, html, 'utf-8'); - }, - getHtml() { - const template = this.$refs.resume.innerHTML - let html = ` - - - - - html - - - - -
- ${template} -
- - ` - return html - }, initBreadcrumb() { if (this.reportId) { this.result = this.$get("/performance/report/test/pro/info/" + this.reportId, res => { 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 901fae1d25..7ee2fc7888 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 @@ -146,7 +146,7 @@ this.$refs.templateEdit.open(this.reportId, true); }, /*导出报告*/ - handleExport(name) { + /*handleExport(name) { let html = this.getHtml(); writer(`${name}.html`, html, 'utf-8'); }, @@ -169,7 +169,7 @@ ` return html - }, + },*/ handleSave() { let param = {}; this.buildParam(param); From 4b4b3d92dcb2a048a057d7b5a12028a02cf0e0e0 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 19 Aug 2020 10:58:35 +0800 Subject: [PATCH 07/12] =?UTF-8?q?refactor:=20=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/system/EmailSetting.vue | 385 +++++++++-------- .../settings/system/LdapSetting.vue | 401 +++++++++--------- .../system/SystemParameterSetting.vue | 27 +- 3 files changed, 405 insertions(+), 408 deletions(-) diff --git a/frontend/src/business/components/settings/system/EmailSetting.vue b/frontend/src/business/components/settings/system/EmailSetting.vue index 2cf73b20e1..47d845993f 100644 --- a/frontend/src/business/components/settings/system/EmailSetting.vue +++ b/frontend/src/business/components/settings/system/EmailSetting.vue @@ -1,209 +1,206 @@ From b5fab0f8a63ed4258cd95cc8bb5f05276c0df7c0 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 19 Aug 2020 11:50:08 +0800 Subject: [PATCH 09/12] =?UTF-8?q?refactor:=20Api=20Keys=20=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E9=A1=B5=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/components/settings/personal/ApiKeys.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/settings/personal/ApiKeys.vue b/frontend/src/business/components/settings/personal/ApiKeys.vue index 7b7c55aa5a..c9c16c9c68 100644 --- a/frontend/src/business/components/settings/personal/ApiKeys.vue +++ b/frontend/src/business/components/settings/personal/ApiKeys.vue @@ -23,7 +23,7 @@
- +
@@ -63,7 +63,7 @@ {{ currentRow.secretKey }} - +
@@ -145,7 +145,7 @@ export default { this.apiKeysVisible = true; this.currentRow = row; }, - copy(row, key) { + copy(row, key, visible) { let input = document.createElement("input"); document.body.appendChild(input); input.value = row[key]; @@ -155,9 +155,9 @@ export default { } document.execCommand("copy"); document.body.removeChild(input); - row.visible = true; + row[visible] = true; setTimeout(() => { - row.visible = false; + row[visible] = false; }, 1000); }, } From fabba9a3647781a2779f6915a39ffa6299d69a34 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 19 Aug 2020 11:55:00 +0800 Subject: [PATCH 10/12] refactor: i18n --- .../track/case/components/BatchEdit.vue | 10 ++++---- .../track/case/components/BatchMove.vue | 2 +- .../track/case/components/TestCaseList.vue | 16 ++++++------- .../view/comonents/TestPlanTestCaseEdit.vue | 22 ++++++++--------- .../view/comonents/TestPlanTestCaseList.vue | 18 +++++++------- frontend/src/i18n/en-US.js | 24 +++++++++++++++++++ frontend/src/i18n/zh-CN.js | 24 +++++++++++++++++++ frontend/src/i18n/zh-TW.js | 24 +++++++++++++++++++ 8 files changed, 107 insertions(+), 33 deletions(-) diff --git a/frontend/src/business/components/track/case/components/BatchEdit.vue b/frontend/src/business/components/track/case/components/BatchEdit.vue index 2b8f98a0bb..0da61dc57b 100644 --- a/frontend/src/business/components/track/case/components/BatchEdit.vue +++ b/frontend/src/business/components/track/case/components/BatchEdit.vue @@ -14,7 +14,7 @@ - +
@@ -47,7 +47,9 @@ valueArr: Object, dialogTitle: { type: String, - default: "批量操作" + default() { + return this.$t('test_track.case.batch_operate') + } } }, data() { @@ -56,8 +58,8 @@ form: {}, size: 0, rules: { - type: {required: true, message: "请选择属性", trigger: ['blur','change']}, - value: {required: true, message: "请选择属性对应的值", trigger: ['blur','change']} + type: {required: true, message: this.$t('test_track.case.please_select_attr'), trigger: ['blur','change']}, + value: {required: true, message: this.$t('test_track.case.please_select_attr_value'), trigger: ['blur','change']} }, options: [], filterable: false, diff --git a/frontend/src/business/components/track/case/components/BatchMove.vue b/frontend/src/business/components/track/case/components/BatchMove.vue index b0eabe8e5c..2072a7aea6 100644 --- a/frontend/src/business/components/track/case/components/BatchMove.vue +++ b/frontend/src/business/components/track/case/components/BatchMove.vue @@ -1,6 +1,6 @@ @@ -193,18 +193,18 @@ showMore: false, buttons: [ { - name: '批量编辑用例', handleClick: this.handleBatchEdit + name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit }, { - name: '批量移动用例', handleClick: this.handleBatchMove + name: this.$t('test_track.case.batch_move_case'), handleClick: this.handleBatchMove }, { - name: '批量删除用例', handleClick: this.handleDeleteBatch + name: this.$t('test_track.case.batch_delete_case'), handleClick: this.handleDeleteBatch } ], typeArr: [ - {id: 'priority', name: '用例等级'}, - {id: 'type', name: '类型'}, - {id: 'method', name: '测试方式'}, - {id: 'maintainer', name: '维护人'}, + {id: 'priority', name: this.$t('test_track.case.priority')}, + {id: 'type', name: this.$t('test_track.case.type')}, + {id: 'method', name: this.$t('test_track.case.method')}, + {id: 'maintainer', name: this.$t('test_track.case.maintainer')}, ], valueArr: { priority: [ diff --git a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue index 5db9e6c630..3fb1aab590 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue @@ -181,7 +181,7 @@ :active-text="$t('test_track.plan_view.submit_issues')"> @@ -192,7 +192,7 @@ - - - - - - + + + + + +