From 1f73240063cd70248f2f56b39ee185415a2c3b67 Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 14 Nov 2022 09:21:07 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BF=AE=E6=94=B9=E8=B4=A8=E9=87=8F?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/RightContentFaultAnalysis.vue | 83 +++++---- src/views/3DOverview/index.vue | 6 +- src/views/QualityManager/HomePage.vue | 21 ++- .../QualityManager/components/TechyTable.vue | 8 +- .../charts/PlFaultAnalysisPieChart.vue | 168 +++++++++++++----- .../components/charts/newBar.vue | 10 +- src/views/QualityManager/mockData.js | 35 ++-- 7 files changed, 224 insertions(+), 107 deletions(-) diff --git a/src/views/3DOverview/components/RightContentFaultAnalysis.vue b/src/views/3DOverview/components/RightContentFaultAnalysis.vue index 1804c69..7e11d76 100644 --- a/src/views/3DOverview/components/RightContentFaultAnalysis.vue +++ b/src/views/3DOverview/components/RightContentFaultAnalysis.vue @@ -88,11 +88,11 @@ export default { ] const demoData = [ - { value: 100, name: 'A' }, - { value: 100, name: 'B' }, - { value: 100, name: 'C' }, - { value: 100, name: 'D' }, - { value: 100, name: 'E' } + { value: 55, name: 'A' }, + { value: 33, name: 'B' }, + { value: 22, name: 'C' }, + { value: 11, name: 'D' }, + { value: 32, name: 'E' } ] return { @@ -101,7 +101,7 @@ export default { configs: { title: { textAlign: 'center', - left: '62%', + left: '63%', top: '35%', text: '33039', textStyle: { @@ -109,6 +109,7 @@ export default { fontSize: 16, fontWeight: 'normal' }, + itemGap: 2, subtext: '总数', subtextStyle: { color: '#fff', @@ -117,7 +118,7 @@ export default { } }, legend: { - top: '5%', + top: 0, bottom: 0, left: -10, orient: 'vertical', @@ -208,8 +209,8 @@ export default { { name: 'PieForm', type: 'pie', - center: ['63%', '50%'], - radius: ['55%', '80%'], + center: ['65%', '50%'], + radius: ['60%', '80%'], avoidLabelOverlap: true, label: { formatter: params => { @@ -224,6 +225,10 @@ export default { fifth: { color: '#49FBD6', fontSize: 8 } } }, + labelLine: { + length: 5, + length2: 5 + }, itemStyle: { color: params => { /** 计算渐变方向的过程,只靠 dataIndex 不太行 */ @@ -231,15 +236,20 @@ export default { const colorGradient = colors[dataIndex] if (totalRate + percent < 25) { /** 也许这里需要完善,但目前工作良好 */ - ;(() => {})() + (() => {})() } else if (totalRate + percent < 50) { colorGradient.x = 0 colorGradient.y = 0 colorGradient.x2 = 1 colorGradient.y2 = 1 + } else if (totalRate + percent >= 50 && dataIndex === 1) { + colorGradient.x = 1 + colorGradient.y = 1 + colorGradient.x2 = 0 + colorGradient.y2 = 0 } else if (totalRate + percent < 100) { /** 也许这里需要完善,但目前工作良好 */ - ;(() => {})() + (() => {})() } totalRate += percent @@ -277,43 +287,46 @@ export default { return beilv * baseSize }, applyChartOption() { - const fs5 = this.calcFontsize(5 /**px*/) - const fs8 = this.calcFontsize(8 /**px*/) - const fs10 = this.calcFontsize(10 /**px*/) - const fs12 = this.calcFontsize(12 /**px*/) - const fs16 = this.calcFontsize(16 /**px*/) + const fs1 = this.calcFontsize(1 /** px*/) + const fs3 = this.calcFontsize(3 /** px*/) + const fs5 = this.calcFontsize(5 /** px*/) + const fs8 = this.calcFontsize(8 /** px*/) + const fs10 = this.calcFontsize(10 /** px*/) + const fs14 = this.calcFontsize(14 /** px*/) + const fs16 = this.calcFontsize(16 /** px*/) - this.configs.title.textStyle.fontSize = fs16 - this.configs.title.subtextStyle.fontSize = fs12 + this.configs.title.textStyle.fontSize = fs14 + this.configs.title.subtextStyle.fontSize = fs10 - this.configs.legend.itemGap = fs5 - this.configs.legend.itemWidth = fs10 + this.configs.legend.top = '10%' + this.configs.legend.itemGap = 0 + this.configs.legend.itemWidth = fs8 this.configs.legend.textStyle.rich.a.fontSize = fs10 this.configs.legend.textStyle.rich.a.lineHeight = fs16 this.configs.legend.textStyle.rich.b.fontSize = fs10 // this.configs.legend.textStyle.rich.b.lineHeight = fs16 - this.configs.legend.textStyle.rich.c.width = fs10 - this.configs.legend.textStyle.rich.c.height = fs10 + this.configs.legend.textStyle.rich.c.width = fs8 + this.configs.legend.textStyle.rich.c.height = fs8 this.configs.legend.textStyle.rich.c.borderRadius = fs5 - this.configs.legend.textStyle.rich.d.width = fs10 - this.configs.legend.textStyle.rich.d.height = fs10 + this.configs.legend.textStyle.rich.d.width = fs8 + this.configs.legend.textStyle.rich.d.height = fs8 this.configs.legend.textStyle.rich.d.borderRadius = fs5 - this.configs.legend.textStyle.rich.e.width = fs10 - this.configs.legend.textStyle.rich.e.height = fs10 + this.configs.legend.textStyle.rich.e.width = fs8 + this.configs.legend.textStyle.rich.e.height = fs8 this.configs.legend.textStyle.rich.e.borderRadius = fs5 - this.configs.legend.textStyle.rich.f.width = fs10 - this.configs.legend.textStyle.rich.f.height = fs10 + this.configs.legend.textStyle.rich.f.width = fs8 + this.configs.legend.textStyle.rich.f.height = fs8 this.configs.legend.textStyle.rich.f.borderRadius = fs5 - this.configs.legend.textStyle.rich.g.width = fs10 - this.configs.legend.textStyle.rich.g.height = fs10 + this.configs.legend.textStyle.rich.g.width = fs8 + this.configs.legend.textStyle.rich.g.height = fs8 this.configs.legend.textStyle.rich.g.borderRadius = fs5 - this.configs.series[0].label.rich.first.fontSize = fs8 - this.configs.series[0].label.rich.second.fontSize = fs8 - this.configs.series[0].label.rich.third.fontSize = fs8 - this.configs.series[0].label.rich.fourth.fontSize = fs8 - this.configs.series[0].label.rich.fifth.fontSize = fs8 + this.configs.series[0].label.rich.first.fontSize = fs10 + this.configs.series[0].label.rich.second.fontSize = fs10 + this.configs.series[0].label.rich.third.fontSize = fs10 + this.configs.series[0].label.rich.fourth.fontSize = fs10 + this.configs.series[0].label.rich.fifth.fontSize = fs10 this.chart.setOption(this.configs) } diff --git a/src/views/3DOverview/index.vue b/src/views/3DOverview/index.vue index 52c5ee5..a09597b 100644 --- a/src/views/3DOverview/index.vue +++ b/src/views/3DOverview/index.vue @@ -1,8 +1,8 @@