333 lines
15 KiB
Plaintext
333 lines
15 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">
|
||
|
||
/* 请求数据 */
|
||
function getValue() {
|
||
$.post(ext.contextPath + '/plan/getJspWholeInfoByPlanLayoutId.do', { planLayoutId: "${param.planLayoutId}" }, function (data) {
|
||
// console.log(data);
|
||
if(data!=''){
|
||
var totalJSSBNum="";var usingJSSBNum="";
|
||
var totalJSSSNum="";var usingJSSSNum="";
|
||
var totalSZYBNum="";var usingSZYBNum="";
|
||
var totalZKSBNum="";var usingZKSBNum="";
|
||
|
||
var jssbRemark="";var jsssRemark="";
|
||
var szybRemark="";var zksbRemark="";
|
||
|
||
for(var i=0;i<data.length;i++){
|
||
var fordata=numOutput(data[i].valueUrl);
|
||
if(data[i].elementCode=="totalJSSBNum"){
|
||
$("#totalJSSBNum").text("/"+fordata);
|
||
totalJSSBNum=data[i].valueUrl;
|
||
}else if(data[i].elementCode=="usingJSSBNum"){
|
||
$("#usingJSSBNum").text(fordata);
|
||
usingJSSBNum=data[i].valueUrl;
|
||
}else if(data[i].elementCode=="totalJSSSNum"){
|
||
$("#totalJSSSNum").text("/"+fordata);
|
||
totalJSSSNum=data[i].valueUrl;
|
||
}else if(data[i].elementCode=="usingJSSSNum"){
|
||
$("#usingJSSSNum").text(fordata);
|
||
usingJSSSNum=data[i].valueUrl;
|
||
}else if(data[i].elementCode=="totalSZYBNum"){
|
||
$("#totalSZYBNum").text("/"+fordata);
|
||
totalSZYBNum=data[i].valueUrl;
|
||
}else if(data[i].elementCode=="usingSZYBNum"){
|
||
$("#usingSZYBNum").text(fordata);
|
||
usingSZYBNum=data[i].valueUrl;
|
||
}else if(data[i].elementCode=="totalZKSBNum"){
|
||
$("#totalZKSBNum").text("/"+fordata);
|
||
totalZKSBNum=data[i].valueUrl;
|
||
}else if(data[i].elementCode=="usingZKSBNum"){
|
||
$("#usingZKSBNum").text(fordata);
|
||
usingZKSBNum=data[i].valueUrl;
|
||
}else if(data[i].elementCode=="jssbRemark"){
|
||
jssbRemark=data[i].valueUrl.replaceAll(",","<br>");
|
||
// $('#jssbRemark').attr('title',jssbRemark);
|
||
}else if(data[i].elementCode=="jsssRemark"){
|
||
jsssRemark=data[i].valueUrl.replaceAll(",","<br>");
|
||
// $('#jsssRemark').attr('title',jsssRemark);
|
||
}else if(data[i].elementCode=="szybRemark"){
|
||
szybRemark=data[i].valueUrl.replaceAll(",","<br>");
|
||
// $('#szybRemark').attr('title',szybRemark);
|
||
}else if(data[i].elementCode=="zksbRemark"){
|
||
zksbRemark=data[i].valueUrl.replaceAll(",","<br>");
|
||
// $('#zksbRemark').attr('title',zksbRemark);
|
||
}
|
||
}
|
||
getchart('jssbChart',(Number(usingJSSBNum)/Number(totalJSSBNum)*100).toFixed(1),'','#36FFF9',jssbRemark);
|
||
getchart('jsssChart',(Number(usingJSSSNum)/Number(totalJSSSNum)*100).toFixed(1),'','#36FFF9',jsssRemark);
|
||
getchart('szybChart',(Number(usingSZYBNum)/Number(totalSZYBNum)*100).toFixed(1),'','#36FFF9',szybRemark);
|
||
getchart('zksbChart',(Number(usingZKSBNum)/Number(totalZKSBNum)*100).toFixed(1),'','#36FFF9',zksbRemark);
|
||
|
||
}
|
||
}, 'json');
|
||
}
|
||
|
||
function numOutput(num){
|
||
var numpart=String(num).split(".");//将数字通过jq split用小数点分隔为数组对象
|
||
numpart[0]=numpart[0].replace(new RegExp('(\\d)(?=(\\d{3})+$)','ig'),"$1,");
|
||
//将数组对象第一个数据(整数部分)通过正则表达式每三位用逗号分隔
|
||
return numpart.join(".");//把数组通过join方法用.进行拼接
|
||
}
|
||
|
||
/* 定时器 */
|
||
//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) + "px";
|
||
|
||
document.getElementById("titleImage").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;
|
||
}
|
||
|
||
function getchart(id,value,title,color,tooltip){
|
||
var myChart = echarts.init(document.getElementById(id));
|
||
var option = {
|
||
title: {
|
||
text: value,
|
||
textStyle: {
|
||
color: '#36FFF9',
|
||
fontSize: 24
|
||
},
|
||
subtext: "%",
|
||
subtextStyle: {
|
||
color: '#36FFF9',
|
||
fontSize: 14
|
||
},
|
||
itemGap: 6, // 主副标题距离
|
||
left: 'center',
|
||
top: '35%'
|
||
},
|
||
tooltip: {
|
||
trigger: 'item',
|
||
formatter: function(param) //自定义弹出框的内容
|
||
{
|
||
// var lightTypeList = param.data.lightTypeList;
|
||
// //拼接一个字符串
|
||
// var res = param.data.name + '<br/>';
|
||
// //循环遍历内容
|
||
// for(var i = 0, length = lightTypeList.length; i < length; i++) {
|
||
// var val = lightTypeList[i].lightTotal;
|
||
// res += lightTypeList[i].lightName + ':' + val + '<br/>';
|
||
// }
|
||
return tooltip;
|
||
}
|
||
},
|
||
angleAxis: {
|
||
max: 100, // 满分
|
||
clockwise: true, // 逆时针
|
||
// 隐藏刻度线
|
||
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: '130%' //图形大小
|
||
},
|
||
series: [{
|
||
type: 'bar',
|
||
data: [{
|
||
name: '百分比',
|
||
value: value,
|
||
itemStyle: {
|
||
color: color
|
||
},
|
||
}],
|
||
coordinateSystem: 'polar',
|
||
roundCap: true,
|
||
barWidth: 8,
|
||
barGap: '-100%', // 两环重叠
|
||
z: 2
|
||
},{ // 灰色环
|
||
type: 'bar',
|
||
data: [{
|
||
value: 100,
|
||
itemStyle: {
|
||
color: '#1D4F6D',
|
||
shadowColor: 'rgba(0, 0, 0, 0.2)',
|
||
shadowBlur: 2,
|
||
shadowOffsetY: 2
|
||
}
|
||
}],
|
||
coordinateSystem: 'polar',
|
||
roundCap: true,
|
||
barWidth: 14,
|
||
barGap: '-130%', // 两环重叠
|
||
z: 1
|
||
}]
|
||
};
|
||
myChart.setOption(option, true);
|
||
window.addEventListener("resize", function () {
|
||
myChart.resize();
|
||
});
|
||
}
|
||
|
||
</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:10px;padding-left:10px;padding-right:10px;">
|
||
<div style="height:100%;width:100%;">
|
||
<div style="float:left;width:100%;height:35px;margin-left: 20px;">
|
||
<div style="float:left;width:194px;height:34px;">
|
||
<div style="position:absolute;top:12px;left:50px;z-index:999;opacity: 1;font-size: 20px;font-family: Microsoft YaHei, Microsoft YaHei-Regular;margin-left:20px;">设备管理</div>
|
||
<img id="titleImage" src="" style="z-index:998;position:relative;height:100%;width:100%;"/>
|
||
</div>
|
||
</div>
|
||
<div style="float:left;width:100%;height:calc((100% - 55px)*0.25);padding-top: 10px;">
|
||
<div style="float:left;width:40%;height:100%;padding-left: 40px;padding-top: 45px;">
|
||
<table>
|
||
<tr>
|
||
<td style="color: #ffffff;text-align: right;font-size: 16px;">净水设备</td>
|
||
</tr>
|
||
<tr>
|
||
<td id="usingJSSBNum" style="color: #69f6f9;text-align: right;font-size: 30px;"></td>
|
||
</tr>
|
||
<tr>
|
||
<td id="totalJSSBNum" style="color: #69f6f9;text-align: right;font-size: 30px;"></td>
|
||
</tr>
|
||
<!-- <tr>
|
||
<td style="color: #ffffff;text-align: right;font-size: 16px;">投运净水设备</td>
|
||
</tr> -->
|
||
|
||
</table>
|
||
</div>
|
||
<div style="float:left;width:60%;height:100%;">
|
||
<div id="jssbRemark" style="float: left;width: 100%;height:30px;text-align: center;line-height: 30px;color: #ffffff;font-size: 20px;cursor: pointer;">净水设备完好率</div>
|
||
<div id="jssbChart" style="float: left;width: 100%;height: calc(100% - 30px);"></div>
|
||
</div>
|
||
</div>
|
||
<div style="float:left;width:100%;height:calc((100% - 55px)*0.25);padding-top: 10px;">
|
||
<div style="float:left;width:40%;height:100%;padding-left: 40px;padding-top: 45px;">
|
||
<table>
|
||
<tr>
|
||
<td style="color: #ffffff;text-align: right;font-size: 16px;">净水设施</td>
|
||
</tr>
|
||
<tr>
|
||
<td id="usingJSSSNum" style="color: #69f6f9;text-align: right;font-size: 30px;"></td>
|
||
</tr>
|
||
<tr>
|
||
<td id="totalJSSSNum" style="color: #69f6f9;text-align: right;font-size: 30px;"></td>
|
||
</tr>
|
||
<!-- <tr>
|
||
<td style="color: #ffffff;text-align: right;font-size: 16px;">投运净水设施</td>
|
||
</tr> -->
|
||
</table>
|
||
</div>
|
||
<div style="float:left;width:60%;height:100%;">
|
||
<div id="jsssRemark" style="float: left;width: 100%;height:30px;text-align: center;line-height: 30px;color: #ffffff;font-size: 20px;cursor: pointer;">净水设施完好率</div>
|
||
<div id="jsssChart" style="float: left;width: 100%;height: calc(100% - 30px);"></div>
|
||
</div>
|
||
</div>
|
||
<div style="float:left;width:100%;height:calc((100% - 55px)*0.25);padding-top: 10px;">
|
||
<div style="float:left;width:40%;height:100%;padding-left: 40px;padding-top: 45px;">
|
||
<table>
|
||
<tr>
|
||
<td style="color: #ffffff;text-align: right;font-size: 16px;">水质仪表</td>
|
||
</tr>
|
||
<tr>
|
||
<td id="usingSZYBNum" style="color: #69f6f9;text-align: right;font-size: 30px;"></td>
|
||
</tr>
|
||
<tr>
|
||
<td id="totalSZYBNum" style="color: #69f6f9;text-align: right;font-size: 30px;"></td>
|
||
</tr>
|
||
<!-- <tr>
|
||
<td style="color: #ffffff;text-align: right;font-size: 16px;">投运水质仪表</td>
|
||
</tr> -->
|
||
</table>
|
||
</div>
|
||
<div style="float:left;width:60%;height:100%;">
|
||
<div id="szybRemark" style="float: left;width: 100%;height:30px;text-align: center;line-height: 30px;color: #ffffff;font-size: 20px;cursor: pointer;">水质仪表完好率</div>
|
||
<div id="szybChart" style="float: left;width: 100%;height: calc(100% - 30px);"></div>
|
||
</div>
|
||
</div>
|
||
<div style="float:left;width:100%;height:calc((100% - 55px)*0.25);padding-top: 10px;">
|
||
<div style="float:left;width:40%;height:100%;padding-left: 40px;padding-top: 45px;">
|
||
<table>
|
||
<tr>
|
||
<td style="color: #ffffff;text-align: right;font-size: 16px;">自控设备</td>
|
||
</tr>
|
||
<tr>
|
||
<td id="usingZKSBNum" style="color: #69f6f9;text-align: right;font-size: 30px;"></td>
|
||
</tr>
|
||
<tr>
|
||
<td id="totalZKSBNum" style="color: #69f6f9;text-align: right;font-size: 30px;"></td>
|
||
</tr>
|
||
<!-- <tr>
|
||
<td style="color: #ffffff;text-align: right;font-size: 16px;">投运自控设备</td>
|
||
</tr> -->
|
||
</table>
|
||
</div>
|
||
<div style="float:left;width:60%;height:100%;">
|
||
<div id="zksbRemark" style="float: left;width: 100%;height:30px;text-align: center;line-height: 30px;color: #ffffff;font-size: 20px;cursor: pointer;">自控设备完好率</div>
|
||
<div id="zksbChart" style="float: left;width: 100%;height: calc(100% - 30px);"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
|
||
</html> |