Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/visual/modules/userInfo_line.jsp
2026-01-16 14:13:44 +08:00

311 lines
11 KiB
Plaintext

<%@ 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_GetHistory", JspElement.Type_GetHistory); %>
<%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>
<style>
.blueSpanLargeFont {
color: #437099;
font-family: Microsoft YaHei;
}
.blueSpanMediumFont {
color: #74D5FF;
font-family: Microsoft YaHei;
}
.blueSpanSmallFont {
color: #437099;
font-family: Microsoft YaHei;
}
.blueSpanSmallFont {
color: #437099;
font-family: Microsoft YaHei;
}
.whiteSpanLargeFont {
color: white;
font-family: Microsoft YaHei;
}
.whiteSpanMediumFont {
color: white;
font-family: Microsoft YaHei;
}
.whiteSpanSmallFont {
color: white;
font-family: Microsoft YaHei;
}
.deepBlueSpanLargeFont {
color: #4069B2;
font-family: Microsoft YaHei;
font-weight: bold
}
.lightBlueSpanSmallFont {
color: #74D5FF;
font-family: Microsoft YaHei;
}
.UserPanel {
background: #182F52;
border-radius: 20px;
border: 4px solid #426AB2;
}
.userNumTable {
width: 100%;
height: 80%;
padding-left: 5%;
padding-right: 5%;
padding-top: 2%;
border-collapse: separate;
border-spacing: 0px 6px;
text-align: left;
}
</style>
<script type="text/javascript">
var timeflash = 0;
function clock() {
var time = new Date();
var week;
switch (time.getDay()) {
case 1: week = "星期一"; break;
case 2: week = "星期二"; break;
case 3: week = "星期三"; break;
case 4: week = "星期四"; break;
case 5: week = "星期五"; break;
case 6: week = "星期六"; break;
default: week = "星期日";
}
var year = time.getFullYear();
var month = time.getMonth()+1;
var date = time.getDate();
var hour = time.getHours();
var minute = time.getMinutes();
if (minute < 10) {
minute = "0" + minute;
}
if (month < 10) {
month = "0" + month;
}
var apm = "上午";
if (hour < 6 && hour >= 0) {
apm = "凌晨";
} else if (hour == 12) {
apm = "中午";
} else if (hour > 12 && hour < 18) {
apm = "下午";
} else if (hour >= 18 && hour < 24) {
apm = "晚上";
}
var maohao = "";
if (timeflash == 0) {
maohao = "<font color='#4972B4'>:</font>";
timeflash = 1;
} else {
maohao = "<font color='#1A2D58'>:</font>";
timeflash = 0;
}
if(document.getElementById("clock")){
document.getElementById("clock").innerHTML = hour + maohao + minute;
}
if(document.getElementById("apm")){
document.getElementById("apm").innerHTML = apm;
}
if(document.getElementById("date")){
document.getElementById("date").innerHTML = year + "." + month + "." + date;
}
if(document.getElementById("week")){
document.getElementById("week").innerHTML = week;
}
if(document.getElementById("lunar")){
document.getElementById("lunar").innerHTML = showCal();
}
}
function getValue() {
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
//每一条循环判断
for (var i = 0; i < data.length; i++) {
//获取值 和 获取Modbus
if (data[i].getValueType == '${Type_GetValue}' || data[i].getValueType == '${Type_GetModbus}') {
if (data[i].elementCode.indexOf("Status") != -1) {//获取车间状态关键字
var code = data[i].elementCode;
if (document.getElementById(code) && data[i].mPoint.parmvalue) {//判断存不存在
//赋值
var src = "";
if(data[i].mPoint.parmvalue == '生产中'){
src = "../../../IMG/material/生产中.jpg"
}else if(data[i].mPoint.parmvalue == '停产'){
src = "../../../IMG/material/停产.jpg"
}else if(data[i].mPoint.parmvalue == '未清场'){
src = "../../../IMG/material/未清场.jpg"
}else if(data[i].mPoint.parmvalue == '已清场'){
src = "../../../IMG/material/已清场.jpg"
}
document.getElementById(code).src = src;
document.getElementById(code).style.width = document.body.offsetWidth * 0.1 + "px";
document.getElementById(code).style.height = document.body.offsetHeight * 0.13 + "px";
}
}else{
var code = data[i].elementCode;
document.getElementById(code).innerHTML = data[i].mPoint.parmvalue;
}
} else if (data[i].getValueType == '${Type_GetHistory}') {
} else if (data[i].getValueType == '${Type_GetHttp}') {
var code = data[i].elementCode;
document.getElementById(code).innerHTML = data[i].value;
} else {
}
}
}, 'json');
}
/* 定时器 */
setInterval(getValue, 300000); //<!--每隔5分钟刷新一次-->
setInterval(clock, 1000); //每隔1秒显示一次
/* 初始化 */
$(function () {
getValue();
clock();
//console.log("height",document.body.scrollHeight);
document.body.style.backgroundColor = "#" + '${param.backgroundColor}';
$("#clock").css("font-size", (document.documentElement.clientWidth * 0.08 + "px"));
// $("#lunar").css("font-size", (document.documentElement.clientWidth * 0.03 + "px"));
$("#date").css("font-size", (document.documentElement.clientWidth * 0.03 + "px"));
$("#week").css("font-size", (document.documentElement.clientWidth * 0.03 + "px"));
$(".blueSpanLargeFont").css("font-size", (document.body.offsetWidth * 0.06 + "px"));
$(".blueSpanMediumFont").css("font-size", (document.body.offsetWidth * 0.045 + "px"));
$(".blueSpanSmallFont").css("font-size", (document.body.offsetWidth * 0.03 + "px"));
$(".whiteSpanSmallFont").css("font-size", (document.body.offsetWidth * 0.0469 + "px"));
$(".deepBlueSpanLargeFont").css("font-size", (document.body.offsetWidth * 0.05 + "px"));
$(".lightBlueSpanSmallFont").css("font-size", (document.body.offsetWidth * 0.034 + "px"));
document.getElementById('userImg').style.width = document.body.offsetWidth * 0.15 + "px";
document.getElementById('userImg').style.height = document.body.offsetHeight * 0.4 + "px";
});
</script>
</head>
<body style="width:100%;height:100%;margin:0;padding:0;overflow-x:hidden;overflow-y:hidden">
<div class="container" style="width:100%;height:100%;margin:0;padding:0px;">
<div style="width:50%;height:100%;float:left">
<table
style="width:100%;height:90%;padding-left:5%;padding-right:5%;padding-top:2%;border-collapse:separate;border-spacing:0px 6px;text-align:center">
<tr>
<td rowspan="2">
<span id="clock" style="color:#4972B4;font-family:Microsoft YaHei;font-weight: bold;"></span>
</td>
<td>
<img id="userImg" src="<%=request.getContextPath()%>/IMG/material/users.png" />
</td>
</tr>
<tr>
<td>
<div class="blueSpanSmallFont">当前区域人数</div>
</td>
</tr>
<tr>
<td>
<span id="week" style="color:#4972B4;font-family:Microsoft YaHei;font-weight:bold"></span>
&nbsp;&nbsp;&nbsp;
<span id="date" style="color:#4972B4;font-family:Microsoft YaHei;font-weight:bold"></span>
</td>
<td>
<span id="actTotalUserNum" class="whiteSpanSmallFont"></span>
<span class="blueSpanMediumFont" style="color:#4972B4;">/</span>
<span id="totalUserNum" class="blueSpanMediumFont" style="color:#4972B4;"></span>
<span style="font-size:25px;color:#4972B4;font-family:Microsoft YaHei;font-weight:bold">人</span>
</td>
</tr>
</table>
</div>
<div style="width:50%;height:100%;float:left">
<table
style="width:100%;height:100%;border-collapse:separate;border-spacing:0px 6px;text-align:left;padding-left:5%;padding-right:5%;padding-top:5%;text-align: left;">
<tr>
<td>
<span id="area1" class="blueSpanSmallFont" style="font-weight: bold;"></span>
</td>
<td>
<img id="area1Status" src="" style="width:100%" alt="" />
</td>
<td align="right">
<span id="area1ActUserNum" class="lightBlueSpanSmallFont" style="font-weight: bold;"></span>
<span class="blueSpanSmallFont" style="font-weight: bold;">/</span>
<span id="area1TotalUserNum" class="blueSpanSmallFont" style="font-weight: bold;"></span>
</td>
</tr>
<tr>
<td>
<span id="area2" class="blueSpanSmallFont" style="font-weight: bold;"></span>
</td>
<td>
<img id="area2Status" src="" alt="" />
</td>
<td align="right">
<span id="area2ActUserNum" class="lightBlueSpanSmallFont" style="font-weight: bold;"></span>
<span class="blueSpanSmallFont" style="font-weight: bold;">/</span>
<span id="area2TotalUserNum" class="blueSpanSmallFont" style="font-weight: bold;"></span>
</td>
</tr>
<tr>
<td>
<span id="area3" class="blueSpanSmallFont" style="font-weight: bold;"></span>
</td>
<td>
<img id="area3Status" src="" alt="" />
</td>
<td align="right">
<span id="area3ActUserNum" class="lightBlueSpanSmallFont" style="font-weight: bold;"></span>
<span class="blueSpanSmallFont" style="font-weight: bold;">/</span>
<span id="area3TotalUserNum" class="blueSpanSmallFont" style="font-weight: bold;"></span>
</td>
</tr>
<tr>
<td>
<span id="area4" class="blueSpanSmallFont" style="font-weight: bold;"></span>
</td>
<td>
<img id="area4Status" src="" alt="" />
</td>
<td align="right">
<span id="area4ActUserNum" class="lightBlueSpanSmallFont" style="font-weight: bold;"></span>
<span class="blueSpanSmallFont" style="font-weight: bold;">/</span>
<span id="area4TotalUserNum" class="blueSpanSmallFont" style="font-weight: bold;"></span>
</td>
</tr>
</table>
</div>
</body>
</html>