修改显示

master
夜笙歌 8 months ago
parent 7b87c057c5
commit 16e7f9898c

@ -241,7 +241,6 @@ export default {
this.$refs.chart3.setData(option2) this.$refs.chart3.setData(option2)
}) })
agvdata().then(e => { agvdata().then(e => {
console.log(e)
this.agvData = e.Data.filter(v => v.State === 2) this.agvData = e.Data.filter(v => v.State === 2)
}) })
PlanAchievementRate().then(e => { PlanAchievementRate().then(e => {
@ -279,57 +278,144 @@ export default {
createTimeStart: createTimeStart, createTimeStart: createTimeStart,
createTimeEnd: createTimeEnd, createTimeEnd: createTimeEnd,
chartType: 'cp' chartType: 'cp'
}).then(e => { }).then(vv => {
let e = vv.checkList
console.log(e)
let option = { let option = {
grid: {
top: '15%',
bottom: '10%',
left: '6%',
right: '6%'
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
// Use axis to trigger tooltip type: 'shadow',
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' label: {
show: true
}
} }
}, },
legend: { legend: {
right: 0,
textStyle: { textStyle: {
color: '#eee' color: '#eee'
} }
}, },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: { xAxis: {
type: 'value' data: e.map(v => v.machineName),
axisLine: {
show: true, //X线
lineStyle: {
color: '#fff'
}
},
axisTick: {
show: true //X
}, },
yAxis: {
type: 'category',
axisLabel: { axisLabel: {
color: '#ccc' interval:0,
show: true,
textStyle: {
color: '#fff' //X
}
}
}, },
data: e.checkList.map(v => v.machineName), yAxis: [
// data: e.checkList.map((v,k) => ''+k), {
type: 'value',
name: '合格数',
nameTextStyle: {
color: '#fff'
}, },
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#fff'
}
},
axisLabel: {
show: true,
textStyle: {
color: '#fff'
}
}
},
{
type: 'value',
name: '合格率',
nameTextStyle: {
color: '#fff'
},
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#fff'
}
},
axisLabel: {
show: true,
textStyle: {
color: '#fff'
}
}
}
],
series: [ series: [
{ {
name: '合格数量',
type: 'bar',
stack: 'total',
label: { label: {
show: true, show: true,
position: 'insideRight', position: 'top',
formatter: "{c}车", formatter: "{c}%",
color: "#000" color: "#fff"
}, },
emphasis: { name: '合格率',
focus: 'series' type: 'line',
yAxisIndex: 1,
smooth: true, //线
showAllSymbol: true, //
symbol: "emptyCircle", //
symbolSize: 5, //
// itemStyle: {
// //线
// color: "#058cff",
// },
// lineStyle: {
// color: "#058cff",
// },
// areaStyle: {
// color: "rgba(5,140,255, 0.2)",
// },
data: e.map(v => ((parseFloat(v.okQuality) / parseFloat(v.quality)) * 100).toFixed(2)),
}, },
{
label: {
show: true,
position: 'top',
formatter: "{c}",
color: "#fff"
},
itemStyle: { itemStyle: {
color: { color: {
type: 'linear', type: 'linear',
x: 0, x: 0,
y: 0, y: 1,
x2: 1, x2: 0,
y2: 0, y2: 0,
colorStops: [{ colorStops: [{
offset: 0, color: '#1e60f2' // 0% offset: 0, color: '#1e60f2' // 0%
@ -339,23 +425,102 @@ export default {
global: false // false global: false // false
} }
}, },
data: e.checkList.map(v => parseFloat(v.quality)) name: '合格数',
},
{
name: '不合格数量',
type: 'bar', type: 'bar',
stack: 'total', smooth: true, //线
label: { showAllSymbol: true, //
show: true, symbol: "emptyCircle", //
position: 'right' symbolSize: 5, //
}, // itemStyle: {
emphasis: { // //线
focus: 'series' // color: "#058cff",
}, // },
data: e.checkList.map(v => 0) // lineStyle: {
// color: "#058cff",
// },
// areaStyle: {
// color: "rgba(5,140,255, 0.2)",
// },
data: e.map(v => parseFloat(v.quality)),
}, },
] ]
}; };
// let option = {
// tooltip: {
// trigger: 'axis',
// axisPointer: {
// // Use axis to trigger tooltip
// type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
// }
// },
// legend: {
// textStyle: {
// color: '#eee'
// }
// },
// grid: {
// left: '3%',
// right: '4%',
// bottom: '3%',
// containLabel: true
// },
// xAxis: {
// type: 'value'
// },
// yAxis: {
// type: 'category',
// axisLabel: {
// color: '#ccc'
// },
// data: e.checkList.map(v => v.machineName),
// // data: e.checkList.map((v,k) => ''+k),
// },
// series: [
// {
// name: '',
// type: 'bar',
// stack: 'total',
// label: {
// show: true,
// position: 'insideRight',
// formatter: "{c}",
// color: "#000"
// },
// emphasis: {
// focus: 'series'
// },
// itemStyle: {
// color: {
// type: 'linear',
// x: 0,
// y: 0,
// x2: 1,
// y2: 0,
// colorStops: [{
// offset: 0, color: '#1e60f2' // 0%
// }, {
// offset: 1, color: '#00b9ff' // 100%
// }],
// global: false // false
// }
// },
// data: e.checkList.map(v => parseFloat(v.quality))
// },
// {
// name: '',
// type: 'bar',
// stack: 'total',
// label: {
// show: true,
// position: 'right'
// },
// emphasis: {
// focus: 'series'
// },
// data: e.checkList.map(v => 0)
// },
// ]
// };
this.$refs.chart1.setData(option) this.$refs.chart1.setData(option)
}) })
@ -593,6 +758,7 @@ export default {
left: 31.3%; left: 31.3%;
} }
.chart3 { .chart3 {
position: absolute; position: absolute;
width: 37.4%; width: 37.4%;

Loading…
Cancel
Save