style(接口测试): 优化接口测试报告的饼状图

优化接口测试报告的饼状图,当某个扇面过于小时使用一个最小尺寸,避免饼状图看不到这一部分
This commit is contained in:
song-tianyang 2023-02-20 17:53:21 +08:00 committed by 建国
parent c5d061f30b
commit 506d29765d
2 changed files with 11 additions and 9 deletions

View File

@ -18,7 +18,6 @@
:is-share="isShare" :is-share="isShare"
@reportExport="handleExport" @reportExport="handleExport"
@reportSave="handleSave" /> @reportSave="handleSave" />
<!-- content --> <!-- content -->
<main v-if="isNotRunning"> <main v-if="isNotRunning">
<!-- content header chart --> <!-- content header chart -->
@ -704,8 +703,8 @@ export default {
} }
} }
} }
if(this.content.scenarios && this.content.scenarios[0].requestResults){ if (this.content.scenarios && this.content.scenarios[0].requestResults) {
this.content.scenarios[0].requestResults.push({responseResult: {}}); this.content.scenarios[0].requestResults.push({ responseResult: {} });
} }
this.reportExportVisible = true; this.reportExportVisible = true;
let reset = this.exportReportReset; let reset = this.exportReportReset;

View File

@ -255,6 +255,13 @@ export default {
return total; return total;
}, },
options() { 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 { return {
color: ['#67C23A', '#F56C6C', '#F6972A', '#9C9B9A'], color: ['#67C23A', '#F56C6C', '#F6972A', '#9C9B9A'],
tooltip: { tooltip: {
@ -286,6 +293,7 @@ export default {
], ],
series: [ series: [
{ {
minAngle: 3,
type: 'pie', type: 'pie',
radius: ['80%', '90%'], radius: ['80%', '90%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
@ -301,12 +309,7 @@ export default {
labelLine: { labelLine: {
show: false, show: false,
}, },
data: [ data: picData,
{ value: this.content.success, name: 'Success' },
{ value: this.content.error, name: 'Error' },
{ value: this.content.errorCode, name: 'FakeError' },
{ value: this.content.unExecute, name: 'Pending' },
],
}, },
], ],
}; };