master
夜笙歌 3 years ago
parent 6ebe8dba67
commit daa3eabcb7

@ -57,40 +57,36 @@ $(() => {
/*数据信息*/ /*数据信息*/
const statusArray = [0, 0, 0, 0, 0]; const statusArray = [0, 0, 0, 0, 0];
var a = () => { // var a = () => {
$.getJSON('/tankShellDevice/getDataInformation', function (result) { $.getJSON('/tankShellDevice/getDataInformation', function (result) {
console.log(result);
dataInformationFunction(result) dataInformationFunction(result)
}); });
$.getJSON('/tankShellDevice/getRunParameters', function (result) { $.getJSON('/tankShellDevice/getRunParameters', function (result) {
console.log(result); console.log(result);
energyProductionStatisticsFunction(result) energyProductionStatisticsFunction(result)
runParamStatisticsFunction(result)
$("#lossParam").text(result[8]);
$("#meterParam").text(result[9]);
}); });
$.getJSON('/tankShellDevice/getRunParameters', function (result) { $.getJSON('/tankShellDevice/getRunParameters', function (result) {
runParamStatisticsFunction(result) runParamStatisticsFunction(result)
}); });
} // }
dataInformationFunction(statusArray);
energyProductionStatisticsFunction(statusArray);
runParamStatisticsFunction(statusArray);
$("#lossParam").text(123.87);
$("#meterParam").text(123.65);
}) })
/*数据信息*/ /*数据信息*/
const dataInformationFunction = (statusArray) => { const dataInformationFunction = (statusArray) => {
let res = statusArray[0]
console.log(res);
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;"> let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 50%;"> <tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;"><i ${statusArray[0] == 1 ? 'style="color:green;"' : 'style="color: red;"'} class="fa-regular ${statusArray[0] == 1 ? "fa-circle-check" : "fa-circle-xmark"}"></i>${statusArray[0] == 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%;"><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;">389kW</td> <td style="border:0px solid red;text-align:center;width: 50%;color: #E6ECBE;"> ${res.devicePower}kW</td>
</tr> </tr>
<tr style="width: 100%; height: 50%;"> <tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;color: white;">4563kW·h</td> <td style="border:0px solid red;text-align:center;width: 50%;color: white;"> ${res.deviceEnergy}kW·h</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">2</td> <td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">2</td>
</tr> </tr>
</table>`; </table>`;
@ -102,10 +98,10 @@ const dataInformationFunction = (statusArray) => {
const energyProductionStatisticsFunction = (statusArray) => { const energyProductionStatisticsFunction = (statusArray) => {
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;"> let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 100%;"> <tr style="width: 100%; height: 100%;">
<td style="font-size:175%;border:0px solid red;width: 25%;text-align:center;color: #76BBE8;">68</td> <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;">675</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;">68</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;">675</td> <td style="font-size:175%;border:0px solid red;width: 25%;text-align:center;color: #8AE9A0;">${statusArray[3]}</td>
</tr> </tr>
</table>`; </table>`;
@ -114,10 +110,10 @@ const energyProductionStatisticsFunction = (statusArray) => {
const runParamStatisticsFunction = (statusArray) => { const runParamStatisticsFunction = (statusArray) => {
let info = ` let info = `
<div style="font-size:175%;left: 9%;color:#76BBE8">68</div> <div style="font-size:175%;left: 9%;color:#76BBE8">${statusArray[4]}</div>
<div style="font-size:175%;left: 35%;color:#C0818B">685</div> <div style="font-size:175%;left: 35%;color:#C0818B">${statusArray[5]}</div>
<div style="font-size:175%;left: 61%;color: #8AE9A0">685</div> <div style="font-size:175%;left: 61%;color: #8AE9A0">${statusArray[6]}</div>
<div style="font-size:175%;left: 87%;color:#D5D2AA">685</div> <div style="font-size:175%;left: 87%;color:#D5D2AA">${statusArray[7]}</div>
`; `;
$("#runParamStatistics").append(info); $("#runParamStatistics").append(info);

@ -57,40 +57,36 @@ $(() => {
/*数据信息*/ /*数据信息*/
const statusArray = [0, 0, 0, 0, 0]; const statusArray = [0, 0, 0, 0, 0];
var a = () => { // var a = () => {
$.getJSON('/tankShellDevice/getDataInformation', function (result) { $.getJSON('/tankShellDevice/getDataInformation', function (result) {
console.log(result);
dataInformationFunction(result) dataInformationFunction(result)
}); });
$.getJSON('/tankShellDevice/getRunParameters', function (result) { $.getJSON('/tankShellDevice/getRunParameters', function (result) {
console.log(result); console.log(result);
energyProductionStatisticsFunction(result) energyProductionStatisticsFunction(result)
runParamStatisticsFunction(result)
$("#lossParam").text(result[8]);
$("#meterParam").text(result[9]);
}); });
$.getJSON('/tankShellDevice/getRunParameters', function (result) { $.getJSON('/tankShellDevice/getRunParameters', function (result) {
runParamStatisticsFunction(result) runParamStatisticsFunction(result)
}); });
} // }
dataInformationFunction(statusArray);
energyProductionStatisticsFunction(statusArray);
runParamStatisticsFunction(statusArray);
$("#lossParam").text(123.87);
$("#meterParam").text(123.65);
}) })
/*数据信息*/ /*数据信息*/
const dataInformationFunction = (statusArray) => { const dataInformationFunction = (statusArray) => {
let res = statusArray[0]
console.log(res);
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;"> let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 50%;"> <tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;"><i ${statusArray[0] == 1 ? 'style="color:green;"' : 'style="color: red;"'} class="fa-regular ${statusArray[0] == 1 ? "fa-circle-check" : "fa-circle-xmark"}"></i>${statusArray[0] == 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%;"><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;">389kW</td> <td style="border:0px solid red;text-align:center;width: 50%;color: #E6ECBE;"> ${res.devicePower}kW</td>
</tr> </tr>
<tr style="width: 100%; height: 50%;"> <tr style="width: 100%; height: 50%;">
<td style="border:0px solid red;text-align:center;width: 50%;color: white;">4563kW·h</td> <td style="border:0px solid red;text-align:center;width: 50%;color: white;"> ${res.deviceEnergy}kW·h</td>
<td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">2</td> <td style="border:0px solid red;text-align:center;width: 50%;color: #D18DA2;">2</td>
</tr> </tr>
</table>`; </table>`;
@ -102,10 +98,10 @@ const dataInformationFunction = (statusArray) => {
const energyProductionStatisticsFunction = (statusArray) => { const energyProductionStatisticsFunction = (statusArray) => {
let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;"> let info = `<table style="position: absolute;top: 8%;width: 100%;height:100%;">
<tr style="width: 100%; height: 100%;"> <tr style="width: 100%; height: 100%;">
<td style="font-size:175%;border:0px solid red;width: 25%;text-align:center;color: #76BBE8;">68</td> <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;">675</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;">68</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;">675</td> <td style="font-size:175%;border:0px solid red;width: 25%;text-align:center;color: #8AE9A0;">${statusArray[3]}</td>
</tr> </tr>
</table>`; </table>`;
@ -114,10 +110,10 @@ const energyProductionStatisticsFunction = (statusArray) => {
const runParamStatisticsFunction = (statusArray) => { const runParamStatisticsFunction = (statusArray) => {
let info = ` let info = `
<div style="font-size:175%;left: 9%;color:#76BBE8">68</div> <div style="font-size:175%;left: 9%;color:#76BBE8">${statusArray[4]}</div>
<div style="font-size:175%;left: 35%;color:#C0818B">685</div> <div style="font-size:175%;left: 35%;color:#C0818B">${statusArray[5]}</div>
<div style="font-size:175%;left: 61%;color: #8AE9A0">685</div> <div style="font-size:175%;left: 61%;color: #8AE9A0">${statusArray[6]}</div>
<div style="font-size:175%;left: 87%;color:#D5D2AA">685</div> <div style="font-size:175%;left: 87%;color:#D5D2AA">${statusArray[7]}</div>
`; `;
$("#runParamStatistics").append(info); $("#runParamStatistics").append(info);

Loading…
Cancel
Save