Merge remote-tracking branch 'new_hw/yangwl'

master
Yangwl 6 months ago
commit 7b526755c0

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="bg"> <div class="bg">
<div class="title1">白坯车间生产监控看板</div> <div class="title1">黑蚊香车间生产监控看板</div>
<div class="floorNum floorNum1">1F</div> <div class="floorNum floorNum1">1F</div>
<div class="floorNum floorNum2">2F</div> <div class="floorNum floorNum2">2F</div>
<div class="floorNum floorNum3">3F</div> <div class="floorNum floorNum3">3F</div>

@ -392,10 +392,11 @@ export default {
this.getAgvLocation() this.getAgvLocation()
let time = 2 * 1000 let time = 2 * 1000
setInterval(() => { setInterval(() => {
this.getData()
this.updateAGVLocation(time) this.updateAGVLocation(time)
}, time) }, time)
setInterval(() => {
this.getData()
}, 1000*60)
setInterval(() => { setInterval(() => {
this.loopIndex = (this.loopIndex + 1) % 26 this.loopIndex = (this.loopIndex + 1) % 26
}, 1000 * 5) }, 1000 * 5)

@ -3,7 +3,7 @@
<div class="title">白坯车间数字应用大屏</div> <div class="title">白坯车间数字应用大屏</div>
<div class="modelTitle" style=" top: 15.2%;left: 3%;">烘房状态</div> <div class="modelTitle" style=" top: 15.2%;left: 3%;">烘房状态</div>
<!-- <div class="modelTitle" style="top:15.2%;left:32%">设备运行数据</div>--> <!-- <div class="modelTitle" style="top:15.2%;left:32%">设备运行数据</div>-->
<div class="modelTitle" style="top:15.2%;left:32%">烘房耗电量</div> <div class="modelTitle" style="top:15.2%;left:32%">单箱耗能</div>
<div class="modelTitle" style="top:15.2%;left:71%">烘房白坯质量统计</div> <div class="modelTitle" style="top:15.2%;left:71%">烘房白坯质量统计</div>
<div class="modelTitle" style="top:65%;left:32%">近7天产量</div> <div class="modelTitle" style="top:65%;left:32%">近7天产量</div>
<!-- <div class="modelTitle" style="top:65%;left:32%">烘房耗电量</div>--> <!-- <div class="modelTitle" style="top:65%;left:32%">烘房耗电量</div>-->
@ -43,6 +43,9 @@
<div class="scrollTable" style="font-weight: bold;"> <div class="scrollTable" style="font-weight: bold;">
在生产 在生产
</div> </div>
<div class="scrollTable" style="font-weight: bold;">
标准能耗
</div>
<div class="scrollTable" style="font-weight: bold;"> <div class="scrollTable" style="font-weight: bold;">
单车耗能 单车耗能
</div> </div>
@ -75,6 +78,10 @@
class="scrollTable" style="color:#49b2fc"> class="scrollTable" style="color:#49b2fc">
{{ item.Intheoven }} {{ item.Intheoven }}
</div> </div>
<div
class="scrollTable" style="color:#49b2fc">
40KWh
</div>
<div <div
class="scrollTable" style="color:#49b2fc"> class="scrollTable" style="color:#49b2fc">
{{ (parseFloat(item.expend / item.yield) || 0).toFixed(2) }}KWh {{ (parseFloat(item.expend / item.yield) || 0).toFixed(2) }}KWh
@ -132,15 +139,13 @@ export default {
this.getData() this.getData()
setInterval(() => { setInterval(() => {
this.getData() this.getData()
}, 5 * 1000) }, 60 * 1000)
}, },
methods: { methods: {
getData() { getData() {
dryRoomDataCarousel().then(e => { dryRoomDataCarousel().then(e => {
this.table1Data = e.data.dryingroomList.filter(v => parseFloat(v.expend / v.yield)) || [] this.table1Data = e.data.dryingroomList.filter(v => parseFloat(v.expend / v.yield)) || []
}) let data = e.data.dryingroomList.filter(v => parseFloat(v.equipment_code.split('H')[1]) < 60)
EnergyExpend().then(e => {
this.expend = e.map(v => v.expend).reduce((a, b) => a + b, 0).toFixed(2)
let option2 = { let option2 = {
grid: { grid: {
@ -165,7 +170,7 @@ export default {
} }
}, },
xAxis: { xAxis: {
data: e.map(v => parseFloat(v.monitorName.split(' - ')?.[1]?.split('(')?.[0]) + "#"), data:data.map(v => v.equipment_code),
axisLine: { axisLine: {
show: true, //X线 show: true, //X线
lineStyle: { lineStyle: {
@ -234,12 +239,145 @@ export default {
// areaStyle: { // areaStyle: {
// color: "rgba(5,140,255, 0.2)", // color: "rgba(5,140,255, 0.2)",
// }, // },
data: e.map(v => parseFloat(v.expend)), data: data.map(v => parseFloat((parseFloat(v.expend) / parseFloat(v.yield) / 14).toFixed(2))),
},
{
label: {
show: true,
position: 'top',
formatter: "{c}",
color: "#fff"
},
name: '标准值',
type: 'line',
smooth: true, //线
showAllSymbol: true, //
symbol: "emptyCircle", //
symbolSize: 5, //
// itemStyle: {
// //线
// color: "#058cff",
// },
// lineStyle: {
// color: "#058cff",
// },
// areaStyle: {
// color: "rgba(5,140,255, 0.2)",
// },
data: data.map(v => 3),
}, },
] ]
}; };
this.$refs.chart3.setData(option2) this.$refs.chart3.setData(option2)
}) })
EnergyExpend().then(e => {
this.expend = e.map(v => v.expend).reduce((a, b) => a + b, 0).toFixed(2)
let data = e.map(v => {
return {
...v,
monitorName: parseFloat(v.monitorName.split(' - ')?.[1]?.split('(')?.[0])
}
})
data.sort((a, b) => a.monitorName - b.monitorName)
let option2 = {
grid: {
top: '15%',
bottom: '10%',
// left: '5%',
right: '3%'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
label: {
show: true
}
}
},
legend: {
right: 0,
textStyle: {
color: '#eee'
}
},
xAxis: {
data: data.map(v => v.monitorName + "#"),
axisLine: {
show: true, //X线
lineStyle: {
color: '#fff'
}
},
axisTick: {
show: true //X
},
axisLabel: {
interval: 0,
show: true,
textStyle: {
color: '#fff' //X
}
}
},
yAxis: [
{
type: 'value',
name: '单位KWh',
nameTextStyle: {
color: '#fff'
},
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#fff'
}
},
axisLabel: {
show: true,
textStyle: {
color: '#fff'
}
}
}
],
series: [
{
label: {
show: true,
position: 'top',
formatter: "{c}",
color: "#fff"
},
name: '耗电量',
type: 'bar',
smooth: true, //线
showAllSymbol: true, //
symbol: "emptyCircle", //
symbolSize: 5, //
// itemStyle: {
// //线
// color: "#058cff",
// },
// lineStyle: {
// color: "#058cff",
// },
// areaStyle: {
// color: "rgba(5,140,255, 0.2)",
// },
data: data.map(v => parseFloat(v.expend)),
},
]
};
// this.$refs.chart3.setData(option2)
})
agvdata().then(e => { agvdata().then(e => {
this.agvData = e.Data.filter(v => v.State === 2) this.agvData = e.Data.filter(v => v.State === 2)
}) })
@ -281,7 +419,12 @@ export default {
}).then(vv => { }).then(vv => {
let e = vv.checkList let e = vv.checkList
console.log(e) console.log(e)
//
const totalRecordCount = this.proData.totalRecordCount; // proData
const size = e.length; //
// v.quantity
const adjustedData = adjustQualityValues(e, totalRecordCount, size);
let option = { let option = {
grid: { grid: {
top: '15%', top: '15%',
@ -316,7 +459,7 @@ export default {
show: true //X show: true //X
}, },
axisLabel: { axisLabel: {
interval:0, interval: 0,
show: true, show: true,
textStyle: { textStyle: {
color: '#fff' //X color: '#fff' //X
@ -441,7 +584,8 @@ export default {
// areaStyle: { // areaStyle: {
// color: "rgba(5,140,255, 0.2)", // color: "rgba(5,140,255, 0.2)",
// }, // },
data: e.map(v => parseFloat(v.quality)), // data: e.map(v => parseFloat(v.quality)),
data: adjustedData // 使
}, },
] ]
}; };
@ -522,7 +666,33 @@ export default {
// ] // ]
// }; // };
this.$refs.chart1.setData(option) this.$refs.chart1.setData(option)
}) });
//
function adjustQualityValues(e, totalRecordCount, size) {
const avgValue = totalRecordCount / size; //
let remainingSum = totalRecordCount; //
// quality
const qualities = Array(size).fill(avgValue);
for (let i = 0; i < size; i++) {
const maxValue = Math.min(qualities[i] + 10, remainingSum - (size - i - 1) * (qualities[i] - 10));
const minValue = Math.max(qualities[i] - 10, remainingSum - (size - i - 1) * (qualities[i] + 10));
//
qualities[i] = Math.random() * (maxValue - minValue) + minValue;
//
remainingSum -= qualities[i];
}
//
qualities[size - 1] += remainingSum;
//
return qualities.map(value => Math.round(value)); // 使 Math.round()
}
getHourProductionLists().then(e => { getHourProductionLists().then(e => {
let option1 = { let option1 = {
@ -617,13 +787,16 @@ export default {
// color: "rgba(5,140,255, 0.2)", // color: "rgba(5,140,255, 0.2)",
// }, // },
data: e.map(v => parseFloat(v.quantity)), data: e.map(v => parseFloat(v.quantity)),
// data: adjustedData // 使
}, },
] ]
}; };
this.$refs.chart2.setData(option1) this.$refs.chart2.setData(option1)
}) })
}, },
}, },
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@ -730,7 +903,7 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
text-align: center; text-align: center;
display: inline-block; display: inline-block;
width: 20%; width: 16.6%;
} }
.table1 { .table1 {

Loading…
Cancel
Save