管道展示

This commit is contained in:
Rue Ji
2026-03-10 21:51:19 +08:00
parent 2a8318599a
commit 1798d7c841
5 changed files with 24223 additions and 3900 deletions

View File

@ -1,5 +1,14 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%--<%@ page language="java" contentType="text/html; charset=UTF-8"--%>
<%--pageEncoding="UTF-8"%>--%>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import="com.sipai.entity.base.ServerObject" %>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
<!doctype html>
<html>
<head>
@ -296,6 +305,84 @@ pageEncoding="UTF-8"%>
top: 1417px;
left: 2481px;
}
.Middle4_val {
position: absolute;
left: 5134px;
width: 100px;
height: 31px;
color: rgba(41, 241, 250, 1);
font-weight: 500;
font-size: 26px;
display: flex;
justify-content: flex-end;
/*background: #0AFA02;*/
}
#D_JSLL {
top: 291px;
}
#D_JinSPH {
top: 342px;
}
#D_JinSCOD {
top: 393px;
}
#D_JinSAL {
top: 444px;
}
#D_JinSWD {
top: 497px;
left: 5164px;
}
#D_JinSLJLL {
top: 549px;
left: 5155px;
}
#D_ChuSLL {
top: 760px;
}
#D_ChuSPH {
top: 812px;
}
#D_ChuSCOD {
top: 867px;
}
#D_ChuSAL {
top: 919px;
}
#D_ChuSWD {
top: 968px;
left: 5164px;
}
#D_ChuSZL {
top: 1021px;
left: 5164px;
}
#D_ChuSZLv {
top: 1072px;
left: 5164px;
}
#D_ChuSLJLL {
top: 1124px;
left: 5155px;
}
#D_FanXBCKLL {
top: 1239px;
}
#D_FanXBCKYL {
top: 1292px;
left: 5144px;
}
#D_ShengYWNCKLL {
top: 1344px;
}
#D_QingSCYW {
top: 1464px;
left: 5167px;
}
#D_FeiYCYW {
top: 1516px;
left: 5167px;
}
</style>
</head>
<body>
@ -465,14 +552,38 @@ pageEncoding="UTF-8"%>
<div class="Middle4">
<!-- 进水 -->
<div></div>
<div>
<div class="Middle4_val" id="D_JSLL">100</div>
<div class="Middle4_val" id="D_JinSPH">100</div>
<div class="Middle4_val" id="D_JinSCOD">100</div>
<div class="Middle4_val" id="D_JinSAL">100</div>
<div class="Middle4_val" id="D_JinSWD">100</div>
<div class="Middle4_val" id="D_JinSLJLL">100</div>
</div>
<!-- 出水 -->
<div></div>
<div>
<div class="Middle4_val" id="D_ChuSLL">100</div>
<div class="Middle4_val" id="D_ChuSPH">100</div>
<div class="Middle4_val" id="D_ChuSCOD">100</div>
<div class="Middle4_val" id="D_ChuSAL">100</div>
<div class="Middle4_val" id="D_ChuSWD">100</div>
<div class="Middle4_val" id="D_ChuSZL">100</div>
<div class="Middle4_val" id="D_ChuSZLv">100</div>
<div class="Middle4_val" id="D_ChuSLJLL">100</div>
<div></div>
</div>
<div></div>
<div>
<div class="Middle4_val" id="D_FanXBCKLL">200</div>
<div class="Middle4_val" id="D_FanXBCKYL">200</div>
<div class="Middle4_val" id="D_ShengYWNCKLL">200</div>
</div>
<div>
<div class="Middle4_val" id="D_QingSCYW">200</div>
<div class="Middle4_val" id="D_FeiYCYW">200</div>
</div>
</div>
</div>
@ -779,6 +890,69 @@ pageEncoding="UTF-8"%>
});
}
// 质量指标表格点位编码映射
var qualityMPointMapping = {
"COD (mg/L)": { mPointKey: "D_ChuSCOD", standard: "0.00020.000" },
"TP (mg/L)": { mPointKey: "D_ChuSTP", standard: "0.0000.500" },
"NH3N (mg/L)": { mPointKey: "D_ChuSNH3N", standard: "0.0005.000" },
"TN (mg/L)": { mPointKey: "D_ChuSTN", standard: "0.00015.000" },
"PH (mg/L)": { mPointKey: "D_ChuSPH", standard: "6.0009.000" },
"SS": { mPointKey: "D_ChuSSS", standard: "0.00010.000" },
"温度(℃)": { mPointKey: "D_ChuSWD", standard: "0.00040.000" },
};
// 获取质量指标表格数据
function fetchQualityTableData() {
var companyKey = "0533JS";
var params = Object.keys(qualityMPointMapping);
var completedRequests = 0;
var totalRequests = params.length;
params.forEach(function (paramName) {
var mPointKey = qualityMPointMapping[paramName].mPointKey;
var standard = qualityMPointMapping[paramName].standard;
$.ajax({
url: "<%=request.getContextPath()%>/mpoint/data/getStatistics.do",
type: "GET",
data: {
mPointKey: mPointKey,
companyKey: companyKey
},
dataType: "json",
success: function (response) {
console.log("质量指标数据[" + mPointKey + "]:", response);
if (response) {
// 更新pageData.qualityTable中对应的数据
for (var i = 0; i < pageData.qualityTable.length; i++) {
if (pageData.qualityTable[i].param === paramName) {
pageData.qualityTable[i].current = response.currentValue || 0;
pageData.qualityTable[i].avg = response.avgValue || 0;
pageData.qualityTable[i].max = response.maxValue || 0;
pageData.qualityTable[i].min = response.minValue || 0;
pageData.qualityTable[i].standard = standard;
break;
}
}
}
completedRequests++;
// 所有请求完成后更新表格
if (completedRequests === totalRequests) {
updateQualityTable();
}
},
error: function (xhr, status, error) {
console.error("获取质量指标数据失败:", mPointKey, error);
completedRequests++;
// 即使失败也检查是否所有请求已完成
if (completedRequests === totalRequests) {
updateQualityTable();
}
}
});
});
}
// 获取点位信息数据
// mpcode: 点位编码
// sdt: 开始时间 (可选默认7天前)
@ -818,43 +992,6 @@ pageEncoding="UTF-8"%>
});
}
/**
* 获取点位实时值
* @param unitId
* @param mpointCode
* @param valueId
* @param textId
*/
function getValue(unitId, mpointCode, valueId, textId) {
$.ajax({
type: "GET",
url: "<%=request.getContextPath()%>/work/mpoint/getValue4Es.do?unitId=" + unitId + "&mpointCode=" + mpointCode,
async: true,
globle: false,
error: function (res) {
console.log("获取数据失败:", res);
return false;
},
success: function (data) {
if (data != null && data != "") {
var data = eval("(" + data + ")");
//只限制上限为0.8 下限根据设定值自己设
// var maxvalue = data.alarmmax/0.8;
// var minvalue = data.alarmmin/maxvalue;
// var acvalue = data.parmvalue/maxvalue*100;
// var data = {"processsectioncode":"28","parmname":"电动碟阀11_关到位","id":"D_PACDSYH","numtail":"0","signaltype":"AI","active":"启用","sourceType":"auto","mpointcode":"D_PACDSYH","disname":"电动碟阀11_关到位","valuetype":"sql","directtype":"1","rate":1.0000000000,"subscriptionStatus":0,"mpointid":"D_PACDSYH","triggeralarm":"1","parmvalue":106,"measuredt":"2026-02-26T05:55:14Z","bizid":"0533JS"}
console.log('===data', data)
$("#" + valueId).html(data.parmvalue || 9999); //赋值
if (data.unit == undefined) {
$("#" + textId).html(data.parmname || 9999); //赋值名称
} else {
$("#" + textId).html(data.parmname + " (" + data.unit + ")" + 9999); //赋值名称+单位
}
}
},
});
}
// 格式化日期为 YYYY-MM-DD 格式
function formatDate(date) {
var year = date.getFullYear();
@ -878,11 +1015,25 @@ pageEncoding="UTF-8"%>
// 页面加载后获取水量统计数据
fetchSlqsData();
// 批量获取点位数据并更新显示
// 获取质量指标表格数据
fetchQualityTableData();
<%--// 定时刷新所有数据(每分钟刷新一次)--%>
<%--setInterval(function() {--%>
<%-- console.log('定时刷新数据...');--%>
<%-- fetchSlqsData();--%>
<%-- fetchQualityTableData();--%>
<%-- // 批量刷新点位数据--%>
<%-- pointList.forEach(function (mpcode) {--%>
<%-- getValue('0533JS', mpcode, mpcode, `${mpcode}_name`, '<%=request.getContextPath()%>');--%>
<%-- });--%>
<%--}, 60000); // 60000毫秒 = 1分钟--%>
<%--// 批量获取点位数据并更新显示--%>
var pointList = [
"D_PACDSYH",
"D_YiSNDSYH",
"D_CiLSNDSYH",
"D_PACDSYH", // PAC吨水药耗
"D_YiSNDSYH", // 乙酸钠吨水药耗
"D_CiLSNDSYH", // 次氯酸钠吨水药耗
"D_YanYCORP",
"D_QueYCRJY1",
"D_HaoYCRJY",
@ -900,6 +1051,25 @@ pageEncoding="UTF-8"%>
"D_PACJYLL",
"D_CiLSNCGYW",
"D_PACCGYW",
"D_JSLL",
"D_JinSPH",
"D_JinSCOD",
"D_JinSAL",
"D_JinSWD",
"D_JinSLJLL",
"D_ChuSLL",
"D_ChuSPH",
"D_ChuSCOD",
"D_ChuSAL",
"D_ChuSWD",
"D_ChuSZL",
"D_ChuSZLv",
"D_ChuSLJLL",
"D_FanXBCKLL",
"D_FanXBCKYL",
"D_ShengYWNCKLL",
"D_QingSCYW",
"D_FeiYCYW",
];
pointList.forEach(function (mpcode) {
@ -913,7 +1083,7 @@ pageEncoding="UTF-8"%>
// }).catch(function(error) {
// console.error('点位数据获取失败:', mpcode, error);
// });
getValue('0533JS', mpcode, mpcode, `${mpcode}_name`);
getValue('0533JS', mpcode, mpcode, `${mpcode}_name`, '<%=request.getContextPath()%>');
});
});