You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.9 KiB
JavaScript

3 years ago
$(() => {
//设备OEE统计
$.getJSON('/tankShellDevice/getOeeStatistics', function (result) {
OEEStatistics(result, document.getElementById("OEEStatistics"));
});
//设备故障排名
$.getJSON('/tankShell/getStatisticalOutputByModel', function (result) {
equipmentFailure(result, document.getElementById("equipmentFailure"));
});
//loss
$.getJSON('/tankShell/getInventoryStatistics', function (result) {
loss(result, document.getElementById("loss"));
});
//设备产量能耗对比
$.getJSON('/tankShellDevice/getEnergyConsumption', function (result) {
energyConsumption(result, document.getElementById("energyConsumption"));
});
//生产计划
$.ajax({
url: '/storage/getProductionPlan',
type: 'GET',
dataType: 'JSON',
success: function (res) {
let Res = res
Res.data.forEach(val => {
val[0] = 'SHEBEI452736'
val[1] = 'AGYM45HH23'
val[2] = '32'
val[3] = '2021.01.01 10:00:00'
delete val[4]
});
Res.header = ['设备名称', '参数名称', '当前值', '时间',]
dynamicTable({
el: '#productionPlan',
rowNum: 5,
timeout: 0,
header: Res.header,
data: Res.data,
index: false,
fontColor: '#B4B7BF ',
indexBGC: '#86F3FF',
headerBGC: 'rgba(8,36,75,0.2)',
oddRowBGC: 'rgba(8,36,75,0.2)',
evenRowBGC: 'rgba(6,25,57,0.2)',
colWidth: ['100%', '100%', '40%', '160%',]
});
},
error: function (e) {
console.log(e)
}
});
/*数据信息*/
const statusArray = [0, 0, 0, 0, 0];
3 years ago
// var a = () => {
3 years ago
$.getJSON('/tankShellDevice/getDataInformation', function (result) {
dataInformationFunction(result)
});
$.getJSON('/tankShellDevice/getRunParameters', function (result) {
console.log(result);
energyProductionStatisticsFunction(result)
3 years ago
runParamStatisticsFunction(result)
$("#lossParam").text(result[8]);
$("#meterParam").text(result[9]);
3 years ago
});
$.getJSON('/tankShellDevice/getRunParameters', function (result) {
runParamStatisticsFunction(result)
});
3 years ago
// }
3 years ago
})
/*数据信息*/
const dataInformationFunction = (statusArray) => {
3 years ago
let res = statusArray[0]
console.log(res);
3 years ago
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 50%;">
3 years ago
<td style="border:0px solid red;text-align:center;width: 50%;"><i ${res.deviceStatus == 1 ? 'style="color:green;"' : 'style="color: red;"'} class="fa-regular ${res.deviceStatus == 1 ? "fa-circle-check" : "fa-circle-xmark"}"></i>${res.deviceStatus == 1 ? `<span style="color:green;margin-left: 10px"></span>` : `<span style="color:red;margin-left: 10px"></span>`}</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #E6ECBE;"> ${res.devicePower}kW</td>
3 years ago
</tr>
<tr style="width: 100%; height: 50%;">
3 years ago
<td style="border:0px solid red;text-align:center;width: 50%;color: white;"> ${res.deviceEnergy}kW·h</td>
3 years ago
<td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">2</td>
</tr>
</table>`;
$("#dataInformation").append(info);
}
/*能耗产量统计*/
const energyProductionStatisticsFunction = (statusArray) => {
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 100%;">
3 years ago
<td style="font-size:175%;border:0px solid red;width: 25%;text-align:center;color: #76BBE8;">${statusArray[0]}</td>
<td style="font-size:175%;border:0px solid red;width: 25%;text-align:center;color: #8AE9A0;">${statusArray[1]}</td>
<td style="font-size:175%;border:0px solid red;width: 25%;text-align:center;color: #76BBE8;">${statusArray[2]}</td>
<td style="font-size:175%;border:0px solid red;width: 25%;text-align:center;color: #8AE9A0;">${statusArray[3]}</td>
3 years ago
</tr>
</table>`;
$("#energyProductionStatistics").append(info);
}
const runParamStatisticsFunction = (statusArray) => {
let info = `
3 years ago
<div style="font-size:175%;left: 9%;color:#76BBE8">${statusArray[4]}</div>
<div style="font-size:175%;left: 35%;color:#C0818B">${statusArray[5]}</div>
<div style="font-size:175%;left: 61%;color: #8AE9A0">${statusArray[6]}</div>
<div style="font-size:175%;left: 87%;color:#D5D2AA">${statusArray[7]}</div>
3 years ago
`;
$("#runParamStatistics").append(info);
}