207 lines
8.4 KiB
Plaintext
207 lines
8.4 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/incVisual.jsp"></jsp:include>
|
|
<style>
|
|
.titleDiv {
|
|
border-radius: 30px;
|
|
border: 3px solid #fff;
|
|
background-color: #1BB3DC;
|
|
}
|
|
|
|
.q11Line {
|
|
display: inline-block;
|
|
background-color: #5AD8FF;
|
|
-webkit-mask: url(../../../IMG/material/Q11Line.svg) no-repeat;
|
|
mask: url(../../../IMG/material/Q11Line.svg) no-repeat;
|
|
-webkit-mask-size: 100% 100%;
|
|
mask-size: 100% 100%;
|
|
}
|
|
|
|
.q12Line {
|
|
display: inline-block;
|
|
background-color: #FFDF58;
|
|
-webkit-mask: url(../../../IMG/material/Q12Line.svg) no-repeat;
|
|
mask: url(../../../IMG/material/Q12Line.svg) no-repeat;
|
|
-webkit-mask-size: 100% 100%;
|
|
mask-size: 100% 100%;
|
|
}
|
|
</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) {
|
|
//每一条循环判断
|
|
//console.log("data", data);
|
|
for (var i = 0; i < data.length; i++) {
|
|
if (data[i].elementCode == 'background') {
|
|
if (data[i].style != null && data[i].style != "") {
|
|
document.getElementById("backImage").src = "../../.." + data[i].style;
|
|
}
|
|
} else if (data[i].elementCode.indexOf("title") != -1) {//获取车间名
|
|
var code = data[i].elementCode;
|
|
if (document.getElementById(code)) {//判断存不存在
|
|
//赋值
|
|
document.getElementById(code).innerHTML = data[i].name;
|
|
}
|
|
} else {
|
|
//获取值 和 获取Modbus
|
|
if (data[i].getValueType == '${Type_GetValue}' || data[i].getValueType == '${Type_GetModbus}') {
|
|
if (data[i].elementCode == 'Q11') {
|
|
if (data[i].mPoint.parmvalue != '1') {
|
|
document.getElementById("q11Line").style.backgroundColor = "#7285A0";
|
|
}
|
|
} else if (data[i].elementCode == 'Q12') {
|
|
if (data[i].mPoint.parmvalue != '1') {
|
|
document.getElementById("q12Line").style.backgroundColor = "#7285A0";
|
|
}
|
|
}
|
|
} else if (data[i].getValueType == '${Type_GetHttp}') {
|
|
var code = data[i].elementCode;
|
|
if(document.getElementById(code)){
|
|
document.getElementById(code).innerHTML = data[i].value;
|
|
}
|
|
} else {
|
|
|
|
}
|
|
}
|
|
}
|
|
}, 'json');
|
|
}
|
|
/* 定时器 */
|
|
setInterval(getValue, 300000); //<!--每隔5分钟刷新一次-->
|
|
setInterval(clock, 1000); //每隔1秒显示一次
|
|
|
|
$(function () {
|
|
clock();
|
|
getValue();
|
|
|
|
document.body.style.backgroundColor = "#" + '${param.backgroundColor}';
|
|
$("#clock").css("font-size", (document.documentElement.clientWidth * 0.02 + "px"));
|
|
// $("#lunar").css("font-size", (document.documentElement.clientWidth * 0.03 + "px"));
|
|
$("#date").css("font-size", (document.documentElement.clientWidth * 0.02 + "px"));
|
|
$("#week").css("font-size", (document.documentElement.clientWidth * 0.02 + "px"));
|
|
$("#title1").css("font-size", (document.documentElement.clientWidth * 0.013 + "px"));
|
|
document.getElementById("titleDiv").style.width = document.documentElement.clientWidth * 0.18 + "px";
|
|
document.getElementById("titleDiv").style.height = document.documentElement.clientHeight * 0.049 + "px";
|
|
document.getElementById("titleDiv").style.borderWidth = document.documentElement.clientHeight * 0.003 + "px";
|
|
|
|
document.getElementById("backImage").style.width = document.documentElement.clientWidth + "px";
|
|
document.getElementById("backImage").style.height = document.documentElement.clientHeight + "px";
|
|
document.getElementById("q11Line").style.width = document.documentElement.clientWidth + "px";
|
|
document.getElementById("q11Line").style.height = document.documentElement.clientHeight + "px";
|
|
document.getElementById("q12Line").style.width = document.documentElement.clientWidth + "px";
|
|
document.getElementById("q12Line").style.height = document.documentElement.clientHeight + "px";
|
|
document.getElementById("floatDiv").style.width = document.documentElement.clientWidth + "px";
|
|
document.getElementById("floatDiv").style.height = document.documentElement.clientHeight + "px";
|
|
});
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body style="width:100%;height:100%;margin:0;padding:0;">
|
|
<div id="floatDiv" style="position: absolute;z-index:1;">
|
|
<!-- 时间 -->
|
|
<div style="width:96%;height:10%;padding-top:0.5%;padding-left:2%;position: absolute;z-index:2;text-align: center;">
|
|
<table style="width:100%;height:100%;padding:5%;">
|
|
<tr>
|
|
<td width="69%">
|
|
<div id="titleDiv" class="titleDiv" style="height:60px;text-align: center;">
|
|
<span id="title1" style="font-size:30px;color:#fff;"></span>
|
|
</div>
|
|
</td>
|
|
<td><span id="date" style="font-size:25px;color:#4972B4;font-family:Microsoft YaHei;font-weight:bold"></span>
|
|
</td>
|
|
<td><span id="week" style="font-size:25px;color:#4972B4;font-family:Microsoft YaHei;font-weight:bold"></span>
|
|
</td>
|
|
<!-- <td><span id="lunar" style="font-size:25px;color:#4972B4;font-family:Microsoft YaHei;font-weight: bold;"></span></td> -->
|
|
<td><span id="clock"
|
|
style="font-size:70px;color:#4972B4;font-family:Microsoft YaHei;font-weight: bold;"></span></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<i id="q11Line" class="q11Line" style="position: absolute;z-index:2;"></i>
|
|
<i id="q12Line" class="q12Line" style="position: absolute;z-index:2;"></i>
|
|
|
|
</div>
|
|
|
|
<img id="backImage" src="" style="z-index:-1;positon:relative;" alt="" />
|
|
|
|
</body>
|
|
|
|
</html> |