From 251263d4846ae63e73f5bccd4d2c285478d7f012 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 22 Jul 2025 16:11:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=86=B7=E5=8A=A0=E5=B7=A5=E8=BD=A6?= =?UTF-8?q?=E9=97=B4=E7=9C=8B=E6=9D=BF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bigScreen/bxerp/lengjiagongdept.vue | 119 ++++++++++++++++-- 1 file changed, 112 insertions(+), 7 deletions(-) diff --git a/src/views/bigScreen/bxerp/lengjiagongdept.vue b/src/views/bigScreen/bxerp/lengjiagongdept.vue index e30a529c..e35e375e 100644 --- a/src/views/bigScreen/bxerp/lengjiagongdept.vue +++ b/src/views/bigScreen/bxerp/lengjiagongdept.vue @@ -12,7 +12,7 @@
本月各工段生产产品数
- +
@@ -332,6 +332,101 @@ export default { } ] }, + barOption2: { + grid: { + top: "1%", + left: "10%", + bottom: "5%", + containLabel: true + }, + xAxis: { + splitLine: { + show:false + }, + }, + yAxis: [ + { + axisLine: { + show: false + }, + axisTick: { + show: false + }, + axisLabel: { + color: "#fff" + }, + splitLine: { + show:false + }, + type: 'category', + inverse: true, // 反转坐标轴 + data: [] + }, + { + show: false, + axisLine: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show:false + }, + axisLabel: { + textStyle: { + fontSize: 12, + color: "#fff" + } + }, + inverse: true, // 反转坐标轴 + data: [], + } + ], + series: [ + { + name: '柱状图', + type: 'bar', + data: [], + yAxisIndex: 0, + barCategoryGap: 50, + barWidth: 10, + itemStyle: { + normal: { + barBorderRadius: 5, + color: function (params) { + return myColor[params.dataIndex]; + } + }, + label: { + normal: { + position: "outside", + color: "#fff", + } + } + }, + }, + { + name: "框", + type: "bar", + barCategoryGap: 50, + barWidth: 12, + itemStyle: { + color: "none", + shadowColor: '#999', // 阴影颜色 + shadowBlur: 3, // 阴影模糊 + shadowOffsetX: 0, // 阴影水平偏移 + shadowOffsetY: 0, // 阴影垂直偏移 + borderColor: "rgba(153,153,153,0.6)", // 边框颜色 + borderWidth: 0.5, + barBorderRadius: 5, + + }, + yAxisIndex: 1, + data: [] + } + ] + }, barOption: { grid: { top: "1%", @@ -492,7 +587,7 @@ export default { top = top.substring(0,top.length-2); let topNumber = Number(top); let newTop = 0; - if(topNumber <= -20){ + if(topNumber <= -85){ newTop = 0; }else{ newTop =Number(top)-2.5; @@ -544,10 +639,12 @@ export default { if(res.length > 0){ res.forEach((item)=>{ that.mgroupsId += item.id + ','; - that.barOption.yAxis.data.push(item.name); - that.barOption.series.data.push(0); //车间库存 that.getInms(item); + that.barOption2.yAxis[0].data.push(item.name); + that.barOption2.yAxis[1].data.push(0); + that.barOption2.series[0].data.push(0); + that.barOption2.series[1].data.push(0); that.getmgroupMaterial(item.name); }) } @@ -581,11 +678,19 @@ export default { if(res.data2.ds0.length>0){ let data = res.data2.ds0; data.forEach((item) => { - let index2 = that.barOption.yAxis.data.indexOf(item.工段); - that.barOption.series.data[index2] = item.合格数; + // that.barOption2.yAxis[0].data.push(item.name); + let index2 = that.barOption2.yAxis[0].data.indexOf(mgroupName); + that.barOption2.yAxis[1].data[index2] = item.合格数; + that.barOption2.series[0].data[index2] = item.合格数; }) + let maxNum = that.barOption2.series[0].data.sort((a, b) => b - a)[0]+2; + let arr = []; + that.barOption2.series[1].data.forEach((item)=>{ + arr.push(maxNum) + }) + that.barOption2.series[1].data = arr; } - console.log(that.barOption); + console.log(that.barOption2); }); }, //车间设备列表