|
|
|
|
@ -94,7 +94,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
<template #header><span class="card-title">车间产量对比(今日)</span></template>
|
|
|
|
|
<template #header><span class="card-title">车间平均单机产量(今日)</span></template>
|
|
|
|
|
<div ref="workshopChartRef" style="height: 260px"></div>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
@ -266,17 +266,24 @@ function initCharts() {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 车间产量柱状图
|
|
|
|
|
// 车间平均单机产量柱状图
|
|
|
|
|
if (workshopChartRef.value && workshopData.value.length) {
|
|
|
|
|
workshopChart = echarts.init(workshopChartRef.value)
|
|
|
|
|
workshopChart.setOption({
|
|
|
|
|
tooltip: { trigger: 'axis' },
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
formatter: (params: any) => {
|
|
|
|
|
const d = workshopData.value[params[0].dataIndex]
|
|
|
|
|
return `${d.workshopName}<br/>平均产量: ${params[0].value} 件/台<br/>总产量: ${d.quantity} 件<br/>机床数: ${d.machineCount} 台`
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
grid: { left: 50, right: 20, top: 20, bottom: 30 },
|
|
|
|
|
xAxis: { type: 'category', data: workshopData.value.map(i => i.workshopName), axisLabel: { fontSize: 12 } },
|
|
|
|
|
yAxis: { type: 'value', axisLabel: { fontSize: 12 } },
|
|
|
|
|
yAxis: { type: 'value', name: '件/台', axisLabel: { fontSize: 12 } },
|
|
|
|
|
series: [{
|
|
|
|
|
type: 'bar', data: workshopData.value.map(i => i.quantity),
|
|
|
|
|
type: 'bar', data: workshopData.value.map(i => i.avgQuantity),
|
|
|
|
|
itemStyle: { color: '#67C23A', borderRadius: [4, 4, 0, 0] }, barWidth: '40%',
|
|
|
|
|
label: { show: true, position: 'top', formatter: '{c} 件/台', fontSize: 12 },
|
|
|
|
|
}],
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|