From c7842694bb56a26a618ae67f0c00ef378c122dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 22 Aug 2024 17:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index.vue | 154 ++++++++++-------- 1 file changed, 86 insertions(+), 68 deletions(-) diff --git a/src/views/report/qualityDefectsStatisticalAnalysisReport/index.vue b/src/views/report/qualityDefectsStatisticalAnalysisReport/index.vue index 4543c47..52f20c8 100644 --- a/src/views/report/qualityDefectsStatisticalAnalysisReport/index.vue +++ b/src/views/report/qualityDefectsStatisticalAnalysisReport/index.vue @@ -321,78 +321,96 @@ export default { this.form.STATION_NAME = row.STATION_NAME this.open = true this.title = '缺陷明细' + // this.$refs.chart1.setData({ + // tooltip: { + // trigger: 'axis', + // axisPointer: { + // type: 'shadow' + // } + // }, + // grid: { + // left: "0", + // right: "4%", + // bottom: "0", + // top: 20, + // containLabel: true, + // }, + // xAxis: [ + // { + // type: 'category', + // data: response.data.map(val => val.QUALITY_DEFECT_NAME), + // axisTick: { + // alignWithLabel: true, + // }, + // axisLabel: { + // interval: 0 + // + // } + // } + // ], + // yAxis: [ + // { + // type: 'value' + // } + // ], + // series: [ + // { + // name: '缺陷数量', + // type: "bar", + // barWidth: '30%', + // barMaxWidth: 50, + // label: { + // normal: { + // show: true, + // position: "top", + // formatter: (e) => { + // if (e.data === 0) { + // return '' + // } else { + // } + // return e.data + // }, + // textStyle: { + // color: "#a8aab0", + // fontStyle: "normal", + // fontFamily: "微软雅黑", + // fontSize: 0.75 * vw, + // }, + // }, + // }, + // itemStyle: { + // normal: { + // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + // { + // offset: 0, + // color: "#4adfff", + // }, + // { + // offset: 1, + // color: "#3d7aff", + // }, + // ]), + // }, + // }, + // data: response.data.map(val => val.DEFECT_NUMBER), + // } + // ] + // }) this.$refs.chart1.setData({ tooltip: { - trigger: 'axis', - axisPointer: { - type: 'shadow' - } - }, - grid: { - left: "0", - right: "4%", - bottom: "0", - top: 20, - containLabel: true, + trigger: 'item' }, - xAxis: [ - { - type: 'category', - data: response.data.map(val => val.QUALITY_DEFECT_NAME), - axisTick: { - alignWithLabel: true, - }, - axisLabel: { - interval: 0 - - } - } - ], - yAxis: [ - { - type: 'value' - } - ], series: [ { - name: '缺陷数量', - type: "bar", - barWidth: '30%', - barMaxWidth: 50, - label: { - normal: { - show: true, - position: "top", - formatter: (e) => { - if (e.data === 0) { - return '' - } else { - } - return e.data - }, - textStyle: { - color: "#a8aab0", - fontStyle: "normal", - fontFamily: "微软雅黑", - fontSize: 0.75 * vw, - }, - }, - }, - itemStyle: { - normal: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: "#4adfff", - }, - { - offset: 1, - color: "#3d7aff", - }, - ]), - }, - }, - data: response.data.map(val => val.DEFECT_NUMBER), + name: '缺陷名称', + type: 'pie', + radius: '60%', + data: response.data.map(e=>{ + return { + name:e.QUALITY_DEFECT_NAME, + value:e.DEFECT_NUMBER + } + }), } ] }) @@ -426,7 +444,7 @@ export default {