230 lines
10 KiB
Plaintext
230 lines
10 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">
|
|
|
|
//获取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;
|
|
}
|
|
|
|
var mychart="";
|
|
/* 请求数据 */
|
|
function getValue() {
|
|
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
|
|
if(data!=null&&data.length>0){
|
|
var textNum=0;
|
|
var barNum=0;
|
|
for(var i=0;i<data.length;i++){
|
|
if(data[i].elementCode=="text"){
|
|
textNum++;
|
|
}else if(data[i].elementCode=="bar"){
|
|
barNum++;
|
|
}
|
|
}
|
|
|
|
var textHtml="";
|
|
var nowtextNum=0;
|
|
for(var m=0;m<data.length;m++){
|
|
if(data[m].elementCode=="text"){
|
|
var backgroundColor="";
|
|
if(nowtextNum==0){
|
|
backgroundColor="#8d40cc";
|
|
}else if(nowtextNum==1){
|
|
backgroundColor="#4864D7";
|
|
}
|
|
textHtml+="<div style='float:left;padding-left:5px;padding-right:5px;padding-top:20px;padding-bottom:20px;width:100%;height: calc((100vh - 60px - 30px)/"+textNum+");'>";
|
|
textHtml+="<div style='float:left;width:100%;height:100%;background:"+backgroundColor+";border-radius:10px;'>";
|
|
textHtml+="<div style='float:left;width:100%;height:50%;line-height: calc((100vh - 60px - 45px)/"+textNum+"/2 + 15px);background:"+backgroundColor+";border-radius:10px;color: #fafafa;font-family: Helvetica;font-size: 20px;text-align: center;'>"+data[m].name+"</div>";
|
|
textHtml+="<div style='float:left;width:100%;height:50%;line-height: calc((100vh - 60px - 45px)/"+textNum+"/2 - 20px);background:"+backgroundColor+";border-radius:10px;color: #ffffff;font-family: Helvetica;font-size: 24px;text-align: center;'>"+data[m].mPoint.parmvalue+"</div>";
|
|
textHtml+="</div>";
|
|
textHtml+="</div>";
|
|
nowtextNum++;
|
|
}
|
|
}
|
|
$('#text').html(textHtml);
|
|
|
|
var nowbarNum=0;
|
|
for(var m=0;m<data.length;m++){
|
|
if(data[m].elementCode=="bar"){
|
|
var backgroundColor="";
|
|
var value=data[m].mPoint.parmvalue;
|
|
var chartid="";
|
|
var subtext="";
|
|
if(nowbarNum==0){
|
|
backgroundColor="#41C6C9";
|
|
chartid="chart1";
|
|
subtext="完好率";
|
|
}else if(nowbarNum==1){
|
|
backgroundColor="#F5A623";
|
|
chartid="chart2";
|
|
subtext="保养完成率";
|
|
}
|
|
|
|
var mychart=echarts.init(document.getElementById(''+chartid+''));
|
|
var option = {
|
|
title: {
|
|
text: value.toFixed(0)+"%",
|
|
textStyle: {
|
|
color: '#01c4a3',
|
|
fontSize: 24
|
|
},
|
|
subtext: subtext,
|
|
subtextStyle: {
|
|
color: '#909090',
|
|
fontSize: 22
|
|
},
|
|
itemGap: 5, // 主副标题距离
|
|
left: 'center',
|
|
top: 'center'
|
|
},
|
|
angleAxis: {
|
|
max: 100, // 满分
|
|
clockwise: false, // 逆时针
|
|
// 隐藏刻度线
|
|
axisLine: {
|
|
show: false
|
|
},
|
|
axisTick: {
|
|
show: false
|
|
},
|
|
axisLabel: {
|
|
show: false
|
|
},
|
|
splitLine: {
|
|
show: false
|
|
}
|
|
},
|
|
radiusAxis: {
|
|
type: 'category',
|
|
// 隐藏刻度线
|
|
axisLine: {
|
|
show: false
|
|
},
|
|
axisTick: {
|
|
show: false
|
|
},
|
|
axisLabel: {
|
|
show: false
|
|
},
|
|
splitLine: {
|
|
show: false
|
|
}
|
|
},
|
|
polar: {
|
|
center: ['50%', '50%'],
|
|
radius: '160%' //图形大小
|
|
},
|
|
series: [{
|
|
type: 'bar',
|
|
data: [{
|
|
name: '百分比',
|
|
value: value,
|
|
itemStyle: {
|
|
color: backgroundColor
|
|
},
|
|
}],
|
|
coordinateSystem: 'polar',
|
|
roundCap: true,
|
|
barWidth: 15,
|
|
barGap: '-100%', // 两环重叠
|
|
z: 2,
|
|
},{ // 灰色环
|
|
type: 'bar',
|
|
data: [{
|
|
value: 100,
|
|
itemStyle: {
|
|
color: '#2B3F69',
|
|
shadowColor: 'rgba(0, 0, 0, 0.2)',
|
|
shadowBlur: 5,
|
|
shadowOffsetY: 2
|
|
}
|
|
}],
|
|
coordinateSystem: 'polar',
|
|
roundCap: true,
|
|
barWidth: 15,
|
|
barGap: '-100%', // 两环重叠
|
|
z: 1
|
|
}]
|
|
};
|
|
// console.log(option);
|
|
mychart.setOption(option,true);
|
|
|
|
nowbarNum++;
|
|
}
|
|
}
|
|
|
|
}
|
|
}, '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="text" style="float:left;width:15%;height: calc(100vh - 60px - 15px);"></div>
|
|
<div style="float:left;width:85%;height: calc(100vh - 60px - 15px);">
|
|
<div style="float:left;width:50%;height:100%">
|
|
<div id="chart1" style="float:left;width:70%;height:100%"></div>
|
|
<div id="text3" style="float:left;width:30%;height:100%"></div>
|
|
</div>
|
|
<div style="float:left;width:50%;height:100%">
|
|
<div id="chart2" style="float:left;width:70%;height:100%"></div>
|
|
<div id="text4" style="float:left;width:30%;height:100%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |