From f78898b0d9225043362cb60513239f2bbd190852 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 20 Feb 2023 17:53:21 +0800 Subject: [PATCH] =?UTF-8?q?style(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E7=9A=84=E9=A5=BC=E7=8A=B6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化接口测试报告的饼状图,当某个扇面过于小时使用一个最小尺寸,避免饼状图看不到这一部分 --- .../automation/report/ApiReportDetail.vue | 5 ++--- .../automation/report/components/MetricChart.vue | 15 +++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/api-test/frontend/src/business/automation/report/ApiReportDetail.vue b/api-test/frontend/src/business/automation/report/ApiReportDetail.vue index 4d094c9a2c..1da8ae0d16 100644 --- a/api-test/frontend/src/business/automation/report/ApiReportDetail.vue +++ b/api-test/frontend/src/business/automation/report/ApiReportDetail.vue @@ -18,7 +18,6 @@ :is-share="isShare" @reportExport="handleExport" @reportSave="handleSave" /> -
@@ -704,8 +703,8 @@ export default { } } } - if(this.content.scenarios && this.content.scenarios[0].requestResults){ - this.content.scenarios[0].requestResults.push({responseResult: {}}); + if (this.content.scenarios && this.content.scenarios[0].requestResults) { + this.content.scenarios[0].requestResults.push({ responseResult: {} }); } this.reportExportVisible = true; let reset = this.exportReportReset; diff --git a/api-test/frontend/src/business/automation/report/components/MetricChart.vue b/api-test/frontend/src/business/automation/report/components/MetricChart.vue index 96251f63f7..c953976522 100644 --- a/api-test/frontend/src/business/automation/report/components/MetricChart.vue +++ b/api-test/frontend/src/business/automation/report/components/MetricChart.vue @@ -255,6 +255,13 @@ export default { return total; }, options() { + let picData = [ + { value: this.content.success > 0 ? this.content.success : '-', name: 'Success' }, + { value: this.content.error > 0 ? this.content.error : '-', name: 'Error' }, + { value: this.content.errorCode > 0 ? this.content.errorCode : '-', name: 'FakeError' }, + { value: this.content.unExecute > 0 ? this.content.unExecute : '-', name: 'Pending' }, + ]; + return { color: ['#67C23A', '#F56C6C', '#F6972A', '#9C9B9A'], tooltip: { @@ -286,6 +293,7 @@ export default { ], series: [ { + minAngle: 3, type: 'pie', radius: ['80%', '90%'], avoidLabelOverlap: false, @@ -301,12 +309,7 @@ export default { labelLine: { show: false, }, - data: [ - { value: this.content.success, name: 'Success' }, - { value: this.content.error, name: 'Error' }, - { value: this.content.errorCode, name: 'FakeError' }, - { value: this.content.unExecute, name: 'Pending' }, - ], + data: picData, }, ], };