190 lines
6.2 KiB
Plaintext
190 lines
6.2 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页-->
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/tableScroll.js" charset="utf-8"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
/* 请求数据 */
|
|
function getValue() {
|
|
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
|
|
// console.log(data);
|
|
if(data!=''){
|
|
var legendDatas=[];
|
|
var series=[];
|
|
var title="";
|
|
for(var i=0;i<data.length;i++){
|
|
if(data[i].elementCode=="line"){
|
|
legendDatas.push(data[i].name);
|
|
// 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,13));
|
|
// ddata.push(his.parmvalue);
|
|
// datas.push(ddata);
|
|
// }
|
|
series.push({
|
|
data: data[i].jsonArray,
|
|
name: data[i].name,
|
|
type: 'line',
|
|
symbol:'none',
|
|
smooth: true
|
|
});
|
|
|
|
}else if(data[i].elementCode=="title"){
|
|
title=data[i].valueUrl;
|
|
}
|
|
}
|
|
getChart(title,legendDatas,series);
|
|
}
|
|
}, 'json');
|
|
|
|
}
|
|
|
|
var colors=[
|
|
"#2ec7c9",
|
|
"#b6a2de",
|
|
"#5ab1ef",
|
|
"#ffb980",
|
|
"#d87a80",
|
|
"#8d98b3",
|
|
"#e5cf0d",
|
|
"#97b552",
|
|
"#95706d",
|
|
"#dc69aa",
|
|
"#07a2a4",
|
|
"#9a7fd1",
|
|
"#588dd5",
|
|
"#f5994e",
|
|
"#c05050",
|
|
"#59678c",
|
|
"#c9ab00",
|
|
"#7eb00a",
|
|
"#6f5553",
|
|
"#c14089"
|
|
];
|
|
function getChart(title,legendDatas,series){
|
|
document.getElementById("chart").removeAttribute("_echarts_instance_");
|
|
var mychart=echarts.init(document.getElementById('chart'));
|
|
var option = {
|
|
color:colors,
|
|
title: {
|
|
text: title,
|
|
top:10,
|
|
left:20,
|
|
textStyle:{
|
|
color:'#FFFFFF'
|
|
}
|
|
},
|
|
legend: {
|
|
data: legendDatas,
|
|
top:10,
|
|
right:20,
|
|
textStyle:{
|
|
color:'#FFFFFF'
|
|
}
|
|
},
|
|
tooltip: {
|
|
trigger: 'axis'
|
|
},
|
|
grid:{
|
|
left: '4%', // 与容器左侧的距离
|
|
right: '4%', // 与容器右侧的距离
|
|
// top: '10%', // 与容器顶部的距离
|
|
bottom: '10%', // 与容器底部的距离
|
|
containLabel:true
|
|
},
|
|
xAxis: {
|
|
type:"time",
|
|
axisLine:{
|
|
lineStyle:{
|
|
color:'#ffffff',
|
|
}
|
|
},
|
|
axisTick: {
|
|
show: false
|
|
},
|
|
splitLine: {
|
|
show: false
|
|
}
|
|
},
|
|
yAxis: {
|
|
type : 'value',
|
|
// scale:true,
|
|
max: function (value) {
|
|
return (value.max*1.2).toFixed(2);
|
|
},
|
|
axisLine:{
|
|
lineStyle:{
|
|
color:'#ffffff',
|
|
}
|
|
},
|
|
splitLine: {
|
|
show: true,
|
|
lineStyle:{
|
|
color: '#8C8C8C'
|
|
}
|
|
}
|
|
},
|
|
series: series
|
|
};
|
|
// console.log(option);
|
|
mychart.setOption(option,true);
|
|
}
|
|
|
|
/* 定时器 */
|
|
setInterval(getValue, 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";
|
|
|
|
getValue();
|
|
});
|
|
|
|
//获取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:20px;padding-left:10px;padding-right:10px;">
|
|
<div id="chart" style="height:100%;width:100%;">
|
|
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |