From 6c38bb4f00223fdf24de4a37cebf22da4f702e35 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 1 Sep 2021 18:45:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=8A=A5=E5=91=8A=E5=9B=BE=E8=A1=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/components/MsDoughnutPieChart.vue | 2 +- .../detail/TestPlanReportNavigationBar.vue | 4 +- .../report/detail/component/ApiResult.vue | 41 ++++----- .../component/ApiScenarioCharResult.vue | 83 +++++-------------- 4 files changed, 40 insertions(+), 90 deletions(-) diff --git a/frontend/src/business/components/common/components/MsDoughnutPieChart.vue b/frontend/src/business/components/common/components/MsDoughnutPieChart.vue index 6babd26151..f4a13e19d9 100644 --- a/frontend/src/business/components/common/components/MsDoughnutPieChart.vue +++ b/frontend/src/business/components/common/components/MsDoughnutPieChart.vue @@ -33,7 +33,7 @@ export default { name: this.name, type: 'pie', left: -150, - radius: ['40%', '60%'], + radius: ['40%', '50%'], avoidLabelOverlap: false, label: { // padding: [10, 10, 20, 10], diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportNavigationBar.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportNavigationBar.vue index 5b14f5db00..c3fd1eb762 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportNavigationBar.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportNavigationBar.vue @@ -68,7 +68,9 @@ export default { top: 40%; line-height: 30px; border-radius: 0 15px 15px 0; - background-color: #acb7c1; + /*background-color: #acb7c1;*/ + background-color: #783887; + color: white; display: inline-block; position: absolute; cursor: pointer; diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiResult.vue index 6c6b9a4e9c..0fc84c88f3 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiResult.vue @@ -5,7 +5,8 @@ - + + @@ -25,12 +26,16 @@ export default { caseDataMap: new Map([ ["success", {name: this.$t('test_track.plan_view.pass'), itemStyle: {color: '#67C23A'}}], ["Success", {name: this.$t('test_track.plan_view.pass'), itemStyle: {color: '#67C23A'}}], + ["Pass", {name: this.$t('test_track.plan_view.pass'), itemStyle: {color: '#67C23A'}}], ["error", {name: this.$t('test_track.plan_view.failure'), itemStyle: {color: '#F56C6C'}}], ["Fail", {name: this.$t('test_track.plan_view.failure'), itemStyle: {color: '#F56C6C'}}], + ["Failure", {name: this.$t('test_track.plan_view.failure'), itemStyle: {color: '#F56C6C'}}], ["Prepare", {name: this.$t('api_test.home_page.detail_card.unexecute'), itemStyle: {color: '#909399'}}], + ["Underway", {name: this.$t('api_test.home_page.detail_card.unexecute'), itemStyle: {color: '#909399'}}], ]), caseCharData: [], scenarioCharData: [], + stepCharData: [], isShow: true } }, @@ -66,32 +71,20 @@ export default { let apiScenarioData = []; this.apiResult.apiScenarioData.forEach(item => { let data = this.getDataByStatus(item.status); - data.data = [item.count]; - for (let i = 0; i < this.apiResult.apiScenarioStepData.length; i++) { - let stepItem = this.apiResult.apiScenarioStepData[i]; - if (item.status) { - if (item.status === 'Fail' && stepItem.status === 'Failure') { - data.data.push(stepItem.count); - break; - } - if (item.status === 'Success' && stepItem.status === 'Pass') { - data.data.push(stepItem.count); - break; - } - if (item.status === 'Prepare' && stepItem.status === 'Underway') { - data.data.push(stepItem.count); - break; - } - } else { - if (stepItem.status === 'Underway') { - data.data.push(stepItem.count); - break; - } - } - } + data.value = item.count; apiScenarioData.push(data); }); + + let stepCharData = []; + for (let i = 0; i < this.apiResult.apiScenarioStepData.length; i++) { + let stepItem = this.apiResult.apiScenarioStepData[i]; + let data = this.getDataByStatus(stepItem.status); + data.value = stepItem.count; + stepCharData.push(data); + } + this.scenarioCharData = apiScenarioData; + this.stepCharData = stepCharData; }, getDataByStatus(status) { let tmp = this.caseDataMap.get(status); diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioCharResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioCharResult.vue index 395817bd37..020d04870b 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioCharResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/ApiScenarioCharResult.vue @@ -1,5 +1,5 @@