diff --git a/productionboard/src/main/resources/static/js/tankShell/device.js b/productionboard/src/main/resources/static/js/tankShell/device.js index 22f447e..9b66238 100644 --- a/productionboard/src/main/resources/static/js/tankShell/device.js +++ b/productionboard/src/main/resources/static/js/tankShell/device.js @@ -57,40 +57,36 @@ $(() => { /*数据信息*/ const statusArray = [0, 0, 0, 0, 0]; - var a = () => { + // var a = () => { $.getJSON('/tankShellDevice/getDataInformation', function (result) { - console.log(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) }); - } - dataInformationFunction(statusArray); - - energyProductionStatisticsFunction(statusArray); - - runParamStatisticsFunction(statusArray); - - $("#lossParam").text(123.87); - - $("#meterParam").text(123.65); + // } }) /*数据信息*/ const dataInformationFunction = (statusArray) => { + let res = statusArray[0] + console.log(res); let info = ` - - + + - +
${statusArray[0] == 1 ? `运行正常` : `运行异常`}389kW${res.deviceStatus == 1 ? `运行正常` : `运行异常`} ${res.devicePower}kW
4563kW·h ${res.deviceEnergy}kW·h 2
`; @@ -102,10 +98,10 @@ const dataInformationFunction = (statusArray) => { const energyProductionStatisticsFunction = (statusArray) => { let info = ` - - - - + + + +
6867568675${statusArray[0]}${statusArray[1]}${statusArray[2]}${statusArray[3]}
`; @@ -114,10 +110,10 @@ const energyProductionStatisticsFunction = (statusArray) => { const runParamStatisticsFunction = (statusArray) => { let info = ` -
68
-
685
-
685
-
685
+
${statusArray[4]}
+
${statusArray[5]}
+
${statusArray[6]}
+
${statusArray[7]}
`; $("#runParamStatistics").append(info); diff --git a/productionboard/target/classes/static/js/tankShell/device.js b/productionboard/target/classes/static/js/tankShell/device.js index 22f447e..9b66238 100644 --- a/productionboard/target/classes/static/js/tankShell/device.js +++ b/productionboard/target/classes/static/js/tankShell/device.js @@ -57,40 +57,36 @@ $(() => { /*数据信息*/ const statusArray = [0, 0, 0, 0, 0]; - var a = () => { + // var a = () => { $.getJSON('/tankShellDevice/getDataInformation', function (result) { - console.log(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) }); - } - dataInformationFunction(statusArray); - - energyProductionStatisticsFunction(statusArray); - - runParamStatisticsFunction(statusArray); - - $("#lossParam").text(123.87); - - $("#meterParam").text(123.65); + // } }) /*数据信息*/ const dataInformationFunction = (statusArray) => { + let res = statusArray[0] + console.log(res); let info = ` - - + + - +
${statusArray[0] == 1 ? `运行正常` : `运行异常`}389kW${res.deviceStatus == 1 ? `运行正常` : `运行异常`} ${res.devicePower}kW
4563kW·h ${res.deviceEnergy}kW·h 2
`; @@ -102,10 +98,10 @@ const dataInformationFunction = (statusArray) => { const energyProductionStatisticsFunction = (statusArray) => { let info = ` - - - - + + + +
6867568675${statusArray[0]}${statusArray[1]}${statusArray[2]}${statusArray[3]}
`; @@ -114,10 +110,10 @@ const energyProductionStatisticsFunction = (statusArray) => { const runParamStatisticsFunction = (statusArray) => { let info = ` -
68
-
685
-
685
-
685
+
${statusArray[4]}
+
${statusArray[5]}
+
${statusArray[6]}
+
${statusArray[7]}
`; $("#runParamStatistics").append(info);