Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/visual/modules/bigScreen_throughput.jsp

130 lines
6.4 KiB
Plaintext
Raw Permalink Normal View History

2026-01-16 14:13:44 +08:00
<%@ 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"%>
<%@page import="com.sipai.entity.visual.JspElement"%>
<%request.setAttribute("Type_GetValue", JspElement.Type_GetValue); %>
<%request.setAttribute("Type_GetHourHistory", JspElement.Type_GetHourHistory); %>
<%request.setAttribute("Type_Get7dayHistory", JspElement.Type_Get7dayHistory); %>
<%request.setAttribute("Type_GetModbus", JspElement.Type_GetModbus); %>
<%request.setAttribute("Type_GetHttp", JspElement.Type_GetHttp); %>
<!DOCTYPE html>
<!-- <html lang="zh-CN"> -->
<!-- BEGIN HEAD -->
<head>
<title></title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
//获取url地址根目录 当前taomcat下路径
function getRootPath(){
var pathName = window.location.pathname.substring(1);
// var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));
return window.location.protocol + '//' + window.location.host;
}
function fomatFloat(src,pos){
return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos);
}
/* 请求数据 */
function getValue() {
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
if(data!=null&&data.length>0){
var barNum=0;
var v1=0;//目标值
var v2=0;//实际值
for(var i=0;i<data.length;i++){
if(data[i].elementCode=="bar"){
if(barNum==0){
v1=data[i].mPoint.parmvalue;
}else if(barNum==1){
v2=data[i].mPoint.parmvalue;
}
barNum++;
}
}
// v1=fomatFloat(v1/10000, 1);
// v2=fomatFloat(v2/10000, 1);
var dcl=Math.round(v2/v1*100);
if(dcl>100){
dcl=100;
}
var undcl=100-dcl;
var barHtml="";
barHtml+="<div style='float:left;width:100%;height:100%;'>";
barHtml+="<div style='float:left;width:100%;height:100%;padding-top:20px;padding-bottom:20px;padding-left:15px;padding-right:15px;'>";
barHtml+="<div style='float:left;width:100%;height:100%;background: #737683;border-radius: 20px 20px 3px 3px;box-shadow: 0px 8px 18px 0px rgba(23,25,29,0.05) inset;'>";
barHtml+="<div style='float:left;width:100%;height:"+undcl+"%;'></div>";
barHtml+="<div style='float:left;width:100%;height:"+dcl+"%;background: #3DC6C9;border-radius: 20px 20px 3px 3px;box-shadow: 0px 8px 18px 0px rgba(23,25,29,0.05) inset;'>";
barHtml+="<div style='float:left;width:100%;height:100%;text-align: center;color: #ffffff;font-family: Helvetica, Helvetica-Bold;font-size: 24px;'>"+dcl+"%</div>";
barHtml+="</div>";
barHtml+="</div>";
barHtml+="</div>";
barHtml+="</div>";
$('#chart').html(barHtml);
// var textnum=data.length-linenum;
var textHtml="";
// var ctextnum=0;
for(var m=0;m<data.length;m++){
if(data[m].elementCode=="text"){
textHtml+="<div style='float:left;width:50%;height: calc((100vh - 60px - 15px)/2);'>";
textHtml+="<div style='float:left;width:100%;height: calc((100vh - 60px - 15px)/2/2);line-height: calc((100vh - 60px - 15px)/2/2);font-size: 26px;font-family: Helvetica;text-align: center;color: #ffffff;'>"+data[m].name+"</div>";
textHtml+="<div style='float:left;width:100%;height: calc((100vh - 60px - 15px)/2/2);line-height: calc((100vh - 60px - 15px)/2/2);font-family: Helvetica;text-align: center;color: #69F6F9;'>";
textHtml+="<div style='float:left;width:60%;height: calc((100vh - 60px - 15px)/2/2);line-height: calc((100vh - 60px - 15px)/2/2);font-size: 30px;text-align: right;'>"+(data[m].mPoint.parmvalue/10000).toFixed(1)+"</div>";
textHtml+="<div style='float:left;width:40%;height: calc((100vh - 50px)/2/2);line-height: calc((100vh - 60px - 15px)/2/2);font-size: 18px;text-align: left;padding-left:15px;'>万吨</div>";
textHtml+="</div>";
textHtml+="</div>";
// ctextnum++;
}
}
$('#text').html(textHtml);
}
}, 'json');
}
/* 定时器 */
//setInterval(change, 60000); //每1分钟切换
setInterval(getValue, 3600000); //每一小时切换
/* 初始化 */
$(function () {
if('${param.backgroundColor}'=='transparent'){
document.body.style.backgroundColor = '${param.backgroundColor}';
}else{
document.body.style.backgroundColor = "#" + '${param.backgroundColor}';
}
document.getElementById("main").style.width = document.documentElement.clientWidth + "px";
document.getElementById("main").style.height = (document.documentElement.clientHeight-15) + "px";
document.getElementById("backImage").src = ""+getRootPath()+"/images/大屏/处理量.png";
getValue();
//console.log("height",document.body.scrollHeight);
});
</script>
</head>
<body style="width:100%;height:100%;margin:0;padding:0;overflow-x:hidden;overflow-y:hidden;padding-top:15px;">
<div style="height:100%;width:100%;">
<div id="main" style="height:100%;width:100%;background:rgba(19,32,85,0.27);border-radius: 8px;">
<div style='float:left;width:50%;height:60px;'><img id="backImage" src="" style="z-index:-1;position:relative;height:100%;width:100%;"/></div>
<div style='float:left;width:50%;height:60px;'></div>
<div id="chart" style="float:left;width:20%;height: calc(100vh - 60px - 15px);"></div>
<div id="text" style="float:left;width:80%;height: calc(100vh - 60px - 15px);padding-right: 15px;"></div>
</div>
</div>
</body>
</html>