From b7cc7913a6c61b807b296c9f440d02ac3edaa813 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 23 Jul 2025 16:55:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=9C=AC=E6=9C=88=E5=90=84=E5=B7=A5?= =?UTF-8?q?=E6=AE=B5=E7=94=9F=E4=BA=A7=E4=BA=A7=E5=93=81=E6=95=B0=E6=9F=B1?= =?UTF-8?q?=E7=8A=B6=E9=A2=9C=E8=89=B2=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/jiejingdept.vue | 10 +- src/views/bigScreen/bxerp/jiejingdept2.vue | 10 +- src/views/bigScreen/bxerp/lengjiagongdept.vue | 196 ++---------------- src/views/bigScreen/bxerp/niuzhuandept.vue | 10 +- src/views/bigScreen/bxerp/reyadept.vue | 10 +- 5 files changed, 55 insertions(+), 181 deletions(-) diff --git a/src/views/bigScreen/bxerp/jiejingdept.vue b/src/views/bigScreen/bxerp/jiejingdept.vue index 5a7ecea7..b36e5bb5 100644 --- a/src/views/bigScreen/bxerp/jiejingdept.vue +++ b/src/views/bigScreen/bxerp/jiejingdept.vue @@ -318,11 +318,16 @@ export default { yAxisIndex: 0, barCategoryGap: 50, barWidth: 10, + label: { + show: true, + position: "right", + color: "#fff", + }, itemStyle: { normal: { barBorderRadius: 5, color: function (params) { - return myColor[params.dataIndex]; + return myColor[params.dataIndex%5]; } }, label: { @@ -391,7 +396,8 @@ export default { {name:'一次复丝',value:0}, {name:'捆二次棒',value:0}, {name:'二次复丝',value:0}, - ] + ], + showValue: true } , config_left2:{ data:[] diff --git a/src/views/bigScreen/bxerp/jiejingdept2.vue b/src/views/bigScreen/bxerp/jiejingdept2.vue index 45cda5fb..ab18edb4 100644 --- a/src/views/bigScreen/bxerp/jiejingdept2.vue +++ b/src/views/bigScreen/bxerp/jiejingdept2.vue @@ -318,11 +318,16 @@ export default { yAxisIndex: 0, barCategoryGap: 50, barWidth: 10, + label: { + show: true, + position: "right", + color: "#fff", + }, itemStyle: { normal: { barBorderRadius: 5, color: function (params) { - return myColor[params.dataIndex]; + return myColor[params.dataIndex%5]; } }, label: { @@ -388,7 +393,8 @@ export default { {name:'排二次棒',value:0}, {name:'切丝',value:0}, {name:'排板',value:0}, - ] + ], + showValue: true } , config_left2:{ data:[] diff --git a/src/views/bigScreen/bxerp/lengjiagongdept.vue b/src/views/bigScreen/bxerp/lengjiagongdept.vue index 7e92143f..c00dbdd8 100644 --- a/src/views/bigScreen/bxerp/lengjiagongdept.vue +++ b/src/views/bigScreen/bxerp/lengjiagongdept.vue @@ -12,9 +12,9 @@
本月各工段生产产品数
- +
- +
@@ -294,11 +294,16 @@ export default { yAxisIndex: 0, barCategoryGap: 50, barWidth: 10, + label: { + show: true, + position: "right", + color: "#fff", + }, itemStyle: { normal: { barBorderRadius: 5, color: function (params) { - return myColor[params.dataIndex]; + return myColor[params.dataIndex%5]; } }, label: { @@ -332,154 +337,6 @@ 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%", - 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: [] - }, - series:{ - name: '柱状图', - type: 'bar', - data: [], - barCategoryGap: 50, - barWidth: 10, - itemStyle: { - normal: { - barBorderRadius: 5, - color: function (params) { - return myColor[params.dataIndex]; - } - }, - label: { - normal: { - show: true, - position: "outside", - color: "#fff", - formatter: "{a}" - } - } - }, - } - }, tableHeight: 100, speed: 2000, time: null, @@ -507,7 +364,8 @@ export default { data:[] }, config_left1:{ - data:[] + data:[], + showValue: true } , config_left2:{ data:[] @@ -562,8 +420,10 @@ export default { that.start_date = year + "-" + month + "-01"; that.end_date = year + "-" + month + "-" + days; that.materialAll(); - that.barOption.yAxis.data=[]; - that.barOption.series.data=[]; + that.getmgroupMaterial(that.deptName1); + that.getmgroupMaterial(that.deptName2); + that.getmgroupMaterial(that.deptName3); + that.getmgroupMaterial(that.deptName4); that.getMgroups(that.deptName1); that.getMgroups(that.deptName2); that.getMgroups(that.deptName3); @@ -587,7 +447,7 @@ export default { top = top.substring(0,top.length-2); let topNumber = Number(top); let newTop = 0; - if(topNumber <= -85){ + if(topNumber <= -90){ newTop = 0; }else{ newTop =Number(top)-2.5; @@ -641,11 +501,7 @@ export default { that.mgroupsId += item.id + ','; //车间库存 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); + // that.getmgroupMaterial(item.name); }) } }); @@ -669,26 +525,20 @@ export default { }) }, //车间各工段生产产品数 - getmgroupMaterial(mgroupName) { + getmgroupMaterial(deptName) { let that = this; let params = { - query: {start_date:that.start_date,end_date:that.end_date,mgroup_name:mgroupName} + query: {start_date:that.start_date,end_date:that.end_date,dept_name:deptName} }; this.$API.bi.dataset.exec.req("mlog_okrate", params).then((res) => { if(res.data2.ds0.length>0){ let data = res.data2.ds0; - data.forEach((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.合格数; + data.forEach((item)=>{ + let obj = {}; + obj.name = item.工段; + obj.value = item.合格数; + that.config_left1.data.push(obj); }) - 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; } }); }, diff --git a/src/views/bigScreen/bxerp/niuzhuandept.vue b/src/views/bigScreen/bxerp/niuzhuandept.vue index b11900cb..458a5b3f 100644 --- a/src/views/bigScreen/bxerp/niuzhuandept.vue +++ b/src/views/bigScreen/bxerp/niuzhuandept.vue @@ -317,11 +317,16 @@ export default { yAxisIndex: 0, barCategoryGap: 50, barWidth: 10, + label: { + show: true, + position: "right", + color: "#fff", + }, itemStyle: { normal: { barBorderRadius: 5, color: function (params) { - return myColor[params.dataIndex]; + return myColor[params.dataIndex%5]; } }, label: { @@ -382,7 +387,8 @@ export default { data:[] }, config_left1:{ - data:[] + data:[], + showValue: true } , config_left2:{ data:[] diff --git a/src/views/bigScreen/bxerp/reyadept.vue b/src/views/bigScreen/bxerp/reyadept.vue index d2f3246f..e05a1db0 100644 --- a/src/views/bigScreen/bxerp/reyadept.vue +++ b/src/views/bigScreen/bxerp/reyadept.vue @@ -317,11 +317,16 @@ export default { yAxisIndex: 0, barCategoryGap: 50, barWidth: 10, + label: { + show: true, + position: "right", + color: "#fff", + }, itemStyle: { normal: { barBorderRadius: 5, color: function (params) { - return myColor[params.dataIndex]; + return myColor[params.dataIndex%5]; } }, label: { @@ -382,7 +387,8 @@ export default { data:[] }, config_left1:{ - data:[] + data:[], + showValue: true } , config_left2:{ data:[]