191 lines
7.1 KiB
Plaintext
191 lines
7.1 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_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页-->
|
|
<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;
|
|
}
|
|
//获取url地址根目录 当前taomcat下路径
|
|
function getRootPath2(){
|
|
var pathName = window.location.pathname.substring(1);
|
|
var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));
|
|
return window.location.protocol + '//' + window.location.host +"/"+webName;
|
|
}
|
|
|
|
/* 请求数据 */
|
|
function getoperationDataForPumpStationValue() {
|
|
|
|
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
|
|
// console.log(data);
|
|
if(data!=''){
|
|
var series1=[];
|
|
var seriesData1=[];
|
|
var xAxisData1=[];
|
|
var legendData1=[];
|
|
legendData1.push("运行时间");
|
|
|
|
var series2=[];
|
|
var seriesData2=[];
|
|
var xAxisData2=[];
|
|
var legendData2=[];
|
|
legendData2.push("指令数");
|
|
|
|
var series3=[];
|
|
var seriesData3=[];
|
|
var seriesData4=[];
|
|
var xAxisData3=[];
|
|
var legendData3=[];
|
|
legendData3.push("进水量");
|
|
legendData3.push("出水量");
|
|
for(var i=0;i<data.length;i++){
|
|
if(data[i].elementCode.indexOf("runningTime")>=0){
|
|
seriesData1.push(data[i].visualCacheData.value);
|
|
xAxisData1.push(data[i].name);
|
|
}else if(data[i].elementCode.indexOf("orderNum")>=0){
|
|
seriesData2.push(data[i].visualCacheData.value);
|
|
xAxisData2.push(data[i].name);
|
|
}else if(data[i].elementCode.indexOf("inWater")>=0){
|
|
seriesData3.push(data[i].visualCacheData.value);
|
|
xAxisData3.push(data[i].name);
|
|
}else if(data[i].elementCode.indexOf("outWater")>=0){
|
|
seriesData4.push(data[i].visualCacheData.value);
|
|
}
|
|
}
|
|
|
|
series1.push({
|
|
type: 'bar',
|
|
data:seriesData1,
|
|
name:"运行时间",
|
|
barWidth : 30,
|
|
})
|
|
|
|
series2.push({
|
|
type: 'bar',
|
|
data:seriesData2,
|
|
name:"指令数",
|
|
barWidth : 30,
|
|
})
|
|
|
|
series3.push({
|
|
type: 'bar',
|
|
data:seriesData3,
|
|
name:"进水量",
|
|
barWidth : 30,
|
|
})
|
|
series3.push({
|
|
type: 'bar',
|
|
data:seriesData4,
|
|
name:"出水量",
|
|
barWidth : 30,
|
|
})
|
|
|
|
getoperationDataForPumpStationchart('yxsjchart','运行时间本日累计',series1,xAxisData1,legendData1);
|
|
getoperationDataForPumpStationchart('zlschart','指令数本日累计',series2,xAxisData2,legendData2);
|
|
getoperationDataForPumpStationchart('jcschart','进出水量本日累计',series3,xAxisData3,legendData3);
|
|
}
|
|
},'json');
|
|
|
|
}
|
|
|
|
function getoperationDataForPumpStationchart(id,title,series,xAxisData,legendData){
|
|
var myChart = echarts.init(document.getElementById(id));
|
|
var option = {
|
|
color:['#3AA1FF','#4ECB73'],
|
|
title: {
|
|
text:title,
|
|
top:'5%',
|
|
textStyle:{
|
|
fontWeight:'400',
|
|
fontSize:16
|
|
}
|
|
},
|
|
tooltip: {
|
|
trigger: 'axis'
|
|
},
|
|
legend: {
|
|
data:legendData,
|
|
right:'10%',
|
|
top:'10%'
|
|
},
|
|
calculable: true,
|
|
xAxis: [
|
|
{
|
|
type: 'category',
|
|
data: xAxisData,
|
|
axisLabel: { rotate: -30 },
|
|
}
|
|
],
|
|
yAxis: [
|
|
{
|
|
type: 'value',
|
|
splitNumber:2
|
|
}
|
|
],
|
|
series:series
|
|
};
|
|
myChart.setOption(option, true);
|
|
window.addEventListener("resize", function () {
|
|
myChart.resize();
|
|
});
|
|
}
|
|
|
|
/* 定时器 */
|
|
setInterval(getoperationDataForPumpStationValue, 300000); //每5分钟切换
|
|
// 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) + "px";
|
|
|
|
getoperationDataForPumpStationValue();
|
|
//console.log("height",document.body.scrollHeight);
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body style="width:100%;height:100%;margin:0;padding:0;overflow-x:hidden;overflow-y:hidden;">
|
|
<div id="operationDataForPumpStationmain" style="height:calc(100% - 6px);width:100%;padding-top:10px;padding-left:10px;padding-right:10px;">
|
|
<div style="height:100%;width:100%;background:#ffffff;border: 1px solid #E1E1E1;border-radius: 4px;box-shadow: 2px 2px 4px 0px #696969, 0px 0px 4px 0px #696969;padding-top:10px;padding-left:10px;padding-right:10px;">
|
|
<div style="float: left;width: 100%;height:30px;">
|
|
<div style="float: left;width:5px;height:100%;margin-left: 15px;padding-top:5px;padding-bottom:5px;"><div style="width: 100%;height: 100%;background-color:skyblue;"></div></div>
|
|
<div style="float: left;height:100%;margin-left: 10px;line-height: 30px;">泵房运行情况</div>
|
|
</div>
|
|
<div style="float: left;width: 100%;height:calc(100% - 30px);">
|
|
<div id="yxsjchart" style="float: left;width: 50%;height: 50%;"></div>
|
|
<div id="zlschart" style="float: left;width: 50%;height: 50%;"></div>
|
|
<div id="jcschart" style="float: left;width: 100%;height: 50%;"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |