fix:冷加工车间看板调整
This commit is contained in:
parent
a8a0774cc0
commit
251263d484
|
|
@ -12,7 +12,7 @@
|
|||
<dv-border-box-1>
|
||||
<div class="chartBlockTitle">本月各工段生产产品数</div>
|
||||
<div class="echartsWrap">
|
||||
<scEcharts id="barCharts" :option="barOption" style="height: 70.5vh;width: 96%;left: 2%;position: absolute;top: 0px;"/>
|
||||
<scEcharts id="barCharts" :option="barOption2" style="height: 140vh;width: 96%;left: 2%;position: absolute;top: 0px;"/>
|
||||
</div>
|
||||
<!-- <dv-capsule-chart :config="config_left1" class="leftChartBlock1"/> -->
|
||||
</dv-border-box-1>
|
||||
|
|
@ -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);
|
||||
});
|
||||
},
|
||||
//车间设备列表
|
||||
|
|
|
|||
Loading…
Reference in New Issue