first commit
This commit is contained in:
230
WebRoot/jsp/visual/modules/bigScreen_emissionReduction.jsp
Normal file
230
WebRoot/jsp/visual/modules/bigScreen_emissionReduction.jsp
Normal file
@ -0,0 +1,230 @@
|
||||
<%@ 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">
|
||||
|
||||
//获取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;
|
||||
}
|
||||
|
||||
var mychart="";
|
||||
/* 请求数据 */
|
||||
function getValue() {
|
||||
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
|
||||
// console.log(data);
|
||||
if(data!=null&&data.length>0){
|
||||
var series=[];
|
||||
var actualValue=0;
|
||||
var targetValue=0;
|
||||
var actualValueNum=0;
|
||||
for(var i=0;i<data.length;i++){
|
||||
if(data[i].elementCode=="targetValue"){
|
||||
targetValue=data[i].mPoint.parmvalue;
|
||||
series.push({
|
||||
name:data[i].name,
|
||||
stack:data[i].name,
|
||||
data: [data[i].mPoint.parmvalue],
|
||||
type:'bar',
|
||||
barWidth :30,
|
||||
barGap:2.5,
|
||||
itemStyle:{
|
||||
emphasis: {//柱形图圆角,鼠标移上去效果
|
||||
color:'#ffffff',
|
||||
barBorderRadius: [0, 0, 0, 0]
|
||||
},
|
||||
normal: {//柱形图圆角,初始化效果
|
||||
color:'gray',
|
||||
barBorderRadius:[0, 0, 0, 0],
|
||||
label: {
|
||||
// formatter: "{a}",
|
||||
formatter:function(params){ //标签内容
|
||||
var name=params.seriesName.split("(");
|
||||
return name[0];
|
||||
},
|
||||
show: true,
|
||||
position: "bottom",
|
||||
textStyle: {
|
||||
// fontWeight: "bolder",
|
||||
fontSize: "14",
|
||||
color: "#FFFFFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}else if(data[i].elementCode=="actualValue"){
|
||||
series.push({
|
||||
name:(data[i].mPoint.parmvalue).toFixed(2),
|
||||
data: [(data[i].mPoint.parmvalue-targetValue).toFixed(2)],
|
||||
stack:data[i].name,
|
||||
type:'bar',
|
||||
barWidth :30,
|
||||
barGap:2.5,
|
||||
itemStyle:{
|
||||
emphasis: {//柱形图圆角,鼠标移上去效果
|
||||
color:'#36BAFD',
|
||||
barBorderRadius: [10, 10,0,0]
|
||||
},
|
||||
normal: {//柱形图圆角,初始化效果
|
||||
color:'#36BAFD',
|
||||
barBorderRadius:[10, 10,0,0],
|
||||
label: {
|
||||
formatter: "{a}",
|
||||
show: true,
|
||||
position: "top",
|
||||
textStyle: {
|
||||
// fontWeight: "bolder",
|
||||
fontSize: "14",
|
||||
color: "#FFFFFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
actualValueNum++;
|
||||
}
|
||||
}
|
||||
|
||||
mychart=echarts.init(document.getElementById('chart'));
|
||||
var option = {
|
||||
animation:false,
|
||||
grid:{
|
||||
left: '4%', // 与容器左侧的距离
|
||||
right: '4%', // 与容器右侧的距离
|
||||
top: '10%', // 与容器顶部的距离
|
||||
bottom: '10%', // 与容器底部的距离
|
||||
containLabel:true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
axisLabel: {
|
||||
show: true,
|
||||
align:'center',
|
||||
textStyle: {
|
||||
color: '#FFFFFF' //更改坐标轴文字颜色
|
||||
}
|
||||
},
|
||||
axisLine:{
|
||||
show:true,
|
||||
lineStyle:{
|
||||
color:'#3B415C', //更改坐标轴颜色
|
||||
width: 2 // 粗细
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: false//是否显示分隔线。默认数值轴显示,类目轴不显示。
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type : 'value',
|
||||
name : false,
|
||||
axisLabel: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
color: '#FFFFFF' //更改坐标轴文字颜色
|
||||
}
|
||||
},
|
||||
axisLine:{
|
||||
show:true,
|
||||
lineStyle:{
|
||||
color:'#3B415C', //更改坐标轴颜色
|
||||
width: 2 // 粗细
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: true,//是否显示分隔线。默认数值轴显示,类目轴不显示。
|
||||
lineStyle:{
|
||||
color:'#262952',
|
||||
type:'dashed'
|
||||
}
|
||||
},
|
||||
// scale:true//设置成 true 后坐标刻度不会强制包含零刻度。
|
||||
},
|
||||
series: series
|
||||
};
|
||||
// console.log(option);
|
||||
mychart.setOption(option,true);
|
||||
|
||||
|
||||
var textnum=data.length-actualValueNum;
|
||||
var textHtml="";
|
||||
for(var m=0;m<data.length;m++){
|
||||
if(data[m].elementCode=="targetValue"){
|
||||
textHtml+="<div style='float:left;width:100%;height: calc((100vh - 60px - 40px)/"+textnum+");'>";
|
||||
textHtml+="<div style='float:left;width:100%;height: calc((100vh - 60px - 40px)/"+textnum+"/2);line-height: calc((100vh - 60px - 40px)/"+textnum+"/2);font-size: 18px;font-family: Helvetica;text-align: center;color: #ffffff;'>"+data[m].name+"</div>";
|
||||
textHtml+="<div style='float:left;width:100%;height: calc((100vh - 60px - 40px)/"+textnum+"/2);line-height: calc((100vh - 60px - 40px)/"+textnum+"/2);font-size: 20px;font-family: Helvetica;text-align: center;color: #69F6F9;'>"+(data[m].mPoint.parmvalue).toFixed(2)+"</div>";
|
||||
// textHtml+="";
|
||||
textHtml+="</div>";
|
||||
}
|
||||
}
|
||||
$('#text').html(textHtml);
|
||||
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
/* 定时器 */
|
||||
//setInterval(change, 60000); //每1分钟切换
|
||||
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-15) + "px";
|
||||
|
||||
document.getElementById("backImage").src = ""+getRootPath()+"/images/大屏/减排量.png";
|
||||
|
||||
getValue();
|
||||
//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 style="height:100%;width:100%;padding-top:15px;">
|
||||
<div id="main" style="height:100%;width:100%;padding:0px;background:rgba(19,32,85,0.27);border-radius: 8px;">
|
||||
<div style='float:left;width:50%;height:60px;'><img id="backImage" src="" style="z-index:-1;position:relative;height:100%;width: 100%;"/></div>
|
||||
<div style='float:left;width:50%;height:60px;'></div>
|
||||
<div id="chart" style="float:left;width:70%;height: calc(100vh - 60px - 15px);"></div>
|
||||
<div style="float:left;width:30%;height: calc(100vh - 60px - 10px);">
|
||||
<div id="titletext" style="float:left;width:100%;height:20px;color:#69F6F9;font-size:18px;text-align: center;margin-bottom: 15px;">计划值(灰色)</div>
|
||||
<div id="text" style="float:left;width:100%;height: calc(100vh - 60px - 50px);margin-top: -10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user