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

394 lines
18 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ 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_Get7dayHistory", 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">
/* 请求数据 */
var series1=[];
var series2=[];
function getValue() {
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
// console.log(data);
if(data!=''){
var nowpowerdayP=0;
var lastpowerdayP=0;
var nowdrugdayP=0;
var lastdrugdayP=0;
var nowWaterPowerday=0;
var lastWaterPowerday=0;
for(var i=0;i<data.length;i++){
if(data[i].elementCode=="powerLine"){
if(data[i].getValueType!="getText"){
var datas=new Array();
for(var j=0;j<data[i].mPointHistory.length;j++){
const his=data[i].mPointHistory[j];
var ddata=new Array();
ddata.push(his.measuredt.substring(0,10));
ddata.push(his.parmvalue);
datas.push(ddata);
}
series1.push({
data: datas,
name: data[i].name,
type: 'line',
symbol:'none',
smooth: true
});
}else if(data[i].getValueType=="getText"){
if(series1!=''&&series1.length>0){
var datas=new Array();
for (let j = 0; j < series1[0].data.length; j++) {
const element = series1[0].data[j];
var ddata=new Array();
ddata.push(element[0]);
ddata.push(data[i].valueUrl);
datas.push(ddata);
}
series1.push({
data: datas,
name: data[i].name,
type: 'line',
symbol:'none',
smooth: true,
itemStyle:{
normal:{
lineStyle:{
type:'dotted'  //'dotted'虚线 'solid'实线
}
}
}
});
}
}
}else if(data[i].elementCode=="drugLine"){
if(data[i].getValueType!="getText"){
var datas=new Array();
for(var j=0;j<data[i].mPointHistory.length;j++){
const his=data[i].mPointHistory[j];
var ddata=new Array();
ddata.push(his.measuredt.substring(0,10));
ddata.push(his.parmvalue);
datas.push(ddata);
}
series2.push({
data: datas,
name: data[i].name,
type: 'line',
symbol:'none',
smooth: true
});
}else if(data[i].getValueType=="getText"){
if(series2!=''&&series2.length>0){
var datas=new Array();
for (let j = 0; j < series2[0].data.length; j++) {
const element = series2[0].data[j];
var ddata=new Array();
ddata.push(element[0]);
ddata.push(data[i].valueUrl);
datas.push(ddata);
}
series2.push({
data: datas,
name: data[i].name,
type: 'line',
symbol:'none',
smooth: true,
itemStyle:{
normal:{
lineStyle:{
type:'dotted'  //'dotted'虚线 'solid'实线
}
}
}
});
}
}
}else if(data[i].elementCode=="power"){
nowpowerdayP = data[i].mPoint.parmvalue;
// if(data[i].getValueType=="getTodaySumValue"){
// if(data[i].mPointHistory.length>0){
// nowpowerdayP=data[i].mPointHistory[0].parmvalue;
// }
//
// }else if(data[i].getValueType=="getYesterdaySumValue"){
// if(data[i].mPointHistory.length>0){
// lastpowerdayP=data[i].mPointHistory[0].parmvalue;
// }
// }
}else if(data[i].elementCode=="drug"){
nowdrugdayP = data[i].mPoint.parmvalue;
// if(data[i].getValueType=="getTodayFirstValue"){
// if(data[i].mPointHistory.length>0){
// nowdrugdayP=data[i].mPointHistory[0].parmvalue;
// }
//
// }else if(data[i].getValueType=="getYesterdayFirstValue"){
// if(data[i].mPointHistory.length>0){
// lastdrugdayP=data[i].mPointHistory[0].parmvalue;
// }
// }
}else if(data[i].elementCode=="waterPower"){
nowWaterPowerday = data[i].mPoint.parmvalue;
// if(data[i].getValueType=="getTodayFirstValue"){
// if(data[i].mPointHistory.length>0){
// nowWaterPowerday=data[i].mPointHistory[0].parmvalue;
// }
//
// }else if(data[i].getValueType=="getYesterdayFirstValue"){
// if(data[i].mPointHistory.length>0){
// lastWaterPowerday=data[i].mPointHistory[0].parmvalue;
// }
// }
}
}
// var daypowerhb=(nowpowerdayP-lastpowerdayP)/lastpowerdayP*100;
// daypowerhb=daypowerhb.toFixed(2);
$('#dayPowerP').text(nowpowerdayP.toFixed(2));
// if(Number(daypowerhb)<0){
// $('#dayPowerH').css("color","red");
// $('#dayPowerH').text("⬇ 环比"+daypowerhb+"%");
// }else{
// $('#dayPowerH').css("color","#3fff00");
// $('#dayPowerH').text("⬆ 环比"+daypowerhb+"%");
// }
// var daydrughb=(nowdrugdayP-lastdrugdayP)/lastdrugdayP*100;
// daydrughb=daydrughb.toFixed(2);
$('#dayDrugP').text(nowdrugdayP.toFixed(2));
// if(Number(daydrughb)<0){
// $('#dayDrugH').css("color","red");
// $('#dayDrugH').text("⬇ 环比"+daydrughb+"%");
// }else{
// $('#dayDrugH').css("color","#3fff00");
// $('#dayDrugH').text("⬆ 环比"+daydrughb+"%");
// }
// var dayWaterPowerb=(nowWaterPowerday-lastWaterPowerday)/lastWaterPowerday*100;
// dayWaterPowerb=dayWaterPowerb.toFixed(2);
$('#dayWaterPowerP').text(nowWaterPowerday.toFixed(2));
// if(Number(dayWaterPowerb)<0){
// $('#dayWaterPowerH').css("color","red");
// $('#dayWaterPowerH').text("⬇ 环比"+dayWaterPowerb+"%");
// }else{
// $('#dayWaterPowerH').css("color","#3fff00");
// $('#dayWaterPowerH').text("⬆ 环比"+dayWaterPowerb+"%");
// }
}
getChart(series1,['#FFE047','#B7875D','#FFE047']);
}, 'json');
}
function typeChange(st){
if(st=='click1'){
$('#click1').css('background','#e1aa13');
$('#click2').css('background','#1a4970');
getChart(series1,['#FFE047','#B7875D','#FFE047']);
nowSt="click2";
nowColor=['#20E9F2','#815DB7','#08A3A3'];
}else{
$('#click1').css('background','#1a4970');
$('#click2').css('background','#e1aa13');
getChart(series2,['#20E9F2','#815DB7','#08A3A3']);
nowSt="click1";
nowColor=['#FFE047','#B7875D','#FFE047'];
}
}
function getChart(series,colors){
var mychart=echarts.init(document.getElementById('chart'));
var option = {
color:colors,
legend: {
data: ['实际', '昨日', '考核'],
top:10,
right:20,
textStyle:{
color:'#FFFFFF'
}
},
tooltip: {
trigger: 'axis'
},
grid:{
left: '4%', // 与容器左侧的距离
right: '4%', // 与容器右侧的距离
// top: '10%', // 与容器顶部的距离
bottom: '10%', // 与容器底部的距离
containLabel:true
},
xAxis: {
type:"category",
axisLine:{
lineStyle:{
color:'#ffffff',
}
},
axisTick: {
show: false
},
splitLine: {
show: false
}
},
yAxis: {
type : 'value',
axisLine:{
lineStyle:{
color:'#ffffff',
}
},
splitLine: {
show: true,
lineStyle:{
color: '#8C8C8C'
}
}
},
series: series
};
// console.log(option);
mychart.setOption(option,true);
}
/* 定时器 */
//setInterval(change, 60000); //每1分钟切换
setInterval(getValue, 3600000); //每一小时切换
var nowSt="click2";
var nowColor=['#20E9F2','#815DB7','#08A3A3'];
setInterval(function(){ typeChange(nowSt,nowColor) }, 6000);
/* 初始化 */
$(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) + "px";
document.getElementById("image1").src = ""+getRootPath()+"/images/大屏/电单耗.png";
document.getElementById("image2").src = ""+getRootPath()+"/images/大屏/药耗.png";
getValue();
//console.log("height",document.body.scrollHeight);
});
//获取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;
}
</script>
</head>
<body style="width:100%;height:100%;margin:0;padding:0;overflow-x:hidden;overflow-y:hidden;">
<div id="main" style="height:100%;width:100%;padding-top:30px;padding-left:10px;padding-right:10px;">
<div style="height:100%;width:100%;">
<div style="float:left;width:100%;height:26px;margin-left: 20px;">
<div style="float:left;width:33.3%;height:26px;">
<div style="float:left;width:100px;height:26px;line-height: 26px;color: #ffffff;font-size: 20px;">
日用电量
</div>
<div style="float:left;width:100px;height:26px;line-height: 26px;color: #ffffff;font-size: 16px;">
kWh
</div>
</div>
<div style="float:left;width:33.3%;height:26px;">
<div style="float:left;width:100px;height:26px;line-height: 26px;color: #ffffff;font-size: 20px;">
日药耗
</div>
<div style="float:left;width:100px;height:26px;line-height: 26px;color: #ffffff;font-size: 16px;">
kg/Km3
</div>
</div>
<div style="float:left;width:33.3%;height:26px;">
<div style="float:left;width:100px;height:26px;line-height: 26px;color: #ffffff;font-size: 20px;">
吨水电耗
</div>
<div style="float:left;width:100px;height:26px;line-height: 26px;color: #ffffff;font-size: 16px;">
kWh/t
</div>
</div>
</div>
<div style="float:left;width:100%;height:80px;margin-left: 20px;">
<div style="float:left;width:33.3%;height:80px;">
<div id="dayPowerP" style="float:left;height:80px;line-height: 80px;color: #69f6f9;font-size: 40px;">
</div>
<div id="dayPowerH" style="float:left;height:80px;line-height: 80px;font-size: 20px;padding-left: 10px;">
</div>
</div>
<div style="float:left;width:33.3%;height:80px;">
<div id="dayDrugP" style="float:left;height:80px;line-height: 80px;color: #69f6f9;font-size: 40px;">
</div>
<div id="dayDrugH" style="float:left;height:80px;line-height: 80px;font-size: 20px;padding-left: 10px;">
</div>
</div>
<div style="float:left;width:33.3%;height:80px;">
<div id="dayWaterPowerP" style="float:left;height:80px;line-height: 80px;color: #69f6f9;font-size: 40px;">
</div>
<div id="dayWaterPowerH" style="float:left;height:80px;line-height: 80px;font-size: 20px;padding-left: 10px;">
</div>
</div>
</div>
<div style="float:left;width:100%;height:280px;margin-left: 20px;background: #16314c;">
<div style="float: left;width: 20%;height: 100%;">
<div style="float: left;width:100%;height: 45px;line-height: 45px;padding-left: 15px;color: #ffffff;font-size: 20px;font-family: Microsoft YaHei, Microsoft YaHei-Regular;">能耗曲线</div>
<div id="click1" onclick="typeChange('click1');" style="float: left;width:125px;height: 53px;margin-left: 15px;background: #e1aa13;border-radius: 10px;cursor: pointer;">
<div style="float: left;width: 30px;height: 53px;padding-left: 9px;padding-top: 11px;padding-bottom: 11px;">
<img id="image1" src="" style="z-index:998;position:relative;height:100%;width:100%;"/>
</div>
<div style="float: left;width: 84px;height: 53px;padding-left: 10px;padding-top: 11px;padding-bottom: 11px;">
<div style="float: left;width: 100%;height: 55%;text-align: left;color: #ffffff;font-size: 16px;">电单耗</div>
<div style="float: left;width: 100%;height: 45%;text-align: left;color: #ffffff;font-size: 8px;">kWh/t</div>
</div>
</div>
<div id="click2" onclick="typeChange('click2');" style="float: left;width:125px;height: 53px;margin-left: 15px;margin-top: 15px;background: #1a4970;border-radius: 10px;cursor: pointer;">
<div style="float: left;width: 37px;height: 53px;padding-left: 9px;padding-top: 11px;padding-bottom: 11px;">
<img id="image2" src="" style="z-index:998;position:relative;height:100%;width:100%;"/>
</div>
<div style="float: left;width: 78px;height: 53px;padding-left: 10px;padding-top: 11px;padding-bottom: 11px;">
<div style="float: left;width: 100%;height: 55%;text-align: left;color: #ffffff;font-size: 16px;">药耗</div>
<div style="float: left;width: 100%;height: 45%;text-align: left;color: #ffffff;font-size: 8px;">kg/Km3</div>
</div>
</div>
</div>
<div style="float: left;width: 80%;height: 100%;">
<div id="chart" style="width: 100%;height: 100%;"></div>
</div>
</div>
</div>
</div>
</body>
</html>