$(() => {
//设备OEE统计
$.getJSON('/tankShellDevice/getOeeStatistics', function (result) {
OEEStatistics(result, document.getElementById("OEEStatistics"));
});
setInterval(() => {
// OEEStatistics(result, document.getElementById("OEEStatistics"));
}, 1000);
//设备故障排名
$.getJSON('/tankShell/getStatisticalOutputByModel', function (result) {
equipmentFailure(result, document.getElementById("equipmentFailure"));
});
//loss
$.getJSON('/tankShellDevice/getLossStatistics', function (result) {
loss(result, document.getElementById("loss"));
});
//设备产量能耗对比
$.getJSON('/tankShellDevice/getEnergyConsumption', function (result) {
energyConsumption(result, document.getElementById("energyConsumption"));
});
const tableRes = {}
//生产计划
const getTable = () => {
$.ajax({
url: '/tankShellDevice/getDeviceParameterValue',
type: 'GET',
dataType: 'JSON',
success: function (res) {
if (res.length === tableRes.data?.length) return
console.log(res.length +'+'+ tableRes.data?.length);
$('#productionPlan').remove()
$('.scrollTable').html('
')
tableRes.data = res.map(val => [val.deviceId, val.prameterName, val.prameterValue, val.createTime,])
tableRes.header = ['设备名称', '参数名称', '当前值', '时间',]
dynamicTable({
el: '#productionPlan',
rowNum: 5,
timeout: 0,
header: tableRes.header,
data: tableRes.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)
}
});
}
getTable()
setInterval(() => {
getTable()
}, 10000);
tableAnimation('#productionPlan')
/*数据信息*/
$.getJSON('/tankShellDevice/getDataInformation', function (result) {
dataInformationFunction(result)
});
$.getJSON('/tankShellDevice/getRunParameters', function (result) {
console.log(result);
energyProductionStatisticsFunction(result)
runParamStatisticsFunction(result)
$("#lossParam").text(result[8]);
$("#meterParam").text(result[9]);
});
$.getJSON('/tankShellDevice/getRunParameters', function (result) {
runParamStatisticsFunction(result)
});
})
/*数据信息*/
const dataInformationFunction = (statusArray) => {
let res = statusArray[0]
console.log(res);
let info = `
${res.deviceStatus == 1 ? `正常` : `异常`} |
${res.devicePower}kW |
${res.deviceEnergy}kW·h |
2 |
`;
$("#dataInformation").append(info);
}
/*能耗产量统计*/
const energyProductionStatisticsFunction = (statusArray) => {
let info = `
${statusArray[0]} |
${statusArray[1]} |
${statusArray[2]} |
${statusArray[3]} |
`;
$("#energyProductionStatistics").append(info);
}
const runParamStatisticsFunction = (statusArray) => {
let info = `
${statusArray[4]}
${statusArray[5]}
${statusArray[6]}
${statusArray[7]}
`;
$("#runParamStatistics").append(info);
}