|
@@ -1,5 +1,5 @@
|
|
|
const test50 = (function () {
|
|
|
- function test50(id, domTitle) {
|
|
|
+ function test50 (id, domTitle) {
|
|
|
if (domTitle) {
|
|
|
$(".test50 .title h2").text(domTitle);
|
|
|
}
|
|
@@ -35,158 +35,178 @@ const test50 = (function () {
|
|
|
// slide.onmouseout = function () {
|
|
|
// MyMar = setInterval(Marquee, speed);
|
|
|
// };
|
|
|
+
|
|
|
// 二号楼中心机房
|
|
|
- $.ajax({
|
|
|
- url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
- data: {
|
|
|
- deviceName: "八楼",
|
|
|
- },
|
|
|
- success: function ({ data }) {
|
|
|
- // 温度
|
|
|
- let temperature = data.filter((item) => {
|
|
|
- return item.signalname === "温度";
|
|
|
- })[0].signalvalue;
|
|
|
- // 湿度
|
|
|
- let humidity = data.filter((item) => {
|
|
|
- return item.signalname === "湿度";
|
|
|
- })[0].signalvalue;
|
|
|
-
|
|
|
- $(".test50 .box50 .item")
|
|
|
- .eq(1)
|
|
|
- .find(".temp")
|
|
|
- .find("span")
|
|
|
- .eq(0)
|
|
|
- .html(temperature + "℃");
|
|
|
- $(".test50 .box50 .item")
|
|
|
- .eq(1)
|
|
|
- .find(".temp")
|
|
|
- .find("span")
|
|
|
- .eq(1)
|
|
|
- .html(humidity + "℃");
|
|
|
- },
|
|
|
- error: function (err) {
|
|
|
- console.log("--机房接口八楼,二号楼-------------超时");
|
|
|
- },
|
|
|
- });
|
|
|
+ function roomAjax1 () {
|
|
|
+ $.ajax({
|
|
|
+ url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
+ data: {
|
|
|
+ deviceName: "八楼",
|
|
|
+ },
|
|
|
+ success: function ({ data }) {
|
|
|
+ // 温度
|
|
|
+ let temperature = data.filter((item) => {
|
|
|
+ return item.signalname === "温度";
|
|
|
+ })[0].signalvalue;
|
|
|
+ // 湿度
|
|
|
+ let humidity = data.filter((item) => {
|
|
|
+ return item.signalname === "湿度";
|
|
|
+ })[0].signalvalue;
|
|
|
+
|
|
|
+ $(".test50 .box50 .item")
|
|
|
+ .eq(1)
|
|
|
+ .find(".temp")
|
|
|
+ .find("span")
|
|
|
+ .eq(0)
|
|
|
+ .html(temperature + "℃");
|
|
|
+ $(".test50 .box50 .item")
|
|
|
+ .eq(1)
|
|
|
+ .find(".temp")
|
|
|
+ .find("span")
|
|
|
+ .eq(1)
|
|
|
+ .html(humidity + "℃");
|
|
|
+ },
|
|
|
+ error: function (err) {
|
|
|
+ console.log("--机房接口八楼,二号楼-------------超时");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 网络核心机房
|
|
|
- $.ajax({
|
|
|
- url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
- data: {
|
|
|
- deviceName: "四楼",
|
|
|
- },
|
|
|
- success: function ({ data }) {
|
|
|
- console.log('网络核心机房',data);
|
|
|
- // 温度
|
|
|
- let temperature = data.filter((item) => {
|
|
|
- return item.signalname === "温度";
|
|
|
- })[0].signalvalue;
|
|
|
- // 湿度
|
|
|
- let humidity = data.filter((item) => {
|
|
|
- return item.signalname === "湿度";
|
|
|
- })[0].signalvalue;
|
|
|
-
|
|
|
- $(".test50 .box50 .item")
|
|
|
- .eq(0)
|
|
|
- .find(".temp")
|
|
|
- .find("span")
|
|
|
- .eq(0)
|
|
|
- .html(temperature + "℃");
|
|
|
- $(".test50 .box50 .item")
|
|
|
- .eq(0)
|
|
|
- .find(".temp")
|
|
|
- .find("span")
|
|
|
- .eq(1)
|
|
|
- .html(humidity + "℃");
|
|
|
- },
|
|
|
- error: function (err) {
|
|
|
- console.log("--网络核心机房-------------超时");
|
|
|
- },
|
|
|
- });
|
|
|
+ function roomAjax2 () {
|
|
|
+ $.ajax({
|
|
|
+ url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
+ data: {
|
|
|
+ deviceName: "四楼",
|
|
|
+ },
|
|
|
+ success: function ({ data }) {
|
|
|
+ console.log('网络核心机房', data);
|
|
|
+ // 温度
|
|
|
+ let temperature = data.filter((item) => {
|
|
|
+ return item.signalname === "温度";
|
|
|
+ })[0].signalvalue;
|
|
|
+ // 湿度
|
|
|
+ let humidity = data.filter((item) => {
|
|
|
+ return item.signalname === "湿度";
|
|
|
+ })[0].signalvalue;
|
|
|
+
|
|
|
+ $(".test50 .box50 .item")
|
|
|
+ .eq(0)
|
|
|
+ .find(".temp")
|
|
|
+ .find("span")
|
|
|
+ .eq(0)
|
|
|
+ .html(temperature + "℃");
|
|
|
+ $(".test50 .box50 .item")
|
|
|
+ .eq(0)
|
|
|
+ .find(".temp")
|
|
|
+ .find("span")
|
|
|
+ .eq(1)
|
|
|
+ .html(humidity + "℃");
|
|
|
+ },
|
|
|
+ error: function (err) {
|
|
|
+ console.log("--网络核心机房-------------超时");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
// 配线间机房
|
|
|
- $.ajax({
|
|
|
- url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
- data: {
|
|
|
- deviceName: "九楼",
|
|
|
- },
|
|
|
- success: function ({ data }) {
|
|
|
- // 温度
|
|
|
- let temperature = data.filter((item) => {
|
|
|
- return item.signalname === "温度";
|
|
|
- })[0].signalvalue;
|
|
|
- // 湿度
|
|
|
- let humidity = data.filter((item) => {
|
|
|
- return item.signalname === "湿度";
|
|
|
- })[0].signalvalue;
|
|
|
- $(".test50 .box50 .item")
|
|
|
- .eq(2)
|
|
|
- .find(".temp")
|
|
|
- .find("span")
|
|
|
- .eq(0)
|
|
|
- .html(temperature + "℃");
|
|
|
- $(".test50 .box50 .item")
|
|
|
- .eq(2)
|
|
|
- .find(".temp")
|
|
|
- .find("span")
|
|
|
- .eq(1)
|
|
|
- .html(humidity + "℃");
|
|
|
- },
|
|
|
- error: function (err) {
|
|
|
- console.log("--配线间机房-------------超时");
|
|
|
- },
|
|
|
- });
|
|
|
+ function roomAjax3 () {
|
|
|
+ $.ajax({
|
|
|
+ url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
+ data: {
|
|
|
+ deviceName: "九楼",
|
|
|
+ },
|
|
|
+ success: function ({ data }) {
|
|
|
+ // 温度
|
|
|
+ let temperature = data.filter((item) => {
|
|
|
+ return item.signalname === "温度";
|
|
|
+ })[0].signalvalue;
|
|
|
+ // 湿度
|
|
|
+ let humidity = data.filter((item) => {
|
|
|
+ return item.signalname === "湿度";
|
|
|
+ })[0].signalvalue;
|
|
|
+ $(".test50 .box50 .item")
|
|
|
+ .eq(2)
|
|
|
+ .find(".temp")
|
|
|
+ .find("span")
|
|
|
+ .eq(0)
|
|
|
+ .html(temperature + "℃");
|
|
|
+ $(".test50 .box50 .item")
|
|
|
+ .eq(2)
|
|
|
+ .find(".temp")
|
|
|
+ .find("span")
|
|
|
+ .eq(1)
|
|
|
+ .html(humidity + "℃");
|
|
|
+ },
|
|
|
+ error: function (err) {
|
|
|
+ console.log("--配线间机房-------------超时");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
// 档案室库房
|
|
|
- $.ajax({
|
|
|
- /** url,data参数,
|
|
|
- * type请求类型,响应体结果,超时时间
|
|
|
- * 成功的回调,失败回调 */
|
|
|
- url: DH + "queryData/queryDeviceParam",
|
|
|
- data: {
|
|
|
- urlCode: "DH_002",
|
|
|
- },
|
|
|
- type: "GET",
|
|
|
- dataType: "JSON",
|
|
|
- success: function ({ data }) {
|
|
|
- console.log("档案室库房", data);
|
|
|
- // 温度
|
|
|
- let temperature = data
|
|
|
- .filter((item) => {
|
|
|
- if (item.sname === "环境温度") {
|
|
|
- return true;
|
|
|
- }
|
|
|
- })
|
|
|
- .reduce((cur, item) => {
|
|
|
- return cur + parseFloat(item.value);
|
|
|
- }, 0);
|
|
|
- // 湿度
|
|
|
- let humidity = data
|
|
|
- .filter((item) => {
|
|
|
- if (item.sname === "环境湿度") {
|
|
|
- return true;
|
|
|
- }
|
|
|
- })
|
|
|
- .reduce((cur, item) => {
|
|
|
- return cur + parseFloat(item.value);
|
|
|
- }, 0);
|
|
|
- $(".test50 .box50 .item")
|
|
|
- .eq(3)
|
|
|
- .find(".temp")
|
|
|
- .find("span")
|
|
|
- .eq(0)
|
|
|
- .html(temperature + "℃");
|
|
|
- $(".test50 .box50 .item")
|
|
|
- .eq(3)
|
|
|
- .find(".temp")
|
|
|
- .find("span")
|
|
|
- .eq(1)
|
|
|
- .html(humidity + "℃");
|
|
|
- },
|
|
|
- timeout: 6000,
|
|
|
- error: function () {
|
|
|
- console.log("档案室库房超时了");
|
|
|
- },
|
|
|
- });
|
|
|
+ function roomAjax4 () {
|
|
|
+ $.ajax({
|
|
|
+ /** url,data参数,
|
|
|
+ * type请求类型,响应体结果,超时时间
|
|
|
+ * 成功的回调,失败回调 */
|
|
|
+ url: DH + "queryData/queryDeviceParam",
|
|
|
+ data: {
|
|
|
+ urlCode: "DH_002",
|
|
|
+ },
|
|
|
+ type: "GET",
|
|
|
+ dataType: "JSON",
|
|
|
+ success: function ({ data }) {
|
|
|
+ console.log("档案室库房", data);
|
|
|
+ // 温度
|
|
|
+ let temperature = data
|
|
|
+ .filter((item) => {
|
|
|
+ if (item.sname === "环境温度") {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .reduce((cur, item) => {
|
|
|
+ return cur + parseFloat(item.value);
|
|
|
+ }, 0);
|
|
|
+ // 湿度
|
|
|
+ let humidity = data
|
|
|
+ .filter((item) => {
|
|
|
+ if (item.sname === "环境湿度") {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .reduce((cur, item) => {
|
|
|
+ return cur + parseFloat(item.value);
|
|
|
+ }, 0);
|
|
|
+ $(".test50 .box50 .item")
|
|
|
+ .eq(3)
|
|
|
+ .find(".temp")
|
|
|
+ .find("span")
|
|
|
+ .eq(0)
|
|
|
+ .html(temperature + "℃");
|
|
|
+ $(".test50 .box50 .item")
|
|
|
+ .eq(3)
|
|
|
+ .find(".temp")
|
|
|
+ .find("span")
|
|
|
+ .eq(1)
|
|
|
+ .html(humidity + "℃");
|
|
|
+ },
|
|
|
+ timeout: 6000,
|
|
|
+ error: function () {
|
|
|
+ console.log("档案室库房超时了");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function roomAjaxInit () {
|
|
|
+ roomAjax1()
|
|
|
+ roomAjax2()
|
|
|
+ roomAjax3()
|
|
|
+ roomAjax4()
|
|
|
+ }
|
|
|
+
|
|
|
+ roomAjaxInit();
|
|
|
+ setInterval(roomAjaxInit, 60 * 1000);
|
|
|
|
|
|
$(".test50 .box50 .item").click(function () {
|
|
|
const typeId = $(this).attr("data-id");
|
|
@@ -223,7 +243,7 @@ const test50 = (function () {
|
|
|
}
|
|
|
|
|
|
// 二号楼中心机房
|
|
|
- function eighthFloor() {
|
|
|
+ function eighthFloor () {
|
|
|
$.ajax({
|
|
|
url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
data: {
|
|
@@ -287,7 +307,7 @@ const test50 = (function () {
|
|
|
}
|
|
|
|
|
|
// 网络核心机房
|
|
|
- function fourthFloor() {
|
|
|
+ function fourthFloor () {
|
|
|
$.ajax({
|
|
|
url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
data: {
|
|
@@ -379,7 +399,7 @@ const test50 = (function () {
|
|
|
}
|
|
|
|
|
|
// 配线间机房
|
|
|
- function ninthFloor() {
|
|
|
+ function ninthFloor () {
|
|
|
$.ajax({
|
|
|
url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
data: {
|
|
@@ -442,7 +462,7 @@ const test50 = (function () {
|
|
|
}
|
|
|
|
|
|
// 档案室库房
|
|
|
- function dasRoom() {
|
|
|
+ function dasRoom () {
|
|
|
$.ajax({
|
|
|
/** url,data参数,
|
|
|
* type请求类型,响应体结果,超时时间
|
|
@@ -513,7 +533,7 @@ const test50 = (function () {
|
|
|
}
|
|
|
|
|
|
// UPS供电机房
|
|
|
- function upsOf() {
|
|
|
+ function upsOf () {
|
|
|
$.ajax({
|
|
|
url: ROOM + "/api/devicesignaltable/listByName",
|
|
|
data: {
|
|
@@ -528,7 +548,7 @@ const test50 = (function () {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- function setValue(
|
|
|
+ function setValue (
|
|
|
temperature,
|
|
|
humidity,
|
|
|
water,
|